Commit 7f4ffc7c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use user message packing for WM_DELETEITEM.

parent 58dece67
......@@ -843,19 +843,8 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
case WM_GETMINMAXINFO:
case WM_DRAWITEM:
case WM_MEASUREITEM:
break;
case WM_DELETEITEM:
{
DELETEITEMSTRUCT dls;
if (size < sizeof(ps->dls)) return FALSE;
dls.CtlType = ps->dls.CtlType;
dls.CtlID = ps->dls.CtlID;
dls.itemID = ps->dls.itemID;
dls.hwndItem = unpack_handle( ps->dls.hwndItem );
dls.itemData = (ULONG_PTR)unpack_ptr( ps->dls.itemData );
memcpy( *buffer, &dls, sizeof(dls) );
break;
}
case WM_COMPAREITEM:
{
COMPAREITEMSTRUCT cis;
......@@ -1160,6 +1149,7 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
case EM_REPLACESEL:
case WM_GETMINMAXINFO:
case WM_MEASUREITEM:
case WM_DELETEITEM:
{
LRESULT *result_ptr = (LRESULT *)buffer - 1;
*result_ptr = result;
......
......@@ -462,6 +462,18 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
memcpy( *buffer, &mis, sizeof(mis) );
break;
}
case WM_DELETEITEM:
{
DELETEITEMSTRUCT dls;
if (size < sizeof(ps->dls)) return FALSE;
dls.CtlType = ps->dls.CtlType;
dls.CtlID = ps->dls.CtlID;
dls.itemID = ps->dls.itemID;
dls.hwndItem = wine_server_ptr_handle( ps->dls.hwndItem );
dls.itemData = (ULONG_PTR)unpack_ptr( ps->dls.itemData );
memcpy( *buffer, &dls, sizeof(dls) );
break;
}
case WM_WINE_SETWINDOWPOS:
{
WINDOWPOS wp;
......@@ -1255,6 +1267,9 @@ size_t user_message_size( UINT message, WPARAM wparam, LPARAM lparam, BOOL other
case WM_MEASUREITEM:
size = sizeof(MEASUREITEMSTRUCT);
break;
case WM_DELETEITEM:
size = sizeof(DELETEITEMSTRUCT);
break;
}
return size;
......
......@@ -1624,6 +1624,7 @@ static void test_wndproc_hook(void)
static const DRAWITEMSTRUCT drawitem_in = { .itemID = 1 };
static const MEASUREITEMSTRUCT mis_in = { .itemID = 1 };
static const MEASUREITEMSTRUCT mis_out = { .itemID = 2, .CtlType = 3, .CtlID = 4, .itemData = 5 };
static const DELETEITEMSTRUCT dis_in = { .itemID = 1 };
static const struct lparam_hook_test lparam_hook_tests[] =
{
......@@ -1718,6 +1719,11 @@ static void test_wndproc_hook(void)
.lparam_size = sizeof(mis_in), .lparam = &mis_in, .change_lparam = &mis_out,
.check_size = sizeof(mis_in),
},
{
"WM_DELETEITEM", WM_DELETEITEM, .wparam = 10,
.lparam_size = sizeof(dis_in), .lparam = &dis_in, .poison_lparam = TRUE,
.check_size = sizeof(dis_in),
},
/* messages that don't change lparam */
{ "WM_USER", WM_USER },
{ "WM_NOTIFY", WM_NOTIFY },
......
......@@ -684,6 +684,20 @@ static size_t packed_message_64to32( UINT message, WPARAM wparam,
memcpy( params32, &mis32, sizeof(mis32) );
return sizeof(mis32);
}
case WM_DELETEITEM:
{
DELETEITEMSTRUCT32 dis32;
const DELETEITEMSTRUCT *dis64 = params64;
dis32.CtlType = dis64->CtlType;
dis32.CtlID = dis64->CtlID;
dis32.itemID = dis64->itemID;
dis32.hwndItem = HandleToLong( dis64->hwndItem );
dis32.itemData = dis64->itemData;
memcpy( params32, &dis32, sizeof(dis32) );
return sizeof(dis32);
}
}
memmove( params32, params64, size );
......@@ -3167,6 +3181,7 @@ static LRESULT message_call_32to64( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
dis.CtlType = dis32->CtlType;
dis.CtlID = dis32->CtlID;
dis.itemID = dis32->itemID;
dis.hwndItem = LongToHandle( dis32->hwndItem );
dis.itemData = dis32->itemData;
return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&dis, result_info, type, ansi );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment