public void AcpiLoadFun(string lpProcName, IntPtr Proc) { if (this.hModule == IntPtr.Zero) { this.DEBUG("hModule is null"); throw new Exception("hModule is null"); } Proc = AcpiDriver.GetProcAddress(this.hModule, lpProcName); if (Proc == IntPtr.Zero) { this.DEBUG("GetProcAddress " + lpProcName + " failed"); throw new Exception("GetProcAddress " + lpProcName + " failed"); } }
public void SetAcpiValueProc(int Offset) { if (this.hModule == IntPtr.Zero) { this.DEBUG("hModule is null"); throw new Exception("hModule is null"); } this.setProc = AcpiDriver.GetProcAddress(this.hModule, "SetAcpiValue"); if (this.setProc == IntPtr.Zero) { this.DEBUG("GetProcAddress SetAcpiValue failed"); throw new Exception("GetProcAddress SetAcpiValue failed"); } ((AcpiDriver.SetValue)Marshal.GetDelegateForFunctionPointer(this.setProc, typeof(AcpiDriver.SetValue)))(Offset); }