mirror of
https://github.com/soukoku/ntwain.git
synced 2025-04-05 20:59:23 +08:00
Fixed wrong pointer passed to unlock method.
This commit is contained in:
parent
844f84e259
commit
d7a2bebe2a
@ -81,7 +81,8 @@ namespace NTwain
|
||||
{
|
||||
if (baseAddr != IntPtr.Zero)
|
||||
{
|
||||
memoryManager.Unlock(baseAddr);
|
||||
//memoryManager.Unlock(baseAddr);
|
||||
memoryManager.Unlock(capability.Container);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -773,7 +773,8 @@ namespace NTwain.Data
|
||||
{
|
||||
WriteValue(baseAddr, ref offset, value.ItemType, item);
|
||||
}
|
||||
memoryManager.Unlock(baseAddr);
|
||||
//memoryManager.Unlock(baseAddr);
|
||||
memoryManager.Unlock(_hContainer);
|
||||
}
|
||||
|
||||
void SetRangeValue(TWRange value, IMemoryManager memoryManager)
|
||||
@ -809,7 +810,8 @@ namespace NTwain.Data
|
||||
{
|
||||
WriteValue(baseAddr, ref offset, value.ItemType, item);
|
||||
}
|
||||
memoryManager.Unlock(baseAddr);
|
||||
memoryManager.Unlock(_hContainer);
|
||||
//memoryManager.Unlock(baseAddr);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -1484,7 +1486,8 @@ namespace NTwain.Data
|
||||
{
|
||||
if (lockPtr != IntPtr.Zero)
|
||||
{
|
||||
PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
|
||||
PlatformInfo.Current.MemoryManager.Unlock(Item);
|
||||
//PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace NTwain
|
||||
/// <summary>
|
||||
/// Function to unlock a previously locked memory region.
|
||||
/// </summary>
|
||||
/// <param name="handle">The handle from <see cref="Lock"/>.</param>
|
||||
/// <param name="handle">The same handle passed <see cref="Lock"/>.</param>
|
||||
void Unlock(IntPtr handle);
|
||||
}
|
||||
}
|
||||
|
@ -156,7 +156,8 @@ namespace NTwain.Internals
|
||||
// data here is allocated by source so needs to use shared mem calls
|
||||
if (lockedPtr != IntPtr.Zero)
|
||||
{
|
||||
PlatformInfo.Current.MemoryManager.Unlock(lockedPtr);
|
||||
//PlatformInfo.Current.MemoryManager.Unlock(lockedPtr);
|
||||
PlatformInfo.Current.MemoryManager.Unlock(dataPtr);
|
||||
lockedPtr = IntPtr.Zero;
|
||||
}
|
||||
if (dataPtr != IntPtr.Zero)
|
||||
@ -222,7 +223,8 @@ namespace NTwain.Internals
|
||||
// data here is allocated by source so needs to use shared mem calls
|
||||
if (lockedPtr != IntPtr.Zero)
|
||||
{
|
||||
PlatformInfo.Current.MemoryManager.Unlock(lockedPtr);
|
||||
//PlatformInfo.Current.MemoryManager.Unlock(lockedPtr);
|
||||
PlatformInfo.Current.MemoryManager.Unlock(dataPtr);
|
||||
lockedPtr = IntPtr.Zero;
|
||||
}
|
||||
if (dataPtr != IntPtr.Zero)
|
||||
@ -300,7 +302,8 @@ namespace NTwain.Internals
|
||||
{
|
||||
if (lockPtr != IntPtr.Zero)
|
||||
{
|
||||
PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
|
||||
PlatformInfo.Current.MemoryManager.Unlock(xferInfo.Memory.TheMem);
|
||||
//PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -376,7 +379,8 @@ namespace NTwain.Internals
|
||||
{
|
||||
if (lockPtr != IntPtr.Zero)
|
||||
{
|
||||
PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
|
||||
PlatformInfo.Current.MemoryManager.Unlock(xferInfo.Memory.TheMem);
|
||||
//PlatformInfo.Current.MemoryManager.Unlock(lockPtr);
|
||||
}
|
||||
}
|
||||
outStream.Write(buffer, 0, buffer.Length);
|
||||
|
Loading…
Reference in New Issue
Block a user