2014-04-06 20:22:59 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2014-04-21 10:24:05 +08:00
|
|
|
|
using System.Security;
|
2014-04-06 20:22:59 +08:00
|
|
|
|
|
2015-02-19 09:02:39 +08:00
|
|
|
|
namespace NTwain.Interop
|
2014-04-06 20:22:59 +08:00
|
|
|
|
{
|
2014-04-21 10:24:05 +08:00
|
|
|
|
[SuppressUnmanagedCodeSecurity]
|
|
|
|
|
static class UnsafeNativeMethods
|
2014-04-06 20:22:59 +08:00
|
|
|
|
{
|
|
|
|
|
#region mem stuff for twain 1.x
|
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalAlloc")]
|
2014-04-21 10:24:05 +08:00
|
|
|
|
internal 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 10:24:05 +08:00
|
|
|
|
internal static extern IntPtr WinGlobalFree(IntPtr hMem);
|
2014-04-06 20:22:59 +08:00
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalLock")]
|
2014-04-21 10:24:05 +08:00
|
|
|
|
internal 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 10:24:05 +08:00
|
|
|
|
internal static extern bool WinGlobalUnlock(IntPtr handle);
|
2014-04-06 20:22:59 +08:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|