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
5075c31e
Commit
5075c31e
authored
Dec 12, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Call init_window_call_params after WH_CALLWNDPROC hook in call_window_proc.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53908
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52779
parent
650b9b01
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
12 deletions
+43
-12
msg.c
dlls/user32/tests/msg.c
+33
-0
message.c
dlls/win32u/message.c
+10
-12
No files found.
dlls/user32/tests/msg.c
View file @
5075c31e
...
...
@@ -19417,6 +19417,38 @@ static void test_create_name(void)
UnregisterClassW
(
L"TestCreateNameClassW"
,
NULL
);
}
static
LRESULT
WINAPI
changed_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
msg
==
WM_USER
)
return
3
;
return
DefWindowProcW
(
hwnd
,
msg
,
wparam
,
lparam
);
}
static
LRESULT
WINAPI
call_window_proc_hook
(
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
CWPSTRUCT
*
cwp
=
(
CWPSTRUCT
*
)
lparam
;
ok
(
cwp
->
message
==
WM_USER
,
"message = %u
\n
"
,
cwp
->
message
);
SetWindowLongPtrW
(
cwp
->
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
changed_window_proc
);
return
CallNextHookEx
(
NULL
,
code
,
wparam
,
lparam
);
}
static
void
test_hook_changing_window_proc
(
void
)
{
HWND
hwnd
;
HHOOK
hook
;
LRESULT
res
;
hwnd
=
CreateWindowExW
(
0
,
L"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
0
,
0
,
GetDesktopWindow
(),
0
,
0
,
NULL
);
hook
=
SetWindowsHookExW
(
WH_CALLWNDPROC
,
call_window_proc_hook
,
NULL
,
GetCurrentThreadId
()
);
ok
(
hook
!=
NULL
,
"SetWindowsHookExW failed: %lu
\n
"
,
GetLastError
()
);
res
=
SendMessageW
(
hwnd
,
WM_USER
,
1
,
2
);
ok
(
res
==
3
,
"SendMessageW(WM_USER) returned %Iu
\n
"
,
res
);
UnhookWindowsHookEx
(
hook
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
msg
)
{
char
**
test_argv
;
...
...
@@ -19534,6 +19566,7 @@ START_TEST(msg)
test_TrackPopupMenuEmpty
();
test_DoubleSetCapture
();
test_create_name
();
test_hook_changing_window_proc
();
/* keep it the last test, under Windows it tends to break the tests
* which rely on active/foreground windows being correct.
*/
...
...
dlls/win32u/message.c
View file @
5075c31e
...
...
@@ -1346,6 +1346,14 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
if
(
!
needs_unpack
)
size
=
0
;
if
(
!
is_current_thread_window
(
hwnd
))
return
0
;
/* first the WH_CALLWNDPROC hook */
cwp
.
lParam
=
lparam
;
cwp
.
wParam
=
wparam
;
cwp
.
message
=
msg
;
cwp
.
hwnd
=
hwnd
=
get_full_window_handle
(
hwnd
);
call_hooks
(
WH_CALLWNDPROC
,
HC_ACTION
,
same_thread
,
(
LPARAM
)
&
cwp
,
sizeof
(
cwp
)
);
if
(
size
&&
!
(
params
=
malloc
(
sizeof
(
*
params
)
+
size
)))
return
0
;
if
(
!
init_window_call_params
(
params
,
hwnd
,
msg
,
wparam
,
lparam
,
&
result
,
!
unicode
,
mapping
))
{
...
...
@@ -1359,25 +1367,15 @@ static LRESULT call_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
params
->
ansi
=
FALSE
;
if
(
size
)
memcpy
(
params
+
1
,
buffer
,
size
);
}
/* first the WH_CALLWNDPROC hook */
cwp
.
lParam
=
lparam
;
cwp
.
wParam
=
wparam
;
cwp
.
message
=
msg
;
cwp
.
hwnd
=
params
->
hwnd
;
call_hooks
(
WH_CALLWNDPROC
,
HC_ACTION
,
same_thread
,
(
LPARAM
)
&
cwp
,
sizeof
(
cwp
)
);
dispatch_win_proc_params
(
params
,
sizeof
(
*
params
)
+
size
);
if
(
params
!=
&
p
)
free
(
params
);
/* and finally the WH_CALLWNDPROCRET hook */
cwpret
.
lResult
=
result
;
cwpret
.
lParam
=
lparam
;
cwpret
.
wParam
=
wparam
;
cwpret
.
message
=
msg
;
cwpret
.
hwnd
=
params
->
hwnd
;
if
(
params
!=
&
p
)
free
(
params
);
cwpret
.
hwnd
=
hwnd
;
call_hooks
(
WH_CALLWNDPROCRET
,
HC_ACTION
,
same_thread
,
(
LPARAM
)
&
cwpret
,
sizeof
(
cwpret
)
);
return
result
;
}
...
...
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