Commit 9b3aa968 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Pack messages in WH_CALLWNDPROCRET hooks.

parent 7cc06fb9
......@@ -495,6 +495,18 @@ BOOL WINAPI User32CallWindowsHook( struct win_hook_params *params, ULONG size )
ret_size = 0;
break;
}
case WH_CALLWNDPROCRET:
if (ret_size > sizeof(CWPRETSTRUCT))
{
CWPRETSTRUCT *cwpret = (CWPRETSTRUCT *)params->lparam;
size_t offset = (lparam_offset + sizeof(*cwpret) + 15) & ~15;
void *buffer = (char *)params + offset;
unpack_message( cwpret->hwnd, cwpret->message, &cwpret->wParam, &cwpret->lParam,
&buffer, size - offset, !params->prev_unicode );
ret_size = 0;
break;
}
}
}
if (params->module[0] && !(proc = get_hook_proc( proc, params->module, &free_module )))
......
......@@ -295,6 +295,13 @@ static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, siz
cwp->message, cwp->lParam, ansi );
}
break;
case WH_CALLWNDPROCRET:
{
CWPRETSTRUCT *cwpret = (CWPRETSTRUCT *)((char *)params + lparam_offset);
pack_user_message( (char *)params + message_offset, message_size,
cwpret->message, cwpret->lParam, ansi );
}
break;
}
}
......
......@@ -766,6 +766,15 @@ static UINT hook_lparam_64to32( int id, int code, const void *lp, size_t size, v
cwpret32.message = cwpret->message;
cwpret32.hwnd = HandleToUlong( cwpret->hwnd );
memcpy( lp32, &cwpret32, sizeof(cwpret32) );
if (size > sizeof(*cwpret))
{
const size_t offset64 = (sizeof(*cwpret) + 15) & ~15;
const size_t offset32 = (sizeof(cwpret32) + 15) & ~15;
size = packed_message_64to32( cwpret32.message,
(const char *)lp + offset64,
(char *)lp32 + offset32, size - offset64 );
return offset32 + size;
}
return sizeof(cwpret32);
}
......
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