fix support for x86 32-bit process builds (#1144)
This commit is contained in:
@@ -52,7 +52,7 @@ internal class BatteryGroup : IGroup
|
||||
if (Marshal.GetLastWin32Error() == SetupApi.ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
IntPtr pdidd = Kernel32.LocalAlloc(Kernel32.LPTR, cbRequired);
|
||||
Marshal.WriteInt32(pdidd, Environment.Is64BitOperatingSystem ? 8 : 4); // cbSize.
|
||||
Marshal.WriteInt32(pdidd, Environment.Is64BitProcess ? 8 : 4 + Marshal.SystemDefaultCharSize); // cbSize.
|
||||
|
||||
if (SetupApi.SetupDiGetDeviceInterfaceDetail(hdev,
|
||||
did,
|
||||
|
||||
@@ -218,7 +218,7 @@ internal static class NvApi
|
||||
|
||||
private static void GetDelegate<T>(uint id, out T newDelegate) where T : class
|
||||
{
|
||||
IntPtr ptr = Environment.Is64BitOperatingSystem ? NvAPI64_QueryInterface(id) : NvAPI32_QueryInterface(id);
|
||||
IntPtr ptr = Environment.Is64BitProcess ? NvAPI64_QueryInterface(id) : NvAPI32_QueryInterface(id);
|
||||
|
||||
if (ptr != IntPtr.Zero)
|
||||
newDelegate = Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T;
|
||||
@@ -228,7 +228,7 @@ internal static class NvApi
|
||||
|
||||
public static bool DllExists()
|
||||
{
|
||||
IntPtr module = Kernel32.LoadLibrary(Environment.Is64BitOperatingSystem ? DllName64 : DllName);
|
||||
IntPtr module = Kernel32.LoadLibrary(Environment.Is64BitProcess ? DllName64 : DllName);
|
||||
if (module == IntPtr.Zero)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user