From: Jinoh Kang jinoh.kang.kr@gmail.com
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- dlls/user32/message.c | 11 ++++++++++- dlls/user32/tests/msg.c | 6 ------ dlls/user32/user32.spec | 2 +- dlls/user32/user_main.c | 1 + dlls/user32/user_private.h | 1 + dlls/user32/winstation.c | 23 ++++++++++++++++++++++- 6 files changed, 35 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index acab4117cf2..c3b90eeaf70 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -857,6 +857,15 @@ static LRESULT dispatch_message( const MSG *msg, BOOL ansi ) }
+static LONG WINAPI timerproc_exception_filter(EXCEPTION_POINTERS *eptr) +{ + if (suppress_timerproc_exception) + return EXCEPTION_EXECUTE_HANDLER; + + return EXCEPTION_CONTINUE_SEARCH; +} + + /*********************************************************************** * DispatchMessageA (USER32.@) * @@ -874,7 +883,7 @@ LRESULT WINAPI DECLSPEC_HOTPATCH DispatchMessageA( const MSG* msg ) retval = CallWindowProcA( (WNDPROC)msg->lParam, msg->hwnd, msg->message, msg->wParam, GetTickCount() ); } - __EXCEPT_ALL + __EXCEPT(timerproc_exception_filter) { retval = 0; } diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 9ff92ce2997..9cc550a844b 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -11424,7 +11424,6 @@ static void CALLBACK callback_exception(HWND hwnd, UINT uMsg, UINT_PTR idEvent, value = FALSE; ret = SetUserObjectInformationW(GetCurrentProcess(), UOI_TIMERPROC_EXCEPTION_SUPPRESSION, &value, sizeof(value)); - todo_wine ok(ret, "SetUserObjectInformationW error %lu\n", GetLastError()); tproc_exc_no_suppress = FALSE; } @@ -11656,14 +11655,12 @@ static void test_timers_exception(DWORD code) } else { - todo_wine ok(ret, "SetUserObjectInformationW error %lu\n", GetLastError());
count = 0; timer_exc_phase = TIMER_EXCEPTION_INITIAL; dispatch_message_ansi_handle_exception(&msg, timer_exception_handler); ok(count == 1, "expected count to be 1, got %d\n", count); - todo_wine ok(timer_exc_phase == TIMER_EXCEPTION_CONTINUE_OK || broken(timer_exc_phase == TIMER_EXCEPTION_RAISED) /* < win10 1507 */, "expected phase %d, got %d\n", TIMER_EXCEPTION_CONTINUE_OK, timer_exc_phase); @@ -11671,7 +11668,6 @@ static void test_timers_exception(DWORD code) value = TRUE; ret = SetUserObjectInformationW(GetCurrentProcess(), UOI_TIMERPROC_EXCEPTION_SUPPRESSION, &value, sizeof(value)); - todo_wine ok(ret, "SetUserObjectInformationW error %lu\n", GetLastError());
tproc_exc_no_suppress = TRUE; @@ -11679,7 +11675,6 @@ static void test_timers_exception(DWORD code) timer_exc_phase = TIMER_EXCEPTION_INITIAL; dispatch_message_ansi_handle_exception(&msg, timer_exception_handler); ok(count == 1, "expected count to be 1, got %d\n", count); - todo_wine ok(timer_exc_phase == TIMER_EXCEPTION_CONTINUE_OK || broken(timer_exc_phase == TIMER_EXCEPTION_RAISED) /* < win10 1507 */, "expected phase %d, got %d\n", TIMER_EXCEPTION_CONTINUE_OK, timer_exc_phase); @@ -11687,7 +11682,6 @@ static void test_timers_exception(DWORD code) value = TRUE; ret = SetUserObjectInformationW(GetCurrentProcess(), UOI_TIMERPROC_EXCEPTION_SUPPRESSION, &value, sizeof(value)); - todo_wine ok(ret, "SetUserObjectInformationW error %lu\n", GetLastError()); }
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 96e6e1a7d6b..6a605ae4216 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -721,7 +721,7 @@ @ stdcall SetThreadDpiAwarenessContext(ptr) @ stdcall SetTimer(long long long ptr) @ stdcall SetUserObjectInformationA(long long ptr long) -@ stdcall SetUserObjectInformationW(long long ptr long) NtUserSetObjectInformation +@ stdcall SetUserObjectInformationW(long long ptr long) @ stdcall SetUserObjectSecurity(long ptr ptr) @ stdcall SetWinEventHook(long long long ptr long long long) @ stdcall SetWindowCompositionAttribute(ptr ptr) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index ef2b94ba698..f375462487b 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -29,6 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(graphics); WINE_DECLARE_DEBUG_CHANNEL(message);
HMODULE user32_module = 0; +BOOL suppress_timerproc_exception = TRUE;
extern void WDML_NotifyThreadDetach(void);
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 9330174a778..06d09e67381 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -44,6 +44,7 @@ struct wm_char_mapping_data };
extern HMODULE user32_module DECLSPEC_HIDDEN; +extern BOOL suppress_timerproc_exception;
extern BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid, DWORD type ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c index 62593ca046f..789e45f8928 100644 --- a/dlls/user32/winstation.c +++ b/dlls/user32/winstation.c @@ -389,12 +389,33 @@ BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DW }
+/****************************************************************************** + * SetUserObjectInformationW (USER32.@) + */ +BOOL WINAPI SetUserObjectInformationW( HANDLE handle, INT index, LPVOID info, DWORD len ) +{ + if (index == UOI_TIMERPROC_EXCEPTION_SUPPRESSION) + { + if (handle != GetCurrentProcess() || len != sizeof(BOOL)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + suppress_timerproc_exception = *(const BOOL *)info; + return TRUE; + } + + return NtUserSetObjectInformation( handle, index, info, len ); +} + + /****************************************************************************** * SetUserObjectInformationA (USER32.@) */ BOOL WINAPI SetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DWORD len ) { - return NtUserSetObjectInformation( handle, index, info, len ); + return SetUserObjectInformationW( handle, index, info, len ); }