[PATCH v2 0/2] MR10313: user32: Add DelegateInput() stub.
For React Native. -- v2: user32: Add UndelegateInput() stub. user32: Add DelegateInput() stub. https://gitlab.winehq.org/wine/wine/-/merge_requests/10313
From: Zhiyi Zhang <zzhang@codeweavers.com> React Native expects the return value to be non-zero. --- dlls/user32/input.c | 11 +++++++++++ dlls/user32/tests/input.c | 18 ++++++++++++++++++ dlls/user32/user32.spec | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 6d26e4feb3b..dc2bb65b29a 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -848,3 +848,14 @@ HSYNTHETICPOINTERDEVICE WINAPI CreateSyntheticPointerDevice(POINTER_INPUT_TYPE t SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return NULL; } + +/*********************************************************************** + * DelegateInput (USER32.@) + * + * Undocumented. Function prototype might be wrong. + */ +UINT_PTR WINAPI DelegateInput(void *p1, void *p2, void *p3, void *p4, void *p5, void *p6) +{ + FIXME( "p1 %p p2 %p p3 %p p4 %p p5 %p p6 %p stub!\n", p1, p2, p3, p4, p5, p6 ); + return 1; +} diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index a81ea1d9ab5..bca1d8d1151 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -431,6 +431,7 @@ 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); +static UINT_PTR (WINAPI *pDelegateInput)(void *, void *, void *, void *, void *, void *); /**********************adapted from input.c **********************************/ @@ -446,6 +447,7 @@ static void init_function_pointers(void) if (!(p ## func = (void*)GetProcAddress(hdll, #func))) \ trace("GetProcAddress(%s) failed\n", #func) + GET_PROC(DelegateInput); GET_PROC(EnableMouseInPointer); GET_PROC(IsMouseInPointerEnabled); GET_PROC(GetCurrentInputMessageSource); @@ -6472,6 +6474,21 @@ static void test_ScheduleDispatchNotification(void) DestroyWindow(hwnd); } +static void test_DelegateInput(void) +{ + UINT_PTR ret; + + if (!pDelegateInput) + { + win_skip("DelegateInput is unavailable.\n"); + return; + } + + ret = pDelegateInput(0, 0, 0, 0, 0, 0); + todo_wine + ok(ret == 0, "Got unexpected ret %Ix.\n", ret); +} + START_TEST(input) { char **argv; @@ -6517,6 +6534,7 @@ START_TEST(input) test_rawinput(argv[0]); test_DefRawInputProc(); test_ScheduleDispatchNotification(); + test_DelegateInput(); if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx( argv ); diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 0645792a312..5c61bdd6546 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -14,7 +14,7 @@ 2010 stub -noname SlicerControl # NtUserSlicerControl -2503 stub DelegateInput # NtUserDelegateInput +2503 stdcall DelegateInput(ptr ptr ptr ptr ptr ptr) # NtUserDelegateInput 2504 stub UndelegateInput # NtUserUndelegateInput 2505 stub HandleDelegatedInput # NtUserHandleDelegatedInput 2506 stub @ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10313
From: Zhiyi Zhang <zzhang@codeweavers.com> --- dlls/user32/input.c | 10 ++++++++++ dlls/user32/tests/input.c | 8 ++++++-- dlls/user32/user32.spec | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dlls/user32/input.c b/dlls/user32/input.c index dc2bb65b29a..48b38166b75 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -859,3 +859,13 @@ UINT_PTR WINAPI DelegateInput(void *p1, void *p2, void *p3, void *p4, void *p5, FIXME( "p1 %p p2 %p p3 %p p4 %p p5 %p p6 %p stub!\n", p1, p2, p3, p4, p5, p6 ); return 1; } + +/*********************************************************************** + * UndelegateInput (USER32.@) + * + * Undocumented. Function prototype might be wrong. + */ +void WINAPI UndelegateInput(void *p1, void *p2) +{ + FIXME( "p1 %p p2 %p stub!\n", p1, p2 ); +} diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index bca1d8d1151..905ff0dd922 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -432,6 +432,7 @@ static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); static HKL (WINAPI *pLoadKeyboardLayoutEx)(HKL, const WCHAR *, UINT); static INT (WINAPI *pScheduleDispatchNotification)(HWND); static UINT_PTR (WINAPI *pDelegateInput)(void *, void *, void *, void *, void *, void *); +static void (WINAPI *pUndelegateInput)(void *, void *); /**********************adapted from input.c **********************************/ @@ -461,6 +462,7 @@ static void init_function_pointers(void) GET_PROC(GetRawInputDeviceInfoW); GET_PROC(GetRawInputDeviceInfoA); GET_PROC(LoadKeyboardLayoutEx); + GET_PROC(UndelegateInput); hdll = GetModuleHandleA("kernel32"); GET_PROC(IsWow64Process); @@ -6478,15 +6480,17 @@ static void test_DelegateInput(void) { UINT_PTR ret; - if (!pDelegateInput) + if (!pDelegateInput || !pUndelegateInput) { - win_skip("DelegateInput is unavailable.\n"); + win_skip("DelegateInput or UndelegateInput is unavailable.\n"); return; } ret = pDelegateInput(0, 0, 0, 0, 0, 0); todo_wine ok(ret == 0, "Got unexpected ret %Ix.\n", ret); + + pUndelegateInput(0, 0); } START_TEST(input) diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 5c61bdd6546..b8939646668 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -15,7 +15,7 @@ 2010 stub -noname SlicerControl # NtUserSlicerControl 2503 stdcall DelegateInput(ptr ptr ptr ptr ptr ptr) # NtUserDelegateInput -2504 stub UndelegateInput # NtUserUndelegateInput +2504 stdcall UndelegateInput(ptr ptr) # NtUserUndelegateInput 2505 stub HandleDelegatedInput # NtUserHandleDelegatedInput 2506 stub @ 2507 stub -noname SetAutoRotation # NtUserSetAutoRotation -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10313
This merge request was approved by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10313
participants (3)
-
Rémi Bernon -
Zhiyi Zhang -
Zhiyi Zhang (@zhiyi)