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

user32: Always use NtCallbackReturn in User32DrawText.

parent 0aa36a83
......@@ -121,19 +121,13 @@ static NTSTATUS WINAPI User32DrawScrollBar( const struct draw_scroll_bar_params
return 0;
}
static NTSTATUS WINAPI User32DrawText( const struct draw_text_params *params, ULONG size )
static NTSTATUS WINAPI User32DrawText( struct draw_text_params *params, ULONG size )
{
RECT rect = params->rect;
int ret;
size -= FIELD_OFFSET( struct draw_text_params, str );
ret = DrawTextW( params->hdc, params->str, size / sizeof(WCHAR), &rect, params->flags );
if (params->ret_rect)
{
*params->ret_rect = rect;
return ret;
}
return NtCallbackReturn( &rect, sizeof(rect), ret );
ret = DrawTextW( params->hdc, params->str, size / sizeof(WCHAR), &params->rect, params->flags );
return NtCallbackReturn( &params->rect, sizeof(params->rect), ret );
}
static NTSTATUS WINAPI User32ImmProcessKey( const struct imm_process_key_params *params, ULONG size )
......
......@@ -7097,7 +7097,6 @@ INT WINAPI DECLSPEC_HIDDEN DrawTextW( HDC hdc, const WCHAR *str, INT count, RECT
if (!(params = malloc( size ))) return 0;
params->hdc = hdc;
params->rect = *rect;
params->ret_rect = rect;
params->flags = flags;
if (count) memcpy( params->str, str, count * sizeof(WCHAR) );
ret = KeUserModeCallback( NtUserDrawText, params, size, &ret_ptr, &ret_len );
......
......@@ -312,7 +312,6 @@ struct draw_text_params32
ULONG hdc;
int count;
RECT rect;
ULONG ret_rect;
UINT flags;
WCHAR str[1];
};
......@@ -832,25 +831,18 @@ static NTSTATUS WINAPI wow64_NtUserDrawText( void *arg, ULONG size )
{
struct draw_text_params *params = arg;
struct draw_text_params32 *params32;
RECT *rect_ptr = params->ret_rect;
ULONG offset = offsetof( struct draw_text_params, str ) - offsetof( struct draw_text_params32, str );
ULONG ret_len;
void *ret_ptr;
NTSTATUS ret;
params32 = (struct draw_text_params32 *)(params + 1) - 1;
params32 = (struct draw_text_params32 *)((char *)params + offset);
params32->flags = params->flags;
params32->ret_rect = 0;
params32->rect = params->rect;
params32->count = params->count;
params32->hdc = HandleToUlong( params->hdc );
ret = Wow64KiUserCallbackDispatcher( NtUserDrawText, params32,
size - sizeof(*params) + sizeof(*params32), &ret_ptr, &ret_len );
if (ret_len == sizeof(RECT) && rect_ptr)
{
*rect_ptr = *(const RECT *)ret_ptr;
return ret;
}
ret = Wow64KiUserCallbackDispatcher( NtUserDrawText, params32, size - offset, &ret_ptr, &ret_len );
return NtCallbackReturn( ret_ptr, ret_len, ret );
}
......
......@@ -188,7 +188,6 @@ struct draw_text_params
HDC hdc;
int count;
RECT rect;
RECT *ret_rect; /* FIXME: Use NtCallbackReturn instead */
UINT flags;
WCHAR str[1];
};
......
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