2014-04-06 08:22:59 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2014-04-20 22:24:05 -04:00
|
|
|
|
using System.Security;
|
2014-04-06 08:22:59 -04:00
|
|
|
|
|
2014-04-20 16:57:38 -04:00
|
|
|
|
namespace NTwain.Internals
|
2014-04-06 08:22:59 -04:00
|
|
|
|
{
|
2014-04-20 22:24:05 -04:00
|
|
|
|
[SuppressUnmanagedCodeSecurity]
|
|
|
|
|
static class UnsafeNativeMethods
|
2014-04-06 08:22:59 -04:00
|
|
|
|
{
|
|
|
|
|
#region mem stuff for twain 1.x
|
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalAlloc")]
|
2014-04-20 22:24:05 -04:00
|
|
|
|
internal static extern IntPtr WinGlobalAlloc(uint uFlags, UIntPtr dwBytes);
|
2014-04-06 08:22:59 -04:00
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalFree")]
|
2014-04-20 22:24:05 -04:00
|
|
|
|
internal static extern IntPtr WinGlobalFree(IntPtr hMem);
|
2014-04-06 08:22:59 -04:00
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalLock")]
|
2014-04-20 22:24:05 -04:00
|
|
|
|
internal static extern IntPtr WinGlobalLock(IntPtr handle);
|
2014-04-06 08:22:59 -04:00
|
|
|
|
|
|
|
|
|
[DllImport("kernel32", SetLastError = true, EntryPoint = "GlobalUnlock")]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
2014-04-20 22:24:05 -04:00
|
|
|
|
internal static extern bool WinGlobalUnlock(IntPtr handle);
|
2014-04-06 08:22:59 -04:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
2014-09-05 06:56:57 -04:00
|
|
|
|
|
|
|
|
|
static class NativeMethods
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
[DllImport("user32.dll")]
|
|
|
|
|
public static extern IntPtr DefWindowProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
|
|
|
|
|
}
|
2014-04-06 08:22:59 -04:00
|
|
|
|
}
|