Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6af8b704
Commit
6af8b704
authored
Oct 30, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Enable a few more hook tests.
parent
afb16d3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
23 deletions
+12
-23
msg.c
dlls/user32/tests/msg.c
+12
-23
No files found.
dlls/user32/tests/msg.c
View file @
6af8b704
...
@@ -12233,27 +12233,25 @@ static void test_set_hook(void)
...
@@ -12233,27 +12233,25 @@ static void test_set_hook(void)
ok
(
hhook
!=
0
,
"local hook does not require hModule set to 0
\n
"
);
ok
(
hhook
!=
0
,
"local hook does not require hModule set to 0
\n
"
);
UnhookWindowsHookEx
(
hhook
);
UnhookWindowsHookEx
(
hhook
);
if
(
0
)
{
/* this test doesn't pass under Win9x: BUG! */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hhook
=
SetWindowsHookExA
(
WH_CBT
,
cbt_hook_proc
,
0
,
0
);
hhook
=
SetWindowsHookExA
(
WH_CBT
,
cbt_hook_proc
,
0
,
0
);
ok
(
!
hhook
,
"global hook requires hModule != 0
\n
"
);
ok
(
!
hhook
,
"global hook requires hModule != 0
\n
"
);
ok
(
GetLastError
()
==
ERROR_HOOK_NEEDS_HMOD
,
"unexpected error %ld
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_HOOK_NEEDS_HMOD
,
"unexpected error %ld
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
hhook
=
SetWindowsHookExA
(
WH_JOURNALRECORD
,
cbt_hook_proc
,
0
,
0
);
ok
(
!
hhook
,
"global hook requires hModule != 0
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"unexpected error %ld
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hhook
=
SetWindowsHookExA
(
WH_CBT
,
0
,
GetModuleHandleA
(
0
),
GetCurrentThreadId
());
hhook
=
SetWindowsHookExA
(
WH_CBT
,
0
,
GetModuleHandleA
(
0
),
GetCurrentThreadId
());
ok
(
!
hhook
,
"SetWinEventHook with invalid proc should fail
\n
"
);
ok
(
!
hhook
,
"SetWinEventHook with invalid proc should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_FILTER_PROC
||
/* Win2k */
ok
(
GetLastError
()
==
ERROR_INVALID_FILTER_PROC
,
"unexpected error %ld
\n
"
,
GetLastError
());
GetLastError
()
==
0xdeadbeef
,
/* Win9x */
"unexpected error %ld
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ok
(
!
UnhookWindowsHookEx
((
HHOOK
)
0xdeadbeef
),
"UnhookWindowsHookEx succeeded
\n
"
);
ok
(
!
UnhookWindowsHookEx
((
HHOOK
)
0xdeadbeef
),
"UnhookWindowsHookEx succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HOOK_HANDLE
||
/* Win2k */
ok
(
GetLastError
()
==
ERROR_INVALID_HOOK_HANDLE
,
"unexpected error %ld
\n
"
,
GetLastError
());
GetLastError
()
==
0xdeadbeef
,
/* Win9x */
"unexpected error %ld
\n
"
,
GetLastError
());
if
(
!
pSetWinEventHook
||
!
pUnhookWinEvent
)
return
;
if
(
!
pSetWinEventHook
||
!
pUnhookWinEvent
)
return
;
...
@@ -12262,22 +12260,15 @@ static void test_set_hook(void)
...
@@ -12262,22 +12260,15 @@ static void test_set_hook(void)
hwinevent_hook
=
pSetWinEventHook
(
EVENT_MIN
,
EVENT_MAX
,
0
,
win_event_proc
,
hwinevent_hook
=
pSetWinEventHook
(
EVENT_MIN
,
EVENT_MAX
,
0
,
win_event_proc
,
GetCurrentProcessId
(),
0
,
WINEVENT_INCONTEXT
);
GetCurrentProcessId
(),
0
,
WINEVENT_INCONTEXT
);
ok
(
!
hwinevent_hook
,
"WINEVENT_INCONTEXT requires hModule != 0
\n
"
);
ok
(
!
hwinevent_hook
,
"WINEVENT_INCONTEXT requires hModule != 0
\n
"
);
ok
(
GetLastError
()
==
ERROR_HOOK_NEEDS_HMOD
||
/* Win2k */
ok
(
GetLastError
()
==
ERROR_HOOK_NEEDS_HMOD
,
"unexpected error %ld
\n
"
,
GetLastError
());
GetLastError
()
==
0xdeadbeef
,
/* Win9x */
"unexpected error %ld
\n
"
,
GetLastError
());
/* even thread local incontext hooks require hmodule */
/* even thread local incontext hooks require hmodule */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hwinevent_hook
=
pSetWinEventHook
(
EVENT_MIN
,
EVENT_MAX
,
0
,
win_event_proc
,
hwinevent_hook
=
pSetWinEventHook
(
EVENT_MIN
,
EVENT_MAX
,
0
,
win_event_proc
,
GetCurrentProcessId
(),
GetCurrentThreadId
(),
WINEVENT_INCONTEXT
);
GetCurrentProcessId
(),
GetCurrentThreadId
(),
WINEVENT_INCONTEXT
);
ok
(
!
hwinevent_hook
,
"WINEVENT_INCONTEXT requires hModule != 0
\n
"
);
ok
(
!
hwinevent_hook
,
"WINEVENT_INCONTEXT requires hModule != 0
\n
"
);
ok
(
GetLastError
()
==
ERROR_HOOK_NEEDS_HMOD
||
/* Win2k */
ok
(
GetLastError
()
==
ERROR_HOOK_NEEDS_HMOD
,
"unexpected error %ld
\n
"
,
GetLastError
());
GetLastError
()
==
0xdeadbeef
,
/* Win9x */
"unexpected error %ld
\n
"
,
GetLastError
());
if
(
0
)
{
/* these 3 tests don't pass under Win9x */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hwinevent_hook
=
pSetWinEventHook
(
1
,
0
,
0
,
win_event_proc
,
hwinevent_hook
=
pSetWinEventHook
(
1
,
0
,
0
,
win_event_proc
,
GetCurrentProcessId
(),
0
,
WINEVENT_OUTOFCONTEXT
);
GetCurrentProcessId
(),
0
,
WINEVENT_OUTOFCONTEXT
);
...
@@ -12294,8 +12285,8 @@ static void test_set_hook(void)
...
@@ -12294,8 +12285,8 @@ static void test_set_hook(void)
hwinevent_hook
=
pSetWinEventHook
(
EVENT_MIN
,
EVENT_MAX
,
0
,
win_event_proc
,
hwinevent_hook
=
pSetWinEventHook
(
EVENT_MIN
,
EVENT_MAX
,
0
,
win_event_proc
,
0
,
0xdeadbeef
,
WINEVENT_OUTOFCONTEXT
);
0
,
0xdeadbeef
,
WINEVENT_OUTOFCONTEXT
);
ok
(
!
hwinevent_hook
,
"SetWinEventHook with invalid tid should fail
\n
"
);
ok
(
!
hwinevent_hook
,
"SetWinEventHook with invalid tid should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_THREAD_ID
,
"unexpected error %ld
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_INVALID_THREAD_ID
,
"unexpected error %ld
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
hwinevent_hook
=
pSetWinEventHook
(
0
,
0
,
0
,
win_event_proc
,
hwinevent_hook
=
pSetWinEventHook
(
0
,
0
,
0
,
win_event_proc
,
...
@@ -12319,9 +12310,7 @@ todo_wine {
...
@@ -12319,9 +12310,7 @@ todo_wine {
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ok
(
!
pUnhookWinEvent
((
HWINEVENTHOOK
)
0xdeadbeef
),
"UnhookWinEvent succeeded
\n
"
);
ok
(
!
pUnhookWinEvent
((
HWINEVENTHOOK
)
0xdeadbeef
),
"UnhookWinEvent succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
||
/* Win2k */
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"unexpected error %ld
\n
"
,
GetLastError
());
GetLastError
()
==
0xdeadbeef
,
/* Win9x */
"unexpected error %ld
\n
"
,
GetLastError
());
}
}
static
HWND
hook_hwnd
;
static
HWND
hook_hwnd
;
...
...
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