public void AcpiUnLoadDll() { AcpiDriver.FreeLibrary(this.hModule); this.hModule = IntPtr.Zero; this.getProc = IntPtr.Zero; this.setProc = IntPtr.Zero; }
public void AcpiLoadDll() { this.hModule = AcpiDriver.LoadLibrary(this.AcpiDriverDllName); if (this.hModule == IntPtr.Zero) { this.DEBUG("LoadLibrary file " + this.AcpiDriverDllName + " failed"); throw new Exception("Load " + this.AcpiDriverDllName + " failed"); } }
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); }