Skip to content

Commit ab2d86f

Browse files
committed
don't use DisableProcessWindowsGhosting, it got too bad side-effects
1 parent 8841285 commit ab2d86f

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

inc/dllmain.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ typedef BOOL(__stdcall* SETPROCESSDPIAWARENESSCONTEXTPROC)(DPI_AWARENESS_CONTEXT
3131

3232
#if (_WIN32_WINNT < _WIN32_WINNT_WINXP)
3333
#define SetThreadExecutionState(a)
34-
#define DisableProcessWindowsGhosting()
3534
#endif
3635

3736
#endif

src/dllmain.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
5757
g_dbg_exception_handle = add_handler(1, (PVECTORED_EXCEPTION_HANDLER)dbg_vectored_exception_handler);
5858
}
5959

60-
if (g_config.darkcolony_hack)
61-
{
62-
DisableProcessWindowsGhosting();
63-
}
64-
6560
char buf[1024];
6661

6762
if (GetEnvironmentVariable("__COMPAT_LAYER", buf, sizeof(buf)))

src/winapi_hooks.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,14 @@ BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wM
780780

781781
BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
782782
{
783+
if (g_config.darkcolony_hack && !hWnd)
784+
{
785+
hWnd = g_ddraw.hwnd;
786+
787+
MSG msg;
788+
real_PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE);
789+
}
790+
783791
if (g_config.limiter_type == LIMIT_PEEKMESSAGE &&
784792
g_ddraw.ticks_limiter.tick_length > 0 &&
785793
InterlockedExchange(&g_ddraw.render.screen_updated, FALSE))

0 commit comments

Comments
 (0)