Module: wine Branch: master Commit: 844177d5170563d1ff3af29d7fd6038bf6d5a5ac URL: https://gitlab.winehq.org/wine/wine/-/commit/844177d5170563d1ff3af29d7fd6038...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Jul 18 20:23:34 2023 +0200
win32u: Use user message packing for EM_SETTABSTOPS and LB_SETTABSTOPS.
---
dlls/user32/winproc.c | 5 ++--- dlls/win32u/message.c | 9 +++++++++ dlls/win32u/tests/win32u.c | 16 ++++++++++++++-- 3 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index 202c955e152..92392622fc8 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -875,11 +875,8 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam, case EM_SETRECT: case EM_SETRECTNP: case EM_GETLINE: - break; case EM_SETTABSTOPS: case LB_SETTABSTOPS: - if (!*wparam) return TRUE; - minsize = *wparam * sizeof(UINT); break; case CB_ADDSTRING: case CB_INSERTSTRING: @@ -1083,6 +1080,8 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size ) case EM_SETRECT: case EM_SETRECTNP: case EM_GETLINE: + case EM_SETTABSTOPS: + case LB_SETTABSTOPS: { LRESULT *result_ptr = (LRESULT *)buffer - 1; *result_ptr = result; diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index d37b05ca1eb..eb093fc2981 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -594,6 +594,11 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa *lparam = (LPARAM)(len_ptr + 1); return TRUE; } + case EM_SETTABSTOPS: + case LB_SETTABSTOPS: + if (!*wparam) return TRUE; + minsize = *wparam * sizeof(UINT); + break; case WM_WINE_SETWINDOWPOS: { WINDOWPOS wp; @@ -1410,6 +1415,10 @@ size_t user_message_size( UINT message, WPARAM wparam, LPARAM lparam, BOOL other case EM_GETLINE: size = max( *(WORD *)lparam * char_size( ansi ), sizeof(WORD) ); break; + case EM_SETTABSTOPS: + case LB_SETTABSTOPS: + size = wparam * sizeof(UINT); + break; }
return size; diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c index 4d88eeaee8b..baa419bba4f 100644 --- a/dlls/win32u/tests/win32u.c +++ b/dlls/win32u/tests/win32u.c @@ -1384,8 +1384,9 @@ static void check_params( const struct lparam_hook_test *test, UINT message, if (lparam == (LPARAM)lparam_buffer) return;
- ok ((LPARAM)&message < lparam && lparam < (LPARAM)NtCurrentTeb()->Tib.StackBase, - "lparam is not on the stack\n"); + if (sizeof(void *) != 4 || (test->message != EM_SETTABSTOPS && test->message != LB_SETTABSTOPS)) + ok( (LPARAM)&message < lparam && lparam < (LPARAM)NtCurrentTeb()->Tib.StackBase, + "lparam is not on the stack\n");
switch (test->message) { @@ -1679,6 +1680,7 @@ static void test_wndproc_hook(void) static const SCROLLBARINFO sbi_in = { .xyThumbTop = 6 }; static const SCROLLBARINFO sbi_out = { .xyThumbTop = 60 }; static const DWORD dw_in = 1, dw_out = 2; + static const UINT32 tabstops_in[2] = { 3, 4 };
static const struct lparam_hook_test lparam_hook_tests[] = { @@ -1885,6 +1887,16 @@ static void test_wndproc_hook(void) .lparam = L"\x8""2345678", .lparam_size = sizeof(strbufW), .change_lparam = L"abc\0defg", .check_size = sizeof(WCHAR), .check_lparam = L"abc\0""5678", }, + { + "EM_SETTABSTOPS", EM_SETTABSTOPS, .wparam = ARRAYSIZE(tabstops_in), + .lparam_size = sizeof(tabstops_in), .lparam = &tabstops_in, .poison_lparam = TRUE, + .check_size = sizeof(tabstops_in), + }, + { + "LB_SETTABSTOPS", LB_SETTABSTOPS, .wparam = ARRAYSIZE(tabstops_in), + .lparam_size = sizeof(tabstops_in), .lparam = &tabstops_in, .poison_lparam = TRUE, + .check_size = sizeof(tabstops_in), + }, /* messages that don't change lparam */ { "WM_USER", WM_USER }, { "WM_NOTIFY", WM_NOTIFY },