mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 18:43:37 +00:00
win32u: Use user message packing for EM_GETSEL.
This commit is contained in:
parent
10254e326f
commit
0dbafa8496
|
@ -837,6 +837,15 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
|
|||
if (cds->lpData) cds->lpData = cds + 1;
|
||||
break;
|
||||
}
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
{
|
||||
DWORD *ptr = *buffer;
|
||||
*wparam = (WPARAM)ptr++;
|
||||
*lparam = (LPARAM)ptr;
|
||||
return TRUE;
|
||||
}
|
||||
case WM_GETTEXT:
|
||||
case WM_ASKCBFORMATNAME:
|
||||
case WM_WININICHANGE:
|
||||
|
@ -864,16 +873,6 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
|
|||
case WM_NOTIFY:
|
||||
/* WM_NOTIFY cannot be sent across processes (MSDN) */
|
||||
return FALSE;
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
if (*wparam || *lparam)
|
||||
{
|
||||
if (!get_buffer_space( buffer, 2*sizeof(DWORD), size )) return FALSE;
|
||||
if (*wparam) *wparam = (WPARAM)*buffer;
|
||||
if (*lparam) *lparam = (LPARAM)((DWORD *)*buffer + 1);
|
||||
}
|
||||
return TRUE;
|
||||
case EM_GETRECT:
|
||||
case LB_GETITEMRECT:
|
||||
case CB_GETDROPPEDCONTROLRECT:
|
||||
|
@ -1087,6 +1086,9 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
|
|||
case SBM_SETSCROLLINFO:
|
||||
case SBM_GETSCROLLINFO:
|
||||
case SBM_GETSCROLLBARINFO:
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
{
|
||||
LRESULT *result_ptr = (LRESULT *)buffer - 1;
|
||||
*result_ptr = result;
|
||||
|
|
|
@ -564,6 +564,16 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
|
|||
case SBM_GETSCROLLBARINFO:
|
||||
if (!get_buffer_space( buffer, sizeof(SCROLLBARINFO), size )) return FALSE;
|
||||
break;
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
if (*wparam || *lparam)
|
||||
{
|
||||
if (!get_buffer_space( buffer, 2 * sizeof(DWORD), size )) return FALSE;
|
||||
if (*wparam) *wparam = (WPARAM)*buffer;
|
||||
if (*lparam) *lparam = (LPARAM)((DWORD *)*buffer + 1);
|
||||
}
|
||||
return TRUE;
|
||||
case WM_WINE_SETWINDOWPOS:
|
||||
{
|
||||
WINDOWPOS wp;
|
||||
|
@ -1365,6 +1375,11 @@ size_t user_message_size( UINT message, WPARAM wparam, LPARAM lparam, BOOL other
|
|||
case SBM_GETSCROLLBARINFO:
|
||||
size = sizeof(SCROLLBARINFO);
|
||||
break;
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
size = 2 * sizeof(DWORD);
|
||||
break;
|
||||
}
|
||||
|
||||
return size;
|
||||
|
@ -1424,6 +1439,10 @@ void pack_user_message( void *buffer, size_t size, UINT message,
|
|||
size = sizeof(*cds);
|
||||
break;
|
||||
}
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
return;
|
||||
}
|
||||
|
||||
if (size) memcpy( buffer, lparam_ptr, size );
|
||||
|
@ -1503,6 +1522,15 @@ static void copy_user_result( void *buffer, size_t size, LRESULT result, UINT me
|
|||
case SBM_GETSCROLLBARINFO:
|
||||
copy_size = sizeof(SCROLLBARINFO);
|
||||
break;
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
{
|
||||
DWORD *ptr = buffer;
|
||||
if (wparam) *(DWORD *)wparam = ptr[0];
|
||||
if (lparam) *(DWORD *)lparam = ptr[1];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@ -1549,12 +1577,6 @@ static void copy_reply( LRESULT result, HWND hwnd, UINT message, WPARAM wparam,
|
|||
case WM_MDIGETACTIVE:
|
||||
if (lparam) copy_size = sizeof(BOOL);
|
||||
break;
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
if (wparam) *(DWORD *)wparam = *(DWORD *)wparam_src;
|
||||
if (lparam) copy_size = sizeof(DWORD);
|
||||
break;
|
||||
case WM_NEXTMENU:
|
||||
copy_size = sizeof(MDINEXTMENU);
|
||||
break;
|
||||
|
|
|
@ -1355,6 +1355,7 @@ struct lparam_hook_test
|
|||
const char *name;
|
||||
UINT message;
|
||||
WPARAM wparam;
|
||||
BOOL no_wparam_check;
|
||||
LRESULT msg_result;
|
||||
LRESULT check_result;
|
||||
BOOL todo_result;
|
||||
|
@ -1378,7 +1379,7 @@ static char lparam_buffer[521];
|
|||
static void check_params( const struct lparam_hook_test *test, UINT message,
|
||||
WPARAM wparam, LPARAM lparam, BOOL is_ret )
|
||||
{
|
||||
if (test->message != WM_MDIGETACTIVE)
|
||||
if (!test->no_wparam_check)
|
||||
ok( wparam == test->wparam, "got wparam %Ix, expected %Ix\n", wparam, test->wparam );
|
||||
if (lparam == (LPARAM)lparam_buffer)
|
||||
return;
|
||||
|
@ -1406,6 +1407,12 @@ static void check_params( const struct lparam_hook_test *test, UINT message,
|
|||
}
|
||||
break;
|
||||
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
ok( wparam, "wparam = 0\n" );
|
||||
break;
|
||||
|
||||
default:
|
||||
if (test->check_size) {
|
||||
const void *expected = is_ret && test->change_lparam ? test->change_lparam : test->lparam;
|
||||
|
@ -1663,6 +1670,7 @@ static void test_wndproc_hook(void)
|
|||
static const SCROLLINFO si_out = { .cbSize = sizeof(si_in), .nPos = 60 };
|
||||
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 struct lparam_hook_test lparam_hook_tests[] =
|
||||
{
|
||||
|
@ -1743,7 +1751,7 @@ static void test_wndproc_hook(void)
|
|||
.todo = TRUE
|
||||
},
|
||||
{
|
||||
"WM_MDIGETACTIVE", WM_MDIGETACTIVE,
|
||||
"WM_MDIGETACTIVE", WM_MDIGETACTIVE, .no_wparam_check = TRUE,
|
||||
.lparam_size = sizeof(BOOL), .change_lparam = &false_lparam,
|
||||
.todo = TRUE
|
||||
},
|
||||
|
@ -1832,6 +1840,21 @@ static void test_wndproc_hook(void)
|
|||
.lparam_size = sizeof(sbi_in), .lparam = &sbi_in, .change_lparam = &sbi_out,
|
||||
.check_size = sizeof(sbi_in),
|
||||
},
|
||||
{
|
||||
"EM_GETSEL", EM_GETSEL, .no_wparam_check = TRUE,
|
||||
.lparam_size = sizeof(DWORD), .lparam = &dw_in, .change_lparam = &dw_out,
|
||||
.check_size = sizeof(DWORD),
|
||||
},
|
||||
{
|
||||
"SBM_GETRANGE", SBM_GETRANGE, .no_wparam_check = TRUE,
|
||||
.lparam_size = sizeof(DWORD), .lparam = &dw_in, .change_lparam = &dw_out,
|
||||
.check_size = sizeof(DWORD),
|
||||
},
|
||||
{
|
||||
"CB_GETEDITSEL", CB_GETEDITSEL, .no_wparam_check = TRUE,
|
||||
.lparam_size = sizeof(DWORD), .lparam = &dw_in, .change_lparam = &dw_out,
|
||||
.check_size = sizeof(DWORD),
|
||||
},
|
||||
/* messages that don't change lparam */
|
||||
{ "WM_USER", WM_USER },
|
||||
{ "WM_NOTIFY", WM_NOTIFY },
|
||||
|
|
|
@ -835,6 +835,9 @@ static size_t packed_result_32to64( UINT message, WPARAM wparam, const void *par
|
|||
case SBM_SETSCROLLINFO:
|
||||
case SBM_GETSCROLLINFO:
|
||||
case SBM_GETSCROLLBARINFO:
|
||||
case EM_GETSEL:
|
||||
case SBM_GETRANGE:
|
||||
case CB_GETEDITSEL:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue