mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 07:57:22 +00:00
win32u: Pack input param for CB_GETCOMBOBOXINFO message.
Based on patch by Tim Clem.
This commit is contained in:
parent
59865c9e51
commit
f1749b0808
|
@ -1843,8 +1843,14 @@ void pack_user_message( void *buffer, size_t size, UINT message,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case CB_GETCOMBOBOXINFO:
|
case CB_GETCOMBOBOXINFO:
|
||||||
memset( buffer, 0, size );
|
if (sizeof(void *) == 4)
|
||||||
return;
|
{
|
||||||
|
COMBOBOXINFO *cbi = buffer;
|
||||||
|
memcpy( cbi, lparam_ptr, sizeof(*cbi) );
|
||||||
|
cbi->cbSize = sizeof(*cbi);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size) memcpy( buffer, lparam_ptr, size );
|
if (size) memcpy( buffer, lparam_ptr, size );
|
||||||
|
|
|
@ -1362,7 +1362,7 @@ struct lparam_hook_test
|
||||||
const void *lparam;
|
const void *lparam;
|
||||||
const void *change_lparam;
|
const void *change_lparam;
|
||||||
const void *check_lparam;
|
const void *check_lparam;
|
||||||
const void *default_lparam;
|
const void *in_lparam;
|
||||||
size_t lparam_size;
|
size_t lparam_size;
|
||||||
size_t lparam_init_size;
|
size_t lparam_init_size;
|
||||||
size_t check_size;
|
size_t check_size;
|
||||||
|
@ -1425,10 +1425,12 @@ static void check_params( const struct lparam_hook_test *test, UINT message,
|
||||||
default:
|
default:
|
||||||
if (test->check_size) {
|
if (test->check_size) {
|
||||||
const void *expected;
|
const void *expected;
|
||||||
if (is_ret && test->change_lparam)
|
if (is_ret && test->check_lparam)
|
||||||
|
expected = test->check_lparam;
|
||||||
|
else if (is_ret && test->change_lparam)
|
||||||
expected = test->change_lparam;
|
expected = test->change_lparam;
|
||||||
else if (test->default_lparam)
|
else if (test->in_lparam)
|
||||||
expected = test->default_lparam;
|
expected = test->in_lparam;
|
||||||
else
|
else
|
||||||
expected = test->lparam;
|
expected = test->lparam;
|
||||||
ok( !memcmp( (const void *)lparam, expected, test->check_size ), "unexpected lparam content\n" );
|
ok( !memcmp( (const void *)lparam, expected, test->check_size ), "unexpected lparam content\n" );
|
||||||
|
@ -1686,7 +1688,9 @@ static void test_wndproc_hook(void)
|
||||||
static const MDINEXTMENU nm_in = { .hmenuIn = (HMENU)0xdeadbeef };
|
static const MDINEXTMENU nm_in = { .hmenuIn = (HMENU)0xdeadbeef };
|
||||||
static const MDINEXTMENU nm_out = { .hmenuIn = (HMENU)1 };
|
static const MDINEXTMENU nm_out = { .hmenuIn = (HMENU)1 };
|
||||||
static const MDICREATESTRUCTW mcs_in = { .x = 1, .y = 2 };
|
static const MDICREATESTRUCTW mcs_in = { .x = 1, .y = 2 };
|
||||||
static const COMBOBOXINFO cbi_in = {};
|
static const COMBOBOXINFO cbi_in = { .cbSize = 1, .hwndList = HWND_MESSAGE };
|
||||||
|
static const COMBOBOXINFO cbi_check =
|
||||||
|
{ .cbSize = sizeof(void *) == 4 ? sizeof(cbi_in) : 1, .hwndList = HWND_MESSAGE };
|
||||||
static const COMBOBOXINFO cbi_out = { .hwndList = (HWND)2 };
|
static const COMBOBOXINFO cbi_out = { .hwndList = (HWND)2 };
|
||||||
static const COMBOBOXINFO cbi_ret = { .hwndList = (HWND)2,
|
static const COMBOBOXINFO cbi_ret = { .hwndList = (HWND)2,
|
||||||
.cbSize = sizeof(void *) == 4 ? sizeof(cbi_in) : 0 };
|
.cbSize = sizeof(void *) == 4 ? sizeof(cbi_in) : 0 };
|
||||||
|
@ -1920,8 +1924,8 @@ static void test_wndproc_hook(void)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"CB_GETCOMBOBOXINFO", CB_GETCOMBOBOXINFO,
|
"CB_GETCOMBOBOXINFO", CB_GETCOMBOBOXINFO,
|
||||||
.lparam_size = sizeof(cbi_in), .change_lparam = &cbi_out, .default_lparam = &cbi_in,
|
.lparam_size = sizeof(cbi_in), .change_lparam = &cbi_out, .lparam = &cbi_in,
|
||||||
.check_lparam = &cbi_ret,
|
.check_lparam = &cbi_ret, .check_size = sizeof(cbi_in), .in_lparam = &cbi_check,
|
||||||
},
|
},
|
||||||
/* messages that don't change lparam */
|
/* messages that don't change lparam */
|
||||||
{ "WM_USER", WM_USER },
|
{ "WM_USER", WM_USER },
|
||||||
|
|
|
@ -802,6 +802,22 @@ static size_t packed_message_64to32( UINT message, WPARAM wparam,
|
||||||
memcpy( params32, &mcs32, sizeof(mcs32) );
|
memcpy( params32, &mcs32, sizeof(mcs32) );
|
||||||
return sizeof(mcs32) + size;
|
return sizeof(mcs32) + size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case CB_GETCOMBOBOXINFO:
|
||||||
|
{
|
||||||
|
COMBOBOXINFO32 ci32;
|
||||||
|
const COMBOBOXINFO *ci64 = params64;
|
||||||
|
|
||||||
|
ci32.cbSize = sizeof(ci32);
|
||||||
|
ci32.rcItem = ci64->rcItem;
|
||||||
|
ci32.rcButton = ci64->rcButton;
|
||||||
|
ci32.stateButton = ci64->stateButton;
|
||||||
|
ci32.hwndCombo = HandleToLong( ci64->hwndCombo );
|
||||||
|
ci32.hwndItem = HandleToLong( ci64->hwndItem );
|
||||||
|
ci32.hwndList = HandleToLong( ci64->hwndList );
|
||||||
|
memcpy( params32, &ci32, sizeof(ci32) );
|
||||||
|
return sizeof(ci32);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memmove( params32, params64, size );
|
memmove( params32, params64, size );
|
||||||
|
|
Loading…
Reference in a new issue