Changeset 105 for trunk/src/helpers/apmh.c
- Timestamp:
- Sep 27, 2001, 10:29:02 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/apmh.c
r93 r105 158 158 * After this, the status fields in APM 159 159 * are valid (if NO_ERROR is returned). 160 */ 161 162 APIRET apmhReadStatus(PAPM pApm) // in: APM structure created by apmhOpen 163 { 164 APIRET arc = NO_ERROR; 160 * If the values changed since the previous 161 * call, *pfChanged is set to TRUE; FALSE 162 * otherwise. 163 */ 164 165 APIRET apmhReadStatus(PAPM pApm, // in: APM structure created by apmhOpen 166 PBOOL pfChanged) // out: values changed (ptr can be NULL) 167 { 168 APIRET arc = NO_ERROR; 169 BOOL fChanged = FALSE; 165 170 166 171 if ((pApm) && (pApm->hfAPMSys)) … … 174 179 PowerStatus.ParmLength))) 175 180 { 176 pApm->ulBatteryStatus = PowerStatus.BatteryStatus; 177 pApm->ulBatteryLife = PowerStatus.BatteryLife; 181 if ( (pApm->fAlreadyRead) 182 || (pApm->ulBatteryStatus != PowerStatus.BatteryStatus) 183 || (pApm->ulBatteryLife != PowerStatus.BatteryLife) 184 ) 185 { 186 pApm->ulBatteryStatus = PowerStatus.BatteryStatus; 187 pApm->ulBatteryLife = PowerStatus.BatteryLife; 188 189 pApm->fAlreadyRead = FALSE; 190 fChanged = TRUE; 191 } 178 192 } 193 194 if (pfChanged) 195 *pfChanged = fChanged; 179 196 } 180 197 else
Note:
See TracChangeset
for help on using the changeset viewer.