win32u: Use user message packing for EM_SETTABSTOPS and LB_SETTABSTOPS.

This commit is contained in:
Jacek Caban 2023-07-18 20:23:34 +02:00 committed by Alexandre Julliard
parent 314c94e100
commit 844177d517
3 changed files with 25 additions and 5 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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 },