2014-04-06 20:22:59 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
2014-04-21 04:57:38 +08:00
|
|
|
|
namespace NTwain.Internals
|
2014-04-06 20:22:59 +08:00
|
|
|
|
{
|
|
|
|
|
static class NativeMethods
|
|
|
|
|
{
|
|
|
|
|
// should be unsafe native methods?
|
|
|
|
|
|
|
|
|
|
#region mem stuff for twain 1.x
|
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalAlloc")]
|
2014-04-21 06:42:51 +08:00
|
|
|
|
public static extern IntPtr WinGlobalAlloc(uint uFlags, UIntPtr dwBytes);
|
2014-04-06 20:22:59 +08:00
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalFree")]
|
2014-04-21 06:42:51 +08:00
|
|
|
|
public static extern IntPtr WinGlobalFree(IntPtr hMem);
|
2014-04-06 20:22:59 +08:00
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalLock")]
|
2014-04-21 06:42:51 +08:00
|
|
|
|
public static extern IntPtr WinGlobalLock(IntPtr handle);
|
2014-04-06 20:22:59 +08:00
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalUnlock")]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
2014-04-21 06:42:51 +08:00
|
|
|
|
public static extern bool WinGlobalUnlock(IntPtr handle);
|
2014-04-06 20:22:59 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|