From 691b5196d564ec007d9a08495e446883ca5420ab Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Tue, 10 Sep 2024 15:40:05 +0200 Subject: [PATCH] Revert "return WM_NULL if there are no filters" This reverts commit e4eafef6526426f99c185b0d138fc8f031a8426c. --- src/winapi_hooks.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/winapi_hooks.c b/src/winapi_hooks.c index 7bb85c0..45076a3 100644 --- a/src/winapi_hooks.c +++ b/src/winapi_hooks.c @@ -598,7 +598,7 @@ HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, D return result; } -void HandleMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) +void HandleMessage(LPMSG lpMsg, HWND hWnd) { if (lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width) { @@ -638,13 +638,7 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMa mouse_lock(); - if (!wMsgFilterMin && - !wMsgFilterMax && - !(wRemoveMsg & (PM_QS_INPUT | PM_QS_PAINT | PM_QS_POSTMESSAGE | PM_QS_SENDMESSAGE))) - { - lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message)); - } - + //lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message)); break; } @@ -667,13 +661,7 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMa if (!g_config.devmode && !g_mouse_locked) { // Does not work with 'New Robinson' - if (!wMsgFilterMin && - !wMsgFilterMax && - !(wRemoveMsg & (PM_QS_INPUT | PM_QS_PAINT | PM_QS_POSTMESSAGE | PM_QS_SENDMESSAGE))) - { - lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message)); - } - + //lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message)); break; } @@ -693,7 +681,7 @@ BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wM BOOL result = real_GetMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax); if (result) { - HandleMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, 0); + HandleMessage(lpMsg, hWnd); } return result; @@ -707,7 +695,7 @@ BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT w BOOL result = real_PeekMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); if (result) { - HandleMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); + HandleMessage(lpMsg, hWnd); } return result;