Commit f231c7be authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use user message packing for WM_COMPAREITEM.

parent 7f4ffc7c
......@@ -844,22 +844,8 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
case WM_DRAWITEM:
case WM_MEASUREITEM:
case WM_DELETEITEM:
break;
case WM_COMPAREITEM:
{
COMPAREITEMSTRUCT cis;
if (size < sizeof(ps->cis)) return FALSE;
cis.CtlType = ps->cis.CtlType;
cis.CtlID = ps->cis.CtlID;
cis.hwndItem = unpack_handle( ps->cis.hwndItem );
cis.itemID1 = ps->cis.itemID1;
cis.itemData1 = (ULONG_PTR)unpack_ptr( ps->cis.itemData1 );
cis.itemID2 = ps->cis.itemID2;
cis.itemData2 = (ULONG_PTR)unpack_ptr( ps->cis.itemData2 );
cis.dwLocaleId = ps->cis.dwLocaleId;
memcpy( *buffer, &cis, sizeof(cis) );
break;
}
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
{
......@@ -1150,6 +1136,7 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
case WM_GETMINMAXINFO:
case WM_MEASUREITEM:
case WM_DELETEITEM:
case WM_COMPAREITEM:
{
LRESULT *result_ptr = (LRESULT *)buffer - 1;
*result_ptr = result;
......
......@@ -474,6 +474,21 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
memcpy( *buffer, &dls, sizeof(dls) );
break;
}
case WM_COMPAREITEM:
{
COMPAREITEMSTRUCT cis;
if (size < sizeof(ps->cis)) return FALSE;
cis.CtlType = ps->cis.CtlType;
cis.CtlID = ps->cis.CtlID;
cis.hwndItem = wine_server_ptr_handle( ps->cis.hwndItem );
cis.itemID1 = ps->cis.itemID1;
cis.itemData1 = (ULONG_PTR)unpack_ptr( ps->cis.itemData1 );
cis.itemID2 = ps->cis.itemID2;
cis.itemData2 = (ULONG_PTR)unpack_ptr( ps->cis.itemData2 );
cis.dwLocaleId = ps->cis.dwLocaleId;
memcpy( *buffer, &cis, sizeof(cis) );
break;
}
case WM_WINE_SETWINDOWPOS:
{
WINDOWPOS wp;
......@@ -1270,6 +1285,9 @@ size_t user_message_size( UINT message, WPARAM wparam, LPARAM lparam, BOOL other
case WM_DELETEITEM:
size = sizeof(DELETEITEMSTRUCT);
break;
case WM_COMPAREITEM:
size = sizeof(COMPAREITEMSTRUCT);
break;
}
return size;
......
......@@ -1625,6 +1625,7 @@ static void test_wndproc_hook(void)
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 COMPAREITEMSTRUCT cis_in = { .itemID1 = 1 };
static const struct lparam_hook_test lparam_hook_tests[] =
{
......@@ -1724,6 +1725,11 @@ static void test_wndproc_hook(void)
.lparam_size = sizeof(dis_in), .lparam = &dis_in, .poison_lparam = TRUE,
.check_size = sizeof(dis_in),
},
{
"WM_COMPAREITEM", WM_COMPAREITEM, .wparam = 10,
.lparam_size = sizeof(cis_in), .lparam = &cis_in, .poison_lparam = TRUE,
.check_size = sizeof(cis_in),
},
/* messages that don't change lparam */
{ "WM_USER", WM_USER },
{ "WM_NOTIFY", WM_NOTIFY },
......
......@@ -698,6 +698,23 @@ static size_t packed_message_64to32( UINT message, WPARAM wparam,
memcpy( params32, &dis32, sizeof(dis32) );
return sizeof(dis32);
}
case WM_COMPAREITEM:
{
COMPAREITEMSTRUCT32 cis32;
const COMPAREITEMSTRUCT *cis64 = params64;
cis32.CtlType = cis64->CtlType;
cis32.CtlID = cis64->CtlID;
cis32.hwndItem = HandleToLong( cis64->hwndItem );
cis32.itemID1 = cis64->itemID1;
cis32.itemData1 = cis64->itemData1;
cis32.itemID2 = cis64->itemID2;
cis32.itemData2 = cis64->itemData2;
cis32.dwLocaleId = cis64->dwLocaleId;
memcpy( params32, &cis32, sizeof(cis32) );
return sizeof(cis32);
}
}
memmove( params32, params64, size );
......
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