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
2c8b60af
Commit
2c8b60af
authored
Jan 18, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Return result through NtCallbackReturn for the window hook callback.
parent
3f9de129
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
15 deletions
+32
-15
hook.c
dlls/user32/hook.c
+12
-2
user_private.h
dlls/user32/user_private.h
+1
-1
hook.c
dlls/win32u/hook.c
+8
-3
user.c
dlls/wow64win/user.c
+11
-9
No files found.
dlls/user32/hook.c
View file @
2c8b60af
...
...
@@ -62,6 +62,8 @@
* WH_MOUSE_LL Implemented but should use SendMessage instead
*/
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "user_private.h"
#include "wine/asm.h"
#include "wine/debug.h"
...
...
@@ -452,8 +454,9 @@ BOOL WINAPI User32CallWinEventHook( const struct win_event_hook_params *params,
return
TRUE
;
}
BOOL
WINAPI
User32CallWindowsHook
(
struct
win_hook_params
*
param
s
,
ULONG
size
)
NTSTATUS
WINAPI
User32CallWindowsHook
(
void
*
arg
s
,
ULONG
size
)
{
struct
win_hook_params
*
params
=
args
;
HOOKPROC
proc
=
params
->
proc
;
HMODULE
free_module
=
0
;
void
*
ret_ptr
=
NULL
;
...
...
@@ -514,7 +517,14 @@ BOOL WINAPI User32CallWindowsHook( struct win_hook_params *params, ULONG size )
params
->
prev_unicode
,
params
->
next_unicode
);
if
(
free_module
)
FreeLibrary
(
free_module
);
return
NtCallbackReturn
(
ret_ptr
,
ret_size
,
ret
);
if
(
ret_size
)
{
LRESULT
*
result_ptr
=
(
LRESULT
*
)
ret_ptr
-
1
;
*
result_ptr
=
ret
;
return
NtCallbackReturn
(
result_ptr
,
sizeof
(
*
result_ptr
)
+
ret_size
,
STATUS_SUCCESS
);
}
return
NtCallbackReturn
(
&
ret
,
sizeof
(
ret
),
STATUS_SUCCESS
);
}
/***********************************************************************
...
...
dlls/user32/user_private.h
View file @
2c8b60af
...
...
@@ -85,7 +85,7 @@ NTSTATUS WINAPI User32CallEnumDisplayMonitor( void *args, ULONG size );
BOOL
WINAPI
User32CallSendAsyncCallback
(
const
struct
send_async_params
*
params
,
ULONG
size
);
BOOL
WINAPI
User32CallWinEventHook
(
const
struct
win_event_hook_params
*
params
,
ULONG
size
);
BOOL
WINAPI
User32CallWindowProc
(
struct
win_proc_params
*
params
,
ULONG
size
);
BOOL
WINAPI
User32CallWindowsHook
(
struct
win_hook_params
*
param
s
,
ULONG
size
);
NTSTATUS
WINAPI
User32CallWindowsHook
(
void
*
arg
s
,
ULONG
size
);
BOOL
WINAPI
User32InitBuiltinClasses
(
const
struct
win_hook_params
*
params
,
ULONG
size
);
/* message spy definitions */
...
...
dlls/win32u/hook.c
View file @
2c8b60af
...
...
@@ -330,9 +330,14 @@ static LRESULT call_hook( struct win_hook_params *info, const WCHAR *module, siz
thread_info
->
hook
=
params
->
handle
;
thread_info
->
hook_unicode
=
params
->
next_unicode
;
thread_info
->
hook_call_depth
++
;
ret
=
KeUserModeCallback
(
NtUserCallWindowsHook
,
params
,
size
,
&
ret_ptr
,
&
ret_len
);
if
(
ret_len
&&
ret_len
==
lparam_ret_size
)
memcpy
(
(
void
*
)
params
->
lparam
,
ret_ptr
,
ret_len
);
if
(
!
KeUserModeCallback
(
NtUserCallWindowsHook
,
params
,
size
,
&
ret_ptr
,
&
ret_len
)
&&
ret_len
>=
sizeof
(
ret
))
{
LRESULT
*
result_ptr
=
ret_ptr
;
ret
=
*
result_ptr
;
if
(
ret_len
==
sizeof
(
ret
)
+
lparam_ret_size
)
memcpy
(
(
void
*
)
params
->
lparam
,
result_ptr
+
1
,
ret_len
-
sizeof
(
ret
)
);
}
thread_info
->
hook
=
prev
;
thread_info
->
hook_unicode
=
prev_unicode
;
thread_info
->
hook_call_depth
--
;
...
...
dlls/wow64win/user.c
View file @
2c8b60af
...
...
@@ -1113,8 +1113,9 @@ static NTSTATUS WINAPI wow64_NtUserCallWindowsHook( void *arg, ULONG size )
struct
win_hook_params32
params32
;
UINT
module_len
,
size32
,
offset
;
void
*
ret_ptr
;
ULONG
ret_len
;
NTSTATUS
ret
;
LRESULT
*
result_ptr
=
arg
;
ULONG
ret_len
,
ret_size
=
0
;
NTSTATUS
status
;
module_len
=
wcslen
(
params
->
module
);
size32
=
FIELD_OFFSET
(
struct
win_hook_params32
,
module
[
module_len
+
1
]
);
...
...
@@ -1142,22 +1143,23 @@ static NTSTATUS WINAPI wow64_NtUserCallWindowsHook( void *arg, ULONG size )
size
-
offset
,
(
char
*
)
arg
+
size32
);
}
ret
=
Wow64KiUserCallbackDispatcher
(
NtUserCallWindowsHook
,
arg
,
size32
,
&
ret_ptr
,
&
ret_len
);
status
=
Wow64KiUserCallbackDispatcher
(
NtUserCallWindowsHook
,
arg
,
size32
,
&
ret_ptr
,
&
ret_len
);
if
(
status
||
ret_len
<
sizeof
(
LONG
))
return
status
;
switch
(
params32
.
id
)
{
case
WH_SYSMSGFILTER
:
case
WH_MSGFILTER
:
case
WH_GETMESSAGE
:
if
(
ret_len
==
sizeof
(
MSG32
))
if
(
ret_len
==
sizeof
(
MSG32
)
+
sizeof
(
LONG
)
)
{
MSG
msg
;
msg_32to64
(
&
msg
,
ret_ptr
);
return
NtCallbackReturn
(
&
msg
,
sizeof
(
msg
),
ret
);
msg_32to64
(
(
MSG
*
)(
result_ptr
+
1
),
(
MSG32
*
)((
LONG
*
)
ret_ptr
+
1
)
);
ret_size
=
sizeof
(
MSG
);
}
break
;
}
return
ret
;
*
result_ptr
=
*
(
LONG
*
)
ret_ptr
;
return
NtCallbackReturn
(
result_ptr
,
sizeof
(
*
result_ptr
)
+
ret_size
,
status
)
;
}
static
NTSTATUS
WINAPI
wow64_NtUserCopyImage
(
void
*
arg
,
ULONG
size
)
...
...
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