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

win32u: Use user message packing for WM_HELP.

parent 69834a30
......@@ -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;
......
......@@ -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;
......
......@@ -220,6 +220,16 @@ typedef struct
typedef struct
{
UINT cbSize;
INT iContextType;
INT iCtrlId;
ULONG hItemHandle;
DWORD dwContextId;
POINT MousePos;
} HELPINFO32;
typedef struct
{
UINT CtlType;
UINT CtlID;
UINT itemID;
......@@ -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)
{
......
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