Ejemplo n.º 1
0
 public void AcpiUnLoadDll()
 {
     AcpiDriver.FreeLibrary(this.hModule);
     this.hModule = IntPtr.Zero;
     this.getProc = IntPtr.Zero;
     this.setProc = IntPtr.Zero;
 }
Ejemplo n.º 2
0
 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");
     }
 }
Ejemplo n.º 3
0
 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");
     }
 }
Ejemplo n.º 4
0
 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);
 }