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
bc55b75d
Commit
bc55b75d
authored
Oct 04, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Oct 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Pass hook handle to the destination thread.
parent
2f80fcd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
11 deletions
+70
-11
hook.c
dlls/user/hook.c
+39
-4
message.c
dlls/user/message.c
+24
-7
user_private.h
dlls/user/user_private.h
+7
-0
No files found.
dlls/user/hook.c
View file @
bc55b75d
...
...
@@ -329,18 +329,24 @@ static LRESULT call_hook( struct hook_info *info, INT code, WPARAM wparam, LPARA
if
(
info
->
tid
)
{
struct
hook_extra_info
h_extra
;
h_extra
.
handle
=
info
->
handle
;
h_extra
.
lparam
=
lparam
;
TRACE
(
"calling hook in thread %04x %s code %x wp %x lp %lx
\n
"
,
info
->
tid
,
hook_names
[
info
->
id
-
WH_MINHOOK
],
code
,
wparam
,
lparam
);
switch
(
info
->
id
)
{
case
WH_KEYBOARD_LL
:
MSG_SendInternalMessageTimeout
(
info
->
pid
,
info
->
tid
,
WM_WINE_KEYBOARD_LL_HOOK
,
wparam
,
lparam
,
SMTO_ABORTIFHUNG
,
get_ll_hook_timeout
(),
&
ret
);
MSG_SendInternalMessageTimeout
(
info
->
pid
,
info
->
tid
,
WM_WINE_KEYBOARD_LL_HOOK
,
wparam
,
(
LPARAM
)
&
h_extra
,
SMTO_ABORTIFHUNG
,
get_ll_hook_timeout
(),
&
ret
);
break
;
case
WH_MOUSE_LL
:
MSG_SendInternalMessageTimeout
(
info
->
pid
,
info
->
tid
,
WM_WINE_MOUSE_LL_HOOK
,
wparam
,
lparam
,
SMTO_ABORTIFHUNG
,
get_ll_hook_timeout
(),
&
ret
);
MSG_SendInternalMessageTimeout
(
info
->
pid
,
info
->
tid
,
WM_WINE_MOUSE_LL_HOOK
,
wparam
,
(
LPARAM
)
&
h_extra
,
SMTO_ABORTIFHUNG
,
get_ll_hook_timeout
(),
&
ret
);
break
;
default:
ERR
(
"Unknown hook id %d
\n
"
,
info
->
id
);
...
...
@@ -551,6 +557,35 @@ LRESULT WINAPI CallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lpar
}
LRESULT
call_current_hook
(
HHOOK
hhook
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
struct
hook_info
info
;
ZeroMemory
(
&
info
,
sizeof
(
info
)
-
sizeof
(
info
.
module
)
);
SERVER_START_REQ
(
get_hook_info
)
{
req
->
handle
=
hhook
;
req
->
get_next
=
0
;
req
->
event
=
EVENT_MIN
;
wine_server_set_reply
(
req
,
info
.
module
,
sizeof
(
info
.
module
)
-
sizeof
(
WCHAR
)
);
if
(
!
wine_server_call_err
(
req
))
{
info
.
module
[
wine_server_reply_size
(
req
)
/
sizeof
(
WCHAR
)]
=
0
;
info
.
handle
=
reply
->
handle
;
info
.
id
=
reply
->
id
;
info
.
pid
=
reply
->
pid
;
info
.
tid
=
reply
->
tid
;
info
.
proc
=
reply
->
proc
;
info
.
next_unicode
=
reply
->
unicode
;
}
}
SERVER_END_REQ
;
info
.
prev_unicode
=
TRUE
;
/* assume Unicode for this function */
return
call_hook
(
&
info
,
code
,
wparam
,
lparam
);
}
/***********************************************************************
* CallMsgFilterA (USER32.@)
*/
...
...
dlls/user/message.c
View file @
bc55b75d
...
...
@@ -612,11 +612,19 @@ static size_t pack_message( HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
push_data
(
data
,
(
WINDOWPOS
*
)
lparam
,
sizeof
(
WINDOWPOS
)
);
return
0
;
case
WM_WINE_KEYBOARD_LL_HOOK
:
push_data
(
data
,
(
KBDLLHOOKSTRUCT
*
)
lparam
,
sizeof
(
KBDLLHOOKSTRUCT
)
);
{
struct
hook_extra_info
*
h_extra
=
(
struct
hook_extra_info
*
)
lparam
;
push_data
(
data
,
h_extra
,
sizeof
(
*
h_extra
)
);
push_data
(
data
,
(
LPVOID
)
h_extra
->
lparam
,
sizeof
(
KBDLLHOOKSTRUCT
)
);
return
0
;
}
case
WM_WINE_MOUSE_LL_HOOK
:
push_data
(
data
,
(
MSLLHOOKSTRUCT
*
)
lparam
,
sizeof
(
MSLLHOOKSTRUCT
)
);
{
struct
hook_extra_info
*
h_extra
=
(
struct
hook_extra_info
*
)
lparam
;
push_data
(
data
,
h_extra
,
sizeof
(
*
h_extra
)
);
push_data
(
data
,
(
LPVOID
)
h_extra
->
lparam
,
sizeof
(
MSLLHOOKSTRUCT
)
);
return
0
;
}
case
WM_NCPAINT
:
if
(
wparam
<=
1
)
return
0
;
FIXME
(
"WM_NCPAINT hdc packing not supported yet
\n
"
);
...
...
@@ -876,11 +884,17 @@ static BOOL unpack_message( HWND hwnd, UINT message, WPARAM *wparam, LPARAM *lpa
minsize
=
sizeof
(
DEV_BROADCAST_HDR
);
break
;
case
WM_WINE_KEYBOARD_LL_HOOK
:
minsize
=
sizeof
(
KBDLLHOOKSTRUCT
);
break
;
case
WM_WINE_MOUSE_LL_HOOK
:
minsize
=
sizeof
(
MSLLHOOKSTRUCT
);
{
struct
hook_extra_info
*
h_extra
=
(
struct
hook_extra_info
*
)
*
buffer
;
minsize
=
sizeof
(
struct
hook_extra_info
)
+
(
message
==
WM_WINE_KEYBOARD_LL_HOOK
?
sizeof
(
KBDLLHOOKSTRUCT
)
:
sizeof
(
MSLLHOOKSTRUCT
));
if
(
size
<
minsize
)
return
FALSE
;
h_extra
->
lparam
=
(
LPARAM
)(
h_extra
+
1
);
break
;
}
case
WM_NCPAINT
:
if
(
*
wparam
<=
1
)
return
TRUE
;
FIXME
(
"WM_NCPAINT hdc unpacking not supported
\n
"
);
...
...
@@ -1189,9 +1203,12 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR
if
(
hwnd
==
GetDesktopWindow
())
return
0
;
return
(
LRESULT
)
SetActiveWindow
(
(
HWND
)
wparam
);
case
WM_WINE_KEYBOARD_LL_HOOK
:
return
HOOK_CallHooks
(
WH_KEYBOARD_LL
,
HC_ACTION
,
wparam
,
lparam
,
TRUE
);
case
WM_WINE_MOUSE_LL_HOOK
:
return
HOOK_CallHooks
(
WH_MOUSE_LL
,
HC_ACTION
,
wparam
,
lparam
,
TRUE
);
{
struct
hook_extra_info
*
h_extra
=
(
struct
hook_extra_info
*
)
lparam
;
return
call_current_hook
(
h_extra
->
handle
,
HC_ACTION
,
wparam
,
h_extra
->
lparam
);
}
default:
if
(
msg
>=
WM_WINE_FIRST_DRIVER_MSG
&&
msg
<=
WM_WINE_LAST_DRIVER_MSG
)
return
USER_Driver
->
pWindowMessage
(
hwnd
,
msg
,
wparam
,
lparam
);
...
...
dlls/user/user_private.h
View file @
bc55b75d
...
...
@@ -184,6 +184,12 @@ struct user_thread_info
ULONG
pad
[
11
];
/* Available for more data */
};
struct
hook_extra_info
{
HHOOK
handle
;
LPARAM
lparam
;
};
static
inline
struct
user_thread_info
*
get_user_thread_info
(
void
)
{
return
(
struct
user_thread_info
*
)
NtCurrentTeb
()
->
Win32ClientInfo
;
...
...
@@ -202,6 +208,7 @@ extern HBRUSH SYSCOLOR_55AABrush;
extern
BOOL
CLIPBOARD_ReleaseOwner
(
void
);
extern
BOOL
FOCUS_MouseActivate
(
HWND
hwnd
);
extern
BOOL
HOOK_IsHooked
(
INT
id
);
extern
LRESULT
call_current_hook
(
HHOOK
hhook
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
);
extern
LRESULT
MSG_SendInternalMessageTimeout
(
DWORD
dest_pid
,
DWORD
dest_tid
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
UINT
flags
,
UINT
timeout
,
PDWORD_PTR
res_ptr
);
...
...
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