twain-cs
twain-cs copied to clipboard
DsmMemAlloc passed in parameters in reversed order in Windows
public IntPtr DsmMemAlloc(uint a_u32Size)
{
IntPtr intptr;
// Use the DSM...
...
// Do it ourselves, Windows...
if (ms_platform == Platform.WINDOWS)
{
intptr = (IntPtr)NativeMethods.GlobalAlloc((uint)a_u32Size, (UIntPtr)0x0042 /* GHND */);
The first parameter should be the flag, as defined below
[DllImport("kernel32.dll")]
internal static extern IntPtr GlobalAlloc(uint uFlags, UIntPtr dwBytes);