Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d3b30967
Commit
d3b30967
authored
Aug 09, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Split the queuing of hardware messages into a separate send_hardware_message request.
parent
64c5142a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
105 additions
and
40 deletions
+105
-40
message.c
dlls/user/message.c
+0
-2
keyboard.c
dlls/winex11.drv/keyboard.c
+1
-5
mouse.c
dlls/winex11.drv/mouse.c
+1
-5
server_protocol.h
include/wine/server_protocol.h
+24
-4
protocol.def
server/protocol.def
+14
-3
queue.c
server/queue.c
+47
-18
request.h
server/request.h
+2
-0
trace.c
server/trace.c
+16
-3
No files found.
dlls/user/message.c
View file @
d3b30967
...
...
@@ -1390,7 +1390,6 @@ static BOOL post_dde_message( struct packed_message *data, const struct send_mes
req
->
msg
=
info
->
msg
;
req
->
wparam
=
info
->
wparam
;
req
->
lparam
=
lp
;
req
->
time
=
GetCurrentTime
();
req
->
timeout
=
0
;
for
(
i
=
0
;
i
<
data
->
count
;
i
++
)
wine_server_add_data
(
req
,
data
->
data
[
i
],
data
->
size
[
i
]
);
...
...
@@ -2196,7 +2195,6 @@ static BOOL put_message_in_queue( const struct send_message_info *info, size_t *
req
->
msg
=
info
->
msg
;
req
->
wparam
=
info
->
wparam
;
req
->
lparam
=
info
->
lparam
;
req
->
time
=
GetCurrentTime
();
req
->
timeout
=
timeout
;
if
(
info
->
type
==
MSG_CALLBACK
)
...
...
dlls/winex11.drv/keyboard.c
View file @
d3b30967
...
...
@@ -1183,11 +1183,9 @@ void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD dwFlags, DWORD time
hook
.
dwExtraInfo
=
dwExtraInfo
;
if
(
HOOK_CallHooks
(
WH_KEYBOARD_LL
,
HC_ACTION
,
message
,
(
LPARAM
)
&
hook
,
TRUE
))
return
;
SERVER_START_REQ
(
send_message
)
SERVER_START_REQ
(
send_
hardware_
message
)
{
req
->
id
=
(
injected_flags
&
LLKHF_INJECTED
)
?
0
:
GetCurrentThreadId
();
req
->
type
=
MSG_HARDWARE
;
req
->
flags
=
0
;
req
->
win
=
0
;
req
->
msg
=
message
;
req
->
wparam
=
wVk
;
...
...
@@ -1196,8 +1194,6 @@ void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD dwFlags, DWORD time
req
->
y
=
cursor_pos
.
y
;
req
->
time
=
time
;
req
->
info
=
dwExtraInfo
;
req
->
timeout
=
-
1
;
req
->
callback
=
NULL
;
wine_server_call
(
req
);
}
SERVER_END_REQ
;
...
...
dlls/winex11.drv/mouse.c
View file @
d3b30967
...
...
@@ -199,11 +199,9 @@ static void queue_raw_mouse_message( UINT message, HWND hwnd, DWORD x, DWORD y,
if
(
HOOK_CallHooks
(
WH_MOUSE_LL
,
HC_ACTION
,
message
,
(
LPARAM
)
&
hook
,
TRUE
))
return
;
SERVER_START_REQ
(
send_message
)
SERVER_START_REQ
(
send_
hardware_
message
)
{
req
->
id
=
(
injected_flags
&
LLMHF_INJECTED
)
?
0
:
GetCurrentThreadId
();
req
->
type
=
MSG_HARDWARE
;
req
->
flags
=
0
;
req
->
win
=
hwnd
;
req
->
msg
=
message
;
req
->
wparam
=
MAKEWPARAM
(
get_key_state
(),
data
);
...
...
@@ -212,8 +210,6 @@ static void queue_raw_mouse_message( UINT message, HWND hwnd, DWORD x, DWORD y,
req
->
y
=
y
;
req
->
time
=
time
;
req
->
info
=
extra_info
;
req
->
timeout
=
-
1
;
req
->
callback
=
NULL
;
wine_server_call
(
req
);
}
SERVER_END_REQ
;
...
...
include/wine/server_protocol.h
View file @
d3b30967
...
...
@@ -2199,9 +2199,6 @@ struct send_message_request
unsigned
int
msg
;
unsigned
long
wparam
;
unsigned
long
lparam
;
int
x
;
int
y
;
unsigned
int
time
;
unsigned
int
info
;
int
timeout
;
void
*
callback
;
...
...
@@ -2238,6 +2235,26 @@ enum message_type
struct
send_hardware_message_request
{
struct
request_header
__header
;
thread_id_t
id
;
user_handle_t
win
;
unsigned
int
msg
;
unsigned
long
wparam
;
unsigned
long
lparam
;
int
x
;
int
y
;
unsigned
int
time
;
unsigned
int
info
;
};
struct
send_hardware_message_reply
{
struct
reply_header
__header
;
};
struct
get_message_request
{
struct
request_header
__header
;
...
...
@@ -3855,6 +3872,7 @@ enum request
REQ_get_process_idle_event
,
REQ_send_message
,
REQ_post_quit_message
,
REQ_send_hardware_message
,
REQ_get_message
,
REQ_reply_message
,
REQ_accept_hardware_message
,
...
...
@@ -4075,6 +4093,7 @@ union generic_request
struct
get_process_idle_event_request
get_process_idle_event_request
;
struct
send_message_request
send_message_request
;
struct
post_quit_message_request
post_quit_message_request
;
struct
send_hardware_message_request
send_hardware_message_request
;
struct
get_message_request
get_message_request
;
struct
reply_message_request
reply_message_request
;
struct
accept_hardware_message_request
accept_hardware_message_request
;
...
...
@@ -4293,6 +4312,7 @@ union generic_reply
struct
get_process_idle_event_reply
get_process_idle_event_reply
;
struct
send_message_reply
send_message_reply
;
struct
post_quit_message_reply
post_quit_message_reply
;
struct
send_hardware_message_reply
send_hardware_message_reply
;
struct
get_message_reply
get_message_reply
;
struct
reply_message_reply
reply_message_reply
;
struct
accept_hardware_message_reply
accept_hardware_message_reply
;
...
...
@@ -4385,6 +4405,6 @@ union generic_reply
struct
query_symlink_reply
query_symlink_reply
;
};
#define SERVER_PROTOCOL_VERSION 24
4
#define SERVER_PROTOCOL_VERSION 24
5
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/protocol.def
View file @
d3b30967
...
...
@@ -1571,9 +1571,6 @@ enum char_info_mode
unsigned int msg; /* message code */
unsigned long wparam; /* parameters */
unsigned long lparam; /* parameters */
int x; /* x position */
int y; /* y position */
unsigned int time; /* message time */
unsigned int info; /* extra info */
int timeout; /* timeout for reply */
void* callback; /* callback address */
...
...
@@ -1599,6 +1596,20 @@ enum message_type
#define SEND_MSG_ABORT_IF_HUNG 0x01
/* Send a hardware message to a thread queue */
@REQ(send_hardware_message)
thread_id_t id; /* thread id */
user_handle_t win; /* window handle */
unsigned int msg; /* message code */
unsigned long wparam; /* parameters */
unsigned long lparam; /* parameters */
int x; /* x position */
int y; /* y position */
unsigned int time; /* message time */
unsigned int info; /* extra info */
@END
/* Get a message from the current queue */
@REQ(get_message)
int flags; /* see below */
...
...
server/queue.c
View file @
d3b30967
...
...
@@ -1569,24 +1569,15 @@ DECL_HANDLER(send_message)
struct
msg_queue
*
recv_queue
=
NULL
;
struct
thread
*
thread
=
NULL
;
if
(
req
->
id
)
{
if
(
!
(
thread
=
get_thread_from_id
(
req
->
id
)))
return
;
}
else
if
(
req
->
type
!=
MSG_HARDWARE
)
{
/* only hardware messages are allowed without destination thread */
set_error
(
STATUS_INVALID_PARAMETER
);
return
;
}
if
(
!
(
thread
=
get_thread_from_id
(
req
->
id
)))
return
;
if
(
thread
&&
!
(
recv_queue
=
thread
->
queue
))
if
(
!
(
recv_queue
=
thread
->
queue
))
{
set_error
(
STATUS_INVALID_PARAMETER
);
release_object
(
thread
);
return
;
}
if
(
recv_queue
&&
(
req
->
flags
&
SEND_MSG_ABORT_IF_HUNG
)
&&
is_queue_hung
(
recv_queue
))
if
((
req
->
flags
&
SEND_MSG_ABORT_IF_HUNG
)
&&
is_queue_hung
(
recv_queue
))
{
set_error
(
STATUS_TIMEOUT
);
release_object
(
thread
);
...
...
@@ -1600,9 +1591,9 @@ DECL_HANDLER(send_message)
msg
->
msg
=
req
->
msg
;
msg
->
wparam
=
req
->
wparam
;
msg
->
lparam
=
req
->
lparam
;
msg
->
time
=
req
->
time
;
msg
->
x
=
req
->
x
;
msg
->
y
=
req
->
y
;
msg
->
time
=
get_tick_count
()
;
msg
->
x
=
0
;
msg
->
y
=
0
;
msg
->
info
=
req
->
info
;
msg
->
hook
=
0
;
msg
->
hook_proc
=
NULL
;
...
...
@@ -1645,9 +1636,7 @@ DECL_HANDLER(send_message)
list_add_tail
(
&
recv_queue
->
msg_list
[
POST_MESSAGE
],
&
msg
->
entry
);
set_queue_bits
(
recv_queue
,
QS_POSTMESSAGE
|
QS_ALLPOSTMESSAGE
);
break
;
case
MSG_HARDWARE
:
queue_hardware_message
(
recv_queue
,
msg
);
break
;
case
MSG_HARDWARE
:
/* should use send_hardware_message instead */
case
MSG_CALLBACK_RESULT
:
/* cannot send this one */
default
:
set_error
(
STATUS_INVALID_PARAMETER
);
...
...
@@ -1655,6 +1644,46 @@ DECL_HANDLER(send_message)
break
;
}
}
release_object
(
thread
);
}
/* send a hardware message to a thread queue */
DECL_HANDLER
(
send_hardware_message
)
{
struct
message
*
msg
;
struct
msg_queue
*
recv_queue
=
NULL
;
struct
thread
*
thread
=
NULL
;
if
(
req
->
id
)
{
if
(
!
(
thread
=
get_thread_from_id
(
req
->
id
)))
return
;
}
if
(
thread
&&
!
(
recv_queue
=
thread
->
queue
))
{
set_error
(
STATUS_INVALID_PARAMETER
);
release_object
(
thread
);
return
;
}
if
((
msg
=
mem_alloc
(
sizeof
(
*
msg
)
)))
{
msg
->
type
=
MSG_HARDWARE
;
msg
->
win
=
get_user_full_handle
(
req
->
win
);
msg
->
msg
=
req
->
msg
;
msg
->
wparam
=
req
->
wparam
;
msg
->
lparam
=
req
->
lparam
;
msg
->
time
=
req
->
time
;
msg
->
x
=
req
->
x
;
msg
->
y
=
req
->
y
;
msg
->
info
=
req
->
info
;
msg
->
hook
=
0
;
msg
->
hook_proc
=
NULL
;
msg
->
result
=
NULL
;
msg
->
data
=
NULL
;
msg
->
data_size
=
0
;
queue_hardware_message
(
recv_queue
,
msg
);
}
if
(
thread
)
release_object
(
thread
);
}
...
...
server/request.h
View file @
d3b30967
...
...
@@ -233,6 +233,7 @@ DECL_HANDLER(get_queue_status);
DECL_HANDLER
(
get_process_idle_event
);
DECL_HANDLER
(
send_message
);
DECL_HANDLER
(
post_quit_message
);
DECL_HANDLER
(
send_hardware_message
);
DECL_HANDLER
(
get_message
);
DECL_HANDLER
(
reply_message
);
DECL_HANDLER
(
accept_hardware_message
);
...
...
@@ -452,6 +453,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(
req_handler
)
req_get_process_idle_event
,
(
req_handler
)
req_send_message
,
(
req_handler
)
req_post_quit_message
,
(
req_handler
)
req_send_hardware_message
,
(
req_handler
)
req_get_message
,
(
req_handler
)
req_reply_message
,
(
req_handler
)
req_accept_hardware_message
,
...
...
server/trace.c
View file @
d3b30967
...
...
@@ -2091,9 +2091,6 @@ static void dump_send_message_request( const struct send_message_request *req )
fprintf
(
stderr
,
" msg=%08x,"
,
req
->
msg
);
fprintf
(
stderr
,
" wparam=%lx,"
,
req
->
wparam
);
fprintf
(
stderr
,
" lparam=%lx,"
,
req
->
lparam
);
fprintf
(
stderr
,
" x=%d,"
,
req
->
x
);
fprintf
(
stderr
,
" y=%d,"
,
req
->
y
);
fprintf
(
stderr
,
" time=%08x,"
,
req
->
time
);
fprintf
(
stderr
,
" info=%08x,"
,
req
->
info
);
fprintf
(
stderr
,
" timeout=%d,"
,
req
->
timeout
);
fprintf
(
stderr
,
" callback=%p,"
,
req
->
callback
);
...
...
@@ -2106,6 +2103,19 @@ static void dump_post_quit_message_request( const struct post_quit_message_reque
fprintf
(
stderr
,
" exit_code=%d"
,
req
->
exit_code
);
}
static
void
dump_send_hardware_message_request
(
const
struct
send_hardware_message_request
*
req
)
{
fprintf
(
stderr
,
" id=%04x,"
,
req
->
id
);
fprintf
(
stderr
,
" win=%p,"
,
req
->
win
);
fprintf
(
stderr
,
" msg=%08x,"
,
req
->
msg
);
fprintf
(
stderr
,
" wparam=%lx,"
,
req
->
wparam
);
fprintf
(
stderr
,
" lparam=%lx,"
,
req
->
lparam
);
fprintf
(
stderr
,
" x=%d,"
,
req
->
x
);
fprintf
(
stderr
,
" y=%d,"
,
req
->
y
);
fprintf
(
stderr
,
" time=%08x,"
,
req
->
time
);
fprintf
(
stderr
,
" info=%08x"
,
req
->
info
);
}
static
void
dump_get_message_request
(
const
struct
get_message_request
*
req
)
{
fprintf
(
stderr
,
" flags=%d,"
,
req
->
flags
);
...
...
@@ -3396,6 +3406,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_get_process_idle_event_request
,
(
dump_func
)
dump_send_message_request
,
(
dump_func
)
dump_post_quit_message_request
,
(
dump_func
)
dump_send_hardware_message_request
,
(
dump_func
)
dump_get_message_request
,
(
dump_func
)
dump_reply_message_request
,
(
dump_func
)
dump_accept_hardware_message_request
,
...
...
@@ -3612,6 +3623,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_get_process_idle_event_reply
,
(
dump_func
)
0
,
(
dump_func
)
0
,
(
dump_func
)
0
,
(
dump_func
)
dump_get_message_reply
,
(
dump_func
)
0
,
(
dump_func
)
0
,
...
...
@@ -3828,6 +3840,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"get_process_idle_event"
,
"send_message"
,
"post_quit_message"
,
"send_hardware_message"
,
"get_message"
,
"reply_message"
,
"accept_hardware_message"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment