diff options
author | Kostas Nakos | 2007-11-13 19:46:21 +0000 |
---|---|---|
committer | Kostas Nakos | 2007-11-13 19:46:21 +0000 |
commit | d66e4901ed5a04a3328e72f76546a7d3fbd807eb (patch) | |
tree | 7985f5d212a1be0c18d2dc6a2d62af485edccb61 | |
parent | 2ae1c3c4965ff157f9f3232eec8173b0acddf3a3 (diff) | |
download | scummvm-rg350-d66e4901ed5a04a3328e72f76546a7d3fbd807eb.tar.gz scummvm-rg350-d66e4901ed5a04a3328e72f76546a7d3fbd807eb.tar.bz2 scummvm-rg350-d66e4901ed5a04a3328e72f76546a7d3fbd807eb.zip |
don't trash the registry if proper startup has failed
svn-id: r29497
-rw-r--r-- | backends/platform/wince/CEDevice.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp index 47eee74802..dccbc2208b 100644 --- a/backends/platform/wince/CEDevice.cpp +++ b/backends/platform/wince/CEDevice.cpp @@ -35,6 +35,7 @@ static DWORD (WINAPI* _ReleasePowerRequirement)(HANDLE) = NULL; static HANDLE _hPowerManagement = NULL; static DWORD _lastTime = 0; static DWORD REG_bat = 0, REG_ac = 0, REG_disp = 0, bat_timeout = 0; +static bool REG_tampered = false; #ifdef __GNUC__ extern "C" void WINAPI SystemIdleTimerReset(void); #define SPI_SETBATTERYIDLETIMEOUT 251 @@ -99,6 +100,7 @@ void CEDevice::init() { // older devices REG_bat = REG_ac = REG_disp = 2 * 60 * 60 * 1000; // 2hrs should do it backlight_xchg(); + REG_tampered = true; SystemParametersInfo(SPI_GETBATTERYIDLETIMEOUT, 0, (void *) &bat_timeout, 0); SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, 60 * 60 * 2, NULL, SPIF_SENDCHANGE); } @@ -106,8 +108,8 @@ void CEDevice::init() { void CEDevice::end() { if (_ReleasePowerRequirement && _hPowerManagement) _ReleasePowerRequirement(_hPowerManagement); - - backlight_xchg(); + if (REG_tampered) + backlight_xchg(); SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, bat_timeout, NULL, SPIF_SENDCHANGE); } |