private static IsWow64ProcessDelegate GetIsWow64ProcessDelegate()
{
IntPtr handle = LoadLibrary("kernel32");
if (handle != IntPtr.Zero)
{
IntPtr ptr = GetProcAddress(handle, "IsWow64Process");
if (ptr != IntPtr.Zero)
{
return (IsWow64ProcessDelegate)Marshal.GetDelegateForFunctionPointer((IntPtr)ptr, typeof(IsWow64ProcessDelegate));
}
}
return null;
}