win32u: Use user message packing for WM_HELP.

This commit is contained in:
Jacek Caban 2023-07-18 12:41:46 +02:00 committed by Alexandre Julliard
parent 69834a3095
commit e7aa894555
3 changed files with 56 additions and 13 deletions

View file

@ -853,23 +853,11 @@ BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lparam,
case WM_COMPAREITEM:
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
case WM_HELP:
break;
case WM_NOTIFY:
/* WM_NOTIFY cannot be sent across processes (MSDN) */
return FALSE;
case WM_HELP:
{
HELPINFO hi;
if (size < sizeof(ps->hi)) return FALSE;
hi.cbSize = sizeof(hi);
hi.iContextType = ps->hi.iContextType;
hi.iCtrlId = ps->hi.iCtrlId;
hi.hItemHandle = unpack_handle( ps->hi.hItemHandle );
hi.dwContextId = (ULONG_PTR)unpack_ptr( ps->hi.dwContextId );
hi.MousePos = ps->hi.MousePos;
memcpy( &ps->hi, &hi, sizeof(hi) );
break;
}
case WM_STYLECHANGING:
case WM_STYLECHANGED:
minsize = sizeof(STYLESTRUCT);
@ -1114,6 +1102,7 @@ BOOL WINAPI User32CallWindowProc( struct win_proc_params *params, ULONG size )
case WM_WINDOWPOSCHANGING:
case WM_WINDOWPOSCHANGED:
case WM_COPYDATA:
case WM_HELP:
{
LRESULT *result_ptr = (LRESULT *)buffer - 1;
*result_ptr = result;

View file

@ -523,6 +523,19 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
memcpy( &ps->cds, &cds, sizeof(cds) );
break;
}
case WM_HELP:
{
HELPINFO hi;
if (size < sizeof(ps->hi)) return FALSE;
hi.cbSize = sizeof(hi);
hi.iContextType = ps->hi.iContextType;
hi.iCtrlId = ps->hi.iCtrlId;
hi.hItemHandle = wine_server_ptr_handle( ps->hi.hItemHandle );
hi.dwContextId = (ULONG_PTR)unpack_ptr( ps->hi.dwContextId );
hi.MousePos = ps->hi.MousePos;
memcpy( &ps->hi, &hi, sizeof(hi) );
break;
}
case WM_WINE_SETWINDOWPOS:
{
WINDOWPOS wp;
@ -1332,6 +1345,9 @@ size_t user_message_size( UINT message, WPARAM wparam, LPARAM lparam, BOOL other
size = sizeof(*cds) + cds->cbData;
break;
}
case WM_HELP:
size = sizeof(HELPINFO);
break;
}
return size;

View file

@ -218,6 +218,16 @@ typedef struct
ULONG lpData;
} COPYDATASTRUCT32;
typedef struct
{
UINT cbSize;
INT iContextType;
INT iCtrlId;
ULONG hItemHandle;
DWORD dwContextId;
POINT MousePos;
} HELPINFO32;
typedef struct
{
UINT CtlType;
@ -734,6 +744,20 @@ static size_t packed_message_64to32( UINT message, WPARAM wparam,
if (size) memmove( (char *)params32 + sizeof(cds32), cds64 + 1, size );
return sizeof(cds32) + size;
}
case WM_HELP:
{
HELPINFO32 hi32;
const HELPINFO *hi64 = params64;
hi32.cbSize = sizeof(hi32);
hi32.iContextType = hi64->iContextType;
hi32.iCtrlId = hi64->iCtrlId;
hi32.hItemHandle = HandleToLong( hi64->hItemHandle );
hi32.dwContextId = hi64->dwContextId;
hi32.MousePos = hi64->MousePos;
memcpy( params32, &hi32, sizeof(hi32) );
return sizeof(hi32);
}
}
memmove( params32, params64, size );
@ -3280,6 +3304,20 @@ static LRESULT message_call_32to64( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&cds, result_info, type, ansi );
}
case WM_HELP:
{
HELPINFO32 *hi32 = (void *)lparam;
HELPINFO hi64;
hi64.cbSize = sizeof(hi64);
hi64.iContextType = hi32->iContextType;
hi64.iCtrlId = hi32->iCtrlId;
hi64.hItemHandle = LongToHandle( hi32->hItemHandle );
hi64.dwContextId = hi32->dwContextId;
hi64.MousePos = hi32->MousePos;
return NtUserMessageCall( hwnd, msg, wparam, (LPARAM)&hi64, result_info, type, ansi );
}
case WM_GETDLGCODE:
if (lparam)
{