Changeset 51092 in vbox for trunk/src/VBox/Main/src-server/win/HostPowerWin.cpp
- Timestamp:
- Apr 16, 2014 5:57:25 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93367
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/HostPowerWin.cpp
r49938 r51092 172 172 if (GetSystemPowerStatus(&SystemPowerStatus) == TRUE) 173 173 { 174 Log(("PBT_APMPOWERSTATUSCHANGE ACLineStatus=%d BatteryFlag=%d\n", SystemPowerStatus.ACLineStatus, SystemPowerStatus.BatteryFlag)); 174 Log(("PBT_APMPOWERSTATUSCHANGE ACLineStatus=%d BatteryFlag=%d\n", SystemPowerStatus.ACLineStatus, 175 SystemPowerStatus.BatteryFlag)); 175 176 176 177 if (SystemPowerStatus.ACLineStatus == 0) /* offline */ … … 181 182 SYSTEM_BATTERY_STATE BatteryState; 182 183 183 rc = CallNtPowerInformation(SystemBatteryState, NULL, 0, (PVOID)&BatteryState, sizeof(BatteryState)); 184 rc = CallNtPowerInformation(SystemBatteryState, NULL, 0, (PVOID)&BatteryState, 185 sizeof(BatteryState)); 184 186 #ifdef LOG_ENABLED 185 187 if (rc == 0 /* STATUS_SUCCESS */) 186 Log(("CallNtPowerInformation claims %d seconds of power left\n", BatteryState.EstimatedTime)); 188 Log(("CallNtPowerInformation claims %d seconds of power left\n", 189 BatteryState.EstimatedTime)); 187 190 #endif 188 191 if ( rc == 0 /* STATUS_SUCCESS */ … … 193 196 } 194 197 else 195 /* If the machine has less than 5% battery left (and is not connected to the AC), then we should save the state. */ 198 /* If the machine has less than 5% battery left (and is not connected 199 * to the AC), then we should save the state. */ 196 200 if (SystemPowerStatus.BatteryFlag == 4 /* critical battery status; less than 5% */) 197 201 {
Note:
See TracChangeset
for help on using the changeset viewer.