public static extern int BatteryState(int informationLevel, IntPtr inputBuffer, int inputBufferSize, out SYSTEM_BATTERY_STATE outputBuffer, int outputBufferSize);
 public static extern uint CallNtPowerInformation(
     int informationLevel,
     IntPtr lpInputBuffer,
     int nInputBufferSize,
     out SYSTEM_BATTERY_STATE spi,
     int nOutputBufferSize);