Skip to content

Commit

Permalink
don't use DisableProcessWindowsGhosting, it got too bad side-effects
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Jan 16, 2025
1 parent 8841285 commit ab2d86f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion inc/dllmain.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ typedef BOOL(__stdcall* SETPROCESSDPIAWARENESSCONTEXTPROC)(DPI_AWARENESS_CONTEXT

#if (_WIN32_WINNT < _WIN32_WINNT_WINXP)
#define SetThreadExecutionState(a)
#define DisableProcessWindowsGhosting()
#endif

#endif
5 changes: 0 additions & 5 deletions src/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
g_dbg_exception_handle = add_handler(1, (PVECTORED_EXCEPTION_HANDLER)dbg_vectored_exception_handler);
}

if (g_config.darkcolony_hack)
{
DisableProcessWindowsGhosting();
}

char buf[1024];

if (GetEnvironmentVariable("__COMPAT_LAYER", buf, sizeof(buf)))
Expand Down
8 changes: 8 additions & 0 deletions src/winapi_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,14 @@ BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wM

BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
{
if (g_config.darkcolony_hack && !hWnd)
{
hWnd = g_ddraw.hwnd;

MSG msg;
real_PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE);
}

if (g_config.limiter_type == LIMIT_PEEKMESSAGE &&
g_ddraw.ticks_limiter.tick_length > 0 &&
InterlockedExchange(&g_ddraw.render.screen_updated, FALSE))
Expand Down

0 comments on commit ab2d86f

Please sign in to comment.