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
04a9f93f
Commit
04a9f93f
authored
Aug 22, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Thread-local hooks need a module if they don't belong to the current process.
parent
1bc72fb6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
hook.c
dlls/user32/hook.c
+7
-3
hook.c
server/hook.c
+10
-0
No files found.
dlls/user32/hook.c
View file @
04a9f93f
...
...
@@ -144,7 +144,6 @@ static HHOOK set_windows_hook( INT id, HOOKPROC proc, HINSTANCE inst, DWORD tid,
return
0
;
}
/* FIXME: what if the tid belongs to another process? */
if
(
tid
)
/* thread-local hook */
{
if
(
id
==
WH_JOURNALRECORD
||
...
...
@@ -157,18 +156,23 @@ static HHOOK set_windows_hook( INT id, HOOKPROC proc, HINSTANCE inst, DWORD tid,
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
inst
=
0
;
}
else
/* system-global hook */
{
if
(
id
==
WH_KEYBOARD_LL
||
id
==
WH_MOUSE_LL
)
inst
=
0
;
else
if
(
!
inst
||
!
(
len
=
GetModuleFileNameW
(
inst
,
module
,
MAX_PATH
))
||
len
>=
MAX_PATH
)
else
if
(
!
inst
)
{
SetLastError
(
ERROR_HOOK_NEEDS_HMOD
);
return
0
;
}
}
if
(
inst
&&
(
!
(
len
=
GetModuleFileNameW
(
inst
,
module
,
MAX_PATH
))
||
len
>=
MAX_PATH
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
SERVER_START_REQ
(
set_hook
)
{
req
->
id
=
id
;
...
...
server/hook.c
View file @
04a9f93f
...
...
@@ -420,7 +420,17 @@ DECL_HANDLER(set_hook)
}
else
{
/* module is optional only if hook is in current process */
if
(
!
module_size
)
{
module
=
NULL
;
if
(
thread
->
process
!=
current
->
process
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
goto
done
;
}
}
else
if
(
!
(
module
=
memdup
(
get_req_data
(),
module_size
)))
goto
done
;
global
=
0
;
}
...
...
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