Files
ntwain/NTwain/Internals/UnsafeNativeMethods.cs

28 lines
916 B
C#
Raw Normal View History

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
}
}