Alexandre Julliard : server:
Set the queue mask directly in get_message to avoid an extra server
call.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Aug 30 06:20:13 CDT 2007
Module: wine
Branch: master
Commit: 2896540a34a18b8aff848d728308c5811cdd122a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2896540a34a18b8aff848d728308c5811cdd122a
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Aug 29 18:13:13 2007 +0200
server: Set the queue mask directly in get_message to avoid an extra server call.
---
dlls/user32/message.c | 32 ++++++++------------------------
include/wine/server_protocol.h | 4 +++-
server/protocol.def | 2 ++
server/queue.c | 2 ++
server/trace.c | 4 +++-
5 files changed, 18 insertions(+), 26 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index e87c428..46333b6 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2017,9 +2017,12 @@ static BOOL peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags
ULONG_PTR extra_info = 0;
struct user_thread_info *thread_info = get_user_thread_info();
struct received_message_info info, *old_info;
+ unsigned int wake_mask, changed_mask = HIWORD(flags);
unsigned int hw_id = 0; /* id of previous hardware message */
if (!first && !last) last = ~0;
+ if (!changed_mask) changed_mask = QS_ALLINPUT;
+ wake_mask = changed_mask & (QS_SENDMESSAGE | QS_SMRESULT);
for (;;)
{
@@ -2038,6 +2041,8 @@ static BOOL peek_message( MSG *msg, HWND hwnd, UINT first, UINT last, UINT flags
req->get_first = first;
req->get_last = last;
req->hw_id = hw_id;
+ req->wake_mask = wake_mask;
+ req->changed_mask = changed_mask;
if (buffer_size) wine_server_set_reply( req, buffer, buffer_size );
if (!(res = wine_server_call( req )))
{
@@ -2933,35 +2938,14 @@ BOOL WINAPI GetMessageW( MSG *msg, HWND hwnd, UINT first, UINT last )
if ((first <= WM_SYSTIMER) && (last >= WM_SYSTIMER)) mask |= QS_TIMER;
if ((first <= WM_PAINT) && (last >= WM_PAINT)) mask |= QS_PAINT;
}
- else mask |= QS_MOUSE | QS_KEY | QS_TIMER | QS_PAINT;
+ else mask = QS_ALLINPUT;
- while (!PeekMessageW( msg, hwnd, first, last, PM_REMOVE ))
+ while (!PeekMessageW( msg, hwnd, first, last, PM_REMOVE | PM_NOYIELD | (mask << 16) ))
{
- /* wait until one of the bits is set */
- unsigned int wake_bits = 0, changed_bits = 0;
DWORD dwlc;
- SERVER_START_REQ( set_queue_mask )
- {
- req->wake_mask = QS_SENDMESSAGE;
- req->changed_mask = mask;
- req->skip_wait = 1;
- if (!wine_server_call( req ))
- {
- wake_bits = reply->wake_bits;
- changed_bits = reply->changed_bits;
- }
- }
- SERVER_END_REQ;
-
- if (changed_bits & mask) continue;
- if (wake_bits & QS_SENDMESSAGE) continue;
-
- TRACE( "(%04x) mask=%08x, bits=%08x, changed=%08x, waiting\n",
- GetCurrentThreadId(), mask, wake_bits, changed_bits );
-
ReleaseThunkLock( &dwlc );
- USER_Driver->pMsgWaitForMultipleObjectsEx( 1, &server_queue, INFINITE, QS_ALLINPUT, 0 );
+ USER_Driver->pMsgWaitForMultipleObjectsEx( 1, &server_queue, INFINITE, mask, 0 );
if (dwlc) RestoreThunkLock( dwlc );
}
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
index 936728a..b1f48cb 100644
--- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
@@ -2499,6 +2499,8 @@ struct get_message_request
unsigned int get_first;
unsigned int get_last;
unsigned int hw_id;
+ unsigned int wake_mask;
+ unsigned int changed_mask;
};
struct get_message_reply
{
@@ -4731,6 +4733,6 @@ union generic_reply
struct make_process_system_reply make_process_system_reply;
};
-#define SERVER_PROTOCOL_VERSION 311
+#define SERVER_PROTOCOL_VERSION 312
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
diff --git a/server/protocol.def b/server/protocol.def
index 0ce75f5..e210e43 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1859,6 +1859,8 @@ enum message_type
unsigned int get_first; /* first message code to get */
unsigned int get_last; /* last message code to get */
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 */
@REPLY
user_handle_t win; /* window handle */
int type; /* message type */
diff --git a/server/queue.c b/server/queue.c
index 5188f0d..1e8de22 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1828,6 +1828,8 @@ DECL_HANDLER(get_message)
return;
}
+ queue->wake_mask = req->wake_mask;
+ queue->changed_mask = req->changed_mask;
set_error( STATUS_PENDING ); /* FIXME */
}
diff --git a/server/trace.c b/server/trace.c
index e707e47..49f4479 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -2304,7 +2304,9 @@ static void dump_get_message_request( const struct get_message_request *req )
fprintf( stderr, " get_win=%p,", req->get_win );
fprintf( stderr, " get_first=%08x,", req->get_first );
fprintf( stderr, " get_last=%08x,", req->get_last );
- fprintf( stderr, " hw_id=%08x", req->hw_id );
+ fprintf( stderr, " hw_id=%08x,", req->hw_id );
+ fprintf( stderr, " wake_mask=%08x,", req->wake_mask );
+ fprintf( stderr, " changed_mask=%08x", req->changed_mask );
}
static void dump_get_message_reply( const struct get_message_reply *req )
More information about the wine-cvs
mailing list