123456789101112131415161718192021222324252627282930313233343536373839 |
- using System.Runtime.InteropServices;
- using System.Security;
- namespace Bmp.Core.Common.Win32;
- internal static class NativeMethods
- {
- [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- public static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hFile, uint dwFlags);
- [DllImport("kernel32.dll", SetLastError = true)]
- [SuppressUnmanagedCodeSecurity]
- public static extern bool FreeLibrary(IntPtr hModule);
- [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- public static extern bool EnumResourceNames(IntPtr hModule, IntPtr lpszType, Enumresnameproc lpEnumFunc, IntPtr lParam);
- [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- public static extern IntPtr FindResource(IntPtr hModule, IntPtr lpName, IntPtr lpType);
- [DllImport("kernel32.dll", SetLastError = true)]
- [SuppressUnmanagedCodeSecurity]
- public static extern IntPtr LoadResource(IntPtr hModule, IntPtr hResInfo);
- [DllImport("kernel32.dll", SetLastError = true)]
- [SuppressUnmanagedCodeSecurity]
- public static extern IntPtr LockResource(IntPtr hResData);
- [DllImport("kernel32.dll", SetLastError = true)]
- [SuppressUnmanagedCodeSecurity]
- public static extern uint SizeofResource(IntPtr hModule, IntPtr hResInfo);
- }
- [UnmanagedFunctionPointer(CallingConvention.Winapi, SetLastError = true, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- internal delegate bool Enumresnameproc(IntPtr hModule, IntPtr lpszType, IntPtr lpszName, IntPtr lParam);
|