mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-25 01:57:47 +01:00
Revert "use SetThreadExecutionState with ES_DISPLAY_REQUIRED"
This reverts commit eafcdaf95dddc90febb94ee99fe2ebd0da56f103.
This commit is contained in:
parent
eafcdaf95d
commit
7505295e33
@ -23,6 +23,7 @@ PVOID FakePrimarySurface;
|
|||||||
|
|
||||||
|
|
||||||
HMODULE g_ddraw_module;
|
HMODULE g_ddraw_module;
|
||||||
|
static BOOL g_screensaver_disabled;
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
||||||
{
|
{
|
||||||
@ -131,7 +132,15 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
set_aware();
|
set_aware();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
|
BOOL screensaver_enabled = FALSE;
|
||||||
|
SystemParametersInfoA(SPI_GETSCREENSAVEACTIVE, 0, &screensaver_enabled, 0);
|
||||||
|
|
||||||
|
if (screensaver_enabled)
|
||||||
|
{
|
||||||
|
SystemParametersInfoA(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0);
|
||||||
|
g_screensaver_disabled = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
indeo_enable();
|
indeo_enable();
|
||||||
timeBeginPeriod(1);
|
timeBeginPeriod(1);
|
||||||
hook_init();
|
hook_init();
|
||||||
@ -151,7 +160,11 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||||||
keyboard_hook_exit();
|
keyboard_hook_exit();
|
||||||
dinput_hook_exit();
|
dinput_hook_exit();
|
||||||
hook_exit();
|
hook_exit();
|
||||||
SetThreadExecutionState(ES_CONTINUOUS);
|
|
||||||
|
if (g_screensaver_disabled)
|
||||||
|
{
|
||||||
|
SystemParametersInfoA(SPI_SETSCREENSAVEACTIVE, TRUE, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
ULONG(WINAPI* remove_handler)(PVOID) =
|
ULONG(WINAPI* remove_handler)(PVOID) =
|
||||||
(void*)real_GetProcAddress(GetModuleHandleA("Kernel32.dll"), "RemoveVectoredExceptionHandler");
|
(void*)real_GetProcAddress(GetModuleHandleA("Kernel32.dll"), "RemoveVectoredExceptionHandler");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user