Commit b053e924 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

server: Process internal messages when checking queue status.

parent a8451741
......@@ -2038,6 +2038,9 @@ static void test_hid_touch_screen(void)
ret = RegisterRawInputDevices( &rawdevice, 1, sizeof(RAWINPUTDEVICE) );
ok( ret, "RegisterRawInputDevices failed, error %lu\n", GetLastError() );
res = GetQueueStatus( QS_RAWINPUT );
ok( res == 0, "got res %#lx\n", res );
bus_send_hid_input( file, &desc, &touch_multiple, sizeof(touch_multiple) );
bus_wait_hid_input( file, &desc, 5000 );
bus_send_hid_input( file, &desc, &touch_release, sizeof(touch_release) );
......@@ -2046,6 +2049,10 @@ static void test_hid_touch_screen(void)
res = MsgWaitForMultipleObjects( 0, NULL, FALSE, 500, QS_POINTER );
ok( !res, "MsgWaitForMultipleObjects returned %#lx\n", res );
res = GetQueueStatus( QS_RAWINPUT );
ok( LOWORD(res) == QS_RAWINPUT, "got res %#lx\n", res );
ok( HIWORD(res) == QS_RAWINPUT, "got res %#lx\n", res );
memset( rawbuffer, 0, sizeof(rawbuffer) );
rawinput = (RAWINPUT *)rawbuffer;
rawbuffer_size = sizeof(rawbuffer);
......@@ -2064,6 +2071,10 @@ static void test_hid_touch_screen(void)
ok( !memcmp( rawinput->data.hid.bRawData, touch_multiple.report_buf, desc.caps.InputReportByteLength ),
"got unexpected report data\n" );
res = GetQueueStatus( QS_RAWINPUT );
ok( LOWORD(res) == 0, "got res %#lx\n", res );
ok( HIWORD(res) == 0, "got res %#lx\n", res );
rawdevice.dwFlags = RIDEV_REMOVE;
rawdevice.hwndTarget = 0;
ret = RegisterRawInputDevices( &rawdevice, 1, sizeof(RAWINPUTDEVICE) );
......
......@@ -791,8 +791,17 @@ BOOL WINAPI NtUserGetCursorInfo( CURSORINFO *info )
static void check_for_events( UINT flags )
{
struct peek_message_filter filter =
{
.internal = TRUE,
.flags = PM_REMOVE,
};
MSG msg;
if (!user_driver->pProcessEvents( flags ))
flush_window_surfaces( TRUE );
peek_message( &msg, &filter );
}
/**********************************************************************
......
......@@ -2695,15 +2695,6 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardwar
return ret;
}
struct peek_message_filter
{
HWND hwnd;
UINT first;
UINT last;
UINT mask;
UINT flags;
};
/***********************************************************************
* peek_message
*
......@@ -2711,7 +2702,7 @@ struct peek_message_filter
* available; -1 on error.
* All pending sent messages are processed before returning.
*/
static int peek_message( MSG *msg, const struct peek_message_filter *filter )
int peek_message( MSG *msg, const struct peek_message_filter *filter )
{
LRESULT result;
HWND hwnd = filter->hwnd;
......@@ -2738,6 +2729,7 @@ static int peek_message( MSG *msg, const struct peek_message_filter *filter )
SERVER_START_REQ( get_message )
{
req->internal = filter->internal;
req->flags = flags;
req->get_win = wine_server_user_handle( hwnd );
req->get_first = first;
......@@ -2923,6 +2915,7 @@ static int peek_message( MSG *msg, const struct peek_message_filter *filter )
.first = info.msg.message,
.last = info.msg.message,
.mask = filter->mask,
.internal = filter->internal,
};
peek_message( msg, &new_filter );
}
......
......@@ -238,6 +238,17 @@ extern void free_dce( struct dce *dce, HWND hwnd );
extern void invalidate_dce( WND *win, const RECT *extra_rect );
/* message.c */
struct peek_message_filter
{
HWND hwnd;
UINT first;
UINT last;
UINT mask;
UINT flags;
BOOL internal;
};
extern int peek_message( MSG *msg, const struct peek_message_filter *filter );
extern BOOL set_keyboard_auto_repeat( BOOL enable );
/* systray.c */
......
......@@ -2877,6 +2877,8 @@ struct get_message_request
unsigned int hw_id;
unsigned int wake_mask;
unsigned int changed_mask;
unsigned int internal;
char __pad_44[4];
};
struct get_message_reply
{
......@@ -6507,7 +6509,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 797
#define SERVER_PROTOCOL_VERSION 798
/* ### protocol_version end ### */
......
......@@ -2150,6 +2150,7 @@ enum message_type
unsigned int hw_id; /* id of the previous hardware message (or 0) */
unsigned int wake_mask; /* wakeup bits mask */
unsigned int changed_mask; /* changed bits mask */
unsigned int internal; /* get internal messages only */
@REPLY
user_handle_t win; /* window handle */
unsigned int msg; /* message code */
......
......@@ -2994,6 +2994,12 @@ DECL_HANDLER(get_message)
WM_WINE_LAST_DRIVER_MSG, req->flags, reply ))
return;
if (req->internal) /* check for internal messages only, leave queue flags unchanged */
{
set_error( STATUS_PENDING );
return;
}
queue->last_get_msg = current_time;
if (!filter) filter = QS_ALLINPUT;
......
......@@ -1412,7 +1412,8 @@ C_ASSERT( FIELD_OFFSET(struct get_message_request, get_last) == 24 );
C_ASSERT( FIELD_OFFSET(struct get_message_request, hw_id) == 28 );
C_ASSERT( FIELD_OFFSET(struct get_message_request, wake_mask) == 32 );
C_ASSERT( FIELD_OFFSET(struct get_message_request, changed_mask) == 36 );
C_ASSERT( sizeof(struct get_message_request) == 40 );
C_ASSERT( FIELD_OFFSET(struct get_message_request, internal) == 40 );
C_ASSERT( sizeof(struct get_message_request) == 48 );
C_ASSERT( FIELD_OFFSET(struct get_message_reply, win) == 8 );
C_ASSERT( FIELD_OFFSET(struct get_message_reply, msg) == 12 );
C_ASSERT( FIELD_OFFSET(struct get_message_reply, wparam) == 16 );
......
......@@ -2735,6 +2735,7 @@ static void dump_get_message_request( const struct get_message_request *req )
fprintf( stderr, ", hw_id=%08x", req->hw_id );
fprintf( stderr, ", wake_mask=%08x", req->wake_mask );
fprintf( stderr, ", changed_mask=%08x", req->changed_mask );
fprintf( stderr, ", internal=%08x", req->internal );
}
static void dump_get_message_reply( const struct get_message_reply *req )
......
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