React Native apps use user32.2582 and expect the return value to be non-zero.
-- v2: user32: Add ScheduleDispatchNotification() stub.
From: Zhiyi Zhang zzhang@codeweavers.com
React Native apps use user32.2582 and expect the return value to be non-zero. --- dlls/user32/tests/input.c | 27 +++++++++++++++++++++++++++ dlls/user32/user32.spec | 2 +- dlls/win32u/input.c | 13 +++++++++++++ dlls/win32u/main.c | 5 +++++ dlls/win32u/win32u.spec | 2 +- dlls/wow64win/user.c | 7 +++++++ include/ntuser.h | 1 + 7 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 4d4c3c81000..a82ca5941a2 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -430,6 +430,7 @@ static UINT (WINAPI *pGetRawInputDeviceInfoW) (HANDLE, UINT, void *, UINT *); static UINT (WINAPI *pGetRawInputDeviceInfoA) (HANDLE, UINT, void *, UINT *); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); static HKL (WINAPI *pLoadKeyboardLayoutEx)(HKL, const WCHAR *, UINT); +static INT (WINAPI *pScheduleDispatchNotification)(HWND);
/**********************adapted from input.c **********************************/
@@ -439,6 +440,8 @@ static void init_function_pointers(void) { HMODULE hdll = GetModuleHandleA("user32");
+ pScheduleDispatchNotification = (void *)GetProcAddress(hdll, (LPCSTR)2582); + #define GET_PROC(func) \ if (!(p ## func = (void*)GetProcAddress(hdll, #func))) \ trace("GetProcAddress(%s) failed\n", #func) @@ -6308,6 +6311,29 @@ static void test_SetFocus_process(void) DestroyWindow( hwnd ); }
+static void test_ScheduleDispatchNotification(void) +{ + HWND hwnd; + INT ret; + + if (!pScheduleDispatchNotification) + { + win_skip("ScheduleDispatchNotification is unavailable.\n"); + return; + } + + hwnd = CreateWindowW(L"static", NULL, WS_POPUP | WS_VISIBLE, 100, 100, 200, 200, NULL, NULL, + NULL, NULL); + + ret = pScheduleDispatchNotification(NULL); + ok(!ret, "Got unexpected %d.\n", ret); + + ret = pScheduleDispatchNotification(hwnd); + ok(ret == 2, "Got unexpected %d.\n", ret); + + DestroyWindow(hwnd); +} + START_TEST(input) { char **argv; @@ -6352,6 +6378,7 @@ START_TEST(input) test_OemKeyScan(); test_rawinput(argv[0]); test_DefRawInputProc(); + test_ScheduleDispatchNotification();
if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx( argv ); diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 494c8b7a983..17c19cc2a96 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -93,7 +93,7 @@ 2579 stub -noname SetWindowShowState # NtUserSetWindowShowState
2581 stub -noname GetWindowTrackInfoAsync # NtUserGetWindowTrackInfoAsync -2582 stub -noname ScheduleDispatchNotification # NtUserScheduleDispatchNotification +2582 stdcall -noname ScheduleDispatchNotification(ptr) NtUserScheduleDispatchNotification
2584 stub -noname EnableModernAppWindowKeyboardIntercept # NtUserEnableModernAppWindowKeyboardIntercept 2585 stub -noname UpdateWindowTrackingInfo # NtUserUpdateWindowTrackingInfo diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 1fbf8c4a041..1f824f85c50 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2782,3 +2782,16 @@ BOOL WINAPI NtUserRegisterTouchPadCapable( BOOL capable ) RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE; } + +/********************************************************************** + * NtUserScheduleDispatchNotification (win32u.@) + */ +INT WINAPI NtUserScheduleDispatchNotification( HWND hwnd ) +{ + FIXME("hwnd %p stub!\n", hwnd); + + if (is_window(hwnd)) + return 2; + + return 0; +} diff --git a/dlls/win32u/main.c b/dlls/win32u/main.c index 3f757e9af21..2fca9c0aa20 100644 --- a/dlls/win32u/main.c +++ b/dlls/win32u/main.c @@ -2057,6 +2057,11 @@ BOOL SYSCALL_API NtUserReplyMessage( LRESULT result ) SYSCALL_FUNC( NtUserReplyMessage ); }
+INT SYSCALL_API NtUserScheduleDispatchNotification( HWND hwnd ) +{ + SYSCALL_FUNC( NtUserScheduleDispatchNotification ); +} + BOOL SYSCALL_API NtUserScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip, HRGN ret_update_rgn, RECT *update_rect ) { diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 9e25f3d8bba..09101ffd779 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1320,7 +1320,7 @@ @ stub NtUserRestoreWindowDpiChanges @ stub NtUserSBGetParms @ stub NtUserScaleSystemMetricForDPIWithoutCache -@ stub NtUserScheduleDispatchNotification +@ stdcall -syscall NtUserScheduleDispatchNotification(ptr) @ stdcall -syscall NtUserScrollDC(long long long ptr ptr long ptr) @ stdcall -syscall NtUserScrollWindowEx(long long long ptr ptr long ptr long) @ stdcall -syscall NtUserSelectPalette(long long long) diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index febd9e8d038..9c839f221a9 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -4111,6 +4111,13 @@ NTSTATUS WINAPI wow64_NtUserReplyMessage( UINT *args ) return NtUserReplyMessage( result ); }
+NTSTATUS WINAPI wow64_NtUserScheduleDispatchNotification( UINT *args ) +{ + HWND hwnd = get_handle( &args ); + + return NtUserScheduleDispatchNotification( hwnd ); +} + NTSTATUS WINAPI wow64_NtUserScrollDC( UINT *args ) { HDC hdc = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 6eba130a9a5..e53dbe2bb58 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -951,6 +951,7 @@ W32KAPI BOOL WINAPI NtUserRemoveClipboardFormatListener( HWND hwnd ); W32KAPI BOOL WINAPI NtUserRemoveMenu( HMENU menu, UINT id, UINT flags ); W32KAPI HANDLE WINAPI NtUserRemoveProp( HWND hwnd, const WCHAR *str ); W32KAPI BOOL WINAPI NtUserReplyMessage( LRESULT result ); +W32KAPI INT WINAPI NtUserScheduleDispatchNotification( HWND hwnd ); W32KAPI BOOL WINAPI NtUserScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip, HRGN ret_update_rgn, RECT *update_rect ); W32KAPI INT WINAPI NtUserScrollWindowEx( HWND hwnd, INT dx, INT dy, const RECT *rect,