Module: wine Branch: master Commit: 8387d2fefff6886235a0ba46042e96ff2c6e89cc URL: https://gitlab.winehq.org/wine/wine/-/commit/8387d2fefff6886235a0ba46042e96f...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Jan 10 17:39:17 2023 +0100
comctl32: Always use unicode messages for subclass procedures.
Final Fantasy XIV Online depends on this for its text input.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43073
---
dlls/comctl32/commctrl.c | 13 +++---------- dlls/comctl32/tests/subclass.c | 15 +++++++-------- 2 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 37cb66b9bbb..eae64022d65 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -1104,12 +1104,8 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
/* set window procedure to our own and save the current one */ stack->is_unicode = IsWindowUnicode (hWnd); - if (stack->is_unicode) - stack->origproc = (WNDPROC)SetWindowLongPtrW (hWnd, GWLP_WNDPROC, - (DWORD_PTR)COMCTL32_SubclassProc); - else - stack->origproc = (WNDPROC)SetWindowLongPtrA (hWnd, GWLP_WNDPROC, - (DWORD_PTR)COMCTL32_SubclassProc); + stack->origproc = (WNDPROC)SetWindowLongPtrW (hWnd, GWLP_WNDPROC, + (DWORD_PTR)COMCTL32_SubclassProc); } else { /* Check to see if we have called this function with the same uIDSubClass @@ -1332,10 +1328,7 @@ LRESULT WINAPI DefSubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar /* If we are at the end of stack then we have to call the original * window procedure */ if (!stack->stackpos) { - if (stack->is_unicode) - ret = CallWindowProcW (stack->origproc, hWnd, uMsg, wParam, lParam); - else - ret = CallWindowProcA (stack->origproc, hWnd, uMsg, wParam, lParam); + ret = CallWindowProcW (stack->origproc, hWnd, uMsg, wParam, lParam); } else { const SUBCLASSPROCS *proc = stack->stackpos; stack->stackpos = stack->stackpos->next; diff --git a/dlls/comctl32/tests/subclass.c b/dlls/comctl32/tests/subclass.c index 684593e6ed7..3c07a9d221c 100644 --- a/dlls/comctl32/tests/subclass.c +++ b/dlls/comctl32/tests/subclass.c @@ -202,7 +202,7 @@ static LRESULT WINAPI wnd_proc_1(HWND hwnd, UINT message, WPARAM wParam, LPARAM DWORD flags = GetWindowLongA(hwnd, GWLP_USERDATA); struct message msg;
- todo_wine_if(flags & EXPECT_UNICODE) check_unicode(hwnd, flags); + check_unicode(hwnd, flags);
if(message == WM_USER) { msg.wParam = wParam; @@ -234,7 +234,7 @@ static LRESULT WINAPI wnd_proc_sub(HWND hwnd, UINT message, WPARAM wParam, LPARA DWORD flags = GetWindowLongA(hwnd, GWLP_USERDATA); struct message msg;
- todo_wine_if(flags & EXPECT_UNICODE) check_unicode(hwnd, flags); + check_unicode(hwnd, flags);
if(message == WM_USER) { msg.wParam = wParam; @@ -245,22 +245,21 @@ static LRESULT WINAPI wnd_proc_sub(HWND hwnd, UINT message, WPARAM wParam, LPARA if(dwRefData & DELETE_SELF) { pRemoveWindowSubclass(hwnd, wnd_proc_sub, uldSubclass); pRemoveWindowSubclass(hwnd, wnd_proc_sub, uldSubclass); - todo_wine_if(flags & EXPECT_UNICODE) check_unicode(hwnd, flags); + check_unicode(hwnd, flags); } if(dwRefData & DELETE_PREV) { pRemoveWindowSubclass(hwnd, wnd_proc_sub, uldSubclass-1); - todo_wine_if(flags & EXPECT_UNICODE) check_unicode(hwnd, flags); + check_unicode(hwnd, flags); } if(dwRefData & SEND_NEST) { SendMessageA(hwnd, WM_USER, wParam+1, 0); - todo_wine_if(flags & EXPECT_UNICODE) check_unicode(hwnd, flags); + check_unicode(hwnd, flags); } } } if (message == WM_CHAR) { - todo_wine ok(wParam == 0x30c2, "got wParam %#Ix\n", wParam); } return pDefSubclassProc(hwnd, message, wParam, lParam); @@ -277,7 +276,7 @@ static void test_subclass(void)
ret = pSetWindowSubclass(hwnd, wnd_proc_sub, 2, 0); ok(ret == TRUE, "Expected TRUE\n"); - todo_wine check_unicode(hwnd, EXPECT_UNICODE); + check_unicode(hwnd, EXPECT_UNICODE); SetWindowLongA(hwnd, GWLP_USERDATA, EXPECT_UNICODE);
SendMessageA(hwnd, WM_USER, 1, 0); @@ -287,7 +286,7 @@ static void test_subclass(void)
ret = pSetWindowSubclass(hwnd, wnd_proc_sub, 2, DELETE_SELF); ok(ret == TRUE, "Expected TRUE\n"); - todo_wine check_unicode(hwnd, EXPECT_UNICODE); + check_unicode(hwnd, EXPECT_UNICODE);
SendMessageA(hwnd, WM_USER, 1, 1); ok_sequence(Sub_DeletedTest, "Deleted");