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
d5cfbf5d
Commit
d5cfbf5d
authored
Jan 20, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Test that WH_KEYBOARD_LL are blocking SendInput.
parent
ee74d202
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
input.c
dlls/user32/tests/input.c
+39
-0
No files found.
dlls/user32/tests/input.c
View file @
d5cfbf5d
...
...
@@ -5178,6 +5178,43 @@ static void test_ClipCursor( char **argv )
if
(
!
EqualRect
(
&
rect
,
&
virtual_rect
))
ok_ret
(
1
,
ClipCursor
(
NULL
)
);
}
static
HANDLE
ll_keyboard_event
;
static
LRESULT
CALLBACK
ll_keyboard_event_wait
(
int
code
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
code
==
HC_ACTION
)
{
ok_ret
(
WAIT_TIMEOUT
,
WaitForSingleObject
(
ll_keyboard_event
,
100
)
);
return
-
123
;
}
return
CallNextHookEx
(
0
,
code
,
wparam
,
lparam
);
}
static
void
test_keyboard_ll_hook_blocking
(
void
)
{
INPUT
input
=
{.
type
=
INPUT_KEYBOARD
,
.
ki
=
{.
wVk
=
VK_RETURN
}};
HHOOK
hook
;
HWND
hwnd
;
hwnd
=
CreateWindowW
(
L"static"
,
NULL
,
WS_POPUP
|
WS_VISIBLE
,
0
,
0
,
100
,
100
,
NULL
,
NULL
,
NULL
,
NULL
);
ok_ne
(
NULL
,
hwnd
,
HWND
,
"%p"
);
wait_messages
(
100
,
FALSE
);
hook
=
SetWindowsHookExW
(
WH_KEYBOARD_LL
,
ll_keyboard_event_wait
,
GetModuleHandleW
(
NULL
),
0
);
ok_ne
(
NULL
,
hook
,
HHOOK
,
"%p"
);
ll_keyboard_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok_ne
(
NULL
,
ll_keyboard_event
,
HANDLE
,
"%p"
);
ok_ret
(
1
,
SendInput
(
1
,
&
input
,
sizeof
(
input
)
)
);
input
.
ki
.
dwFlags
=
KEYEVENTF_KEYUP
;
ok_ret
(
1
,
SendInput
(
1
,
&
input
,
sizeof
(
input
)
)
);
ok_ret
(
1
,
SetEvent
(
ll_keyboard_event
)
);
ok_ret
(
1
,
CloseHandle
(
ll_keyboard_event
)
);
ok_ret
(
1
,
UnhookWindowsHookEx
(
hook
)
);
ok_ret
(
1
,
DestroyWindow
(
hwnd
)
);
}
/* run the tests in a separate desktop to avoid interaction with other
* tests, current desktop state, or user actions. */
static
void
test_input_desktop
(
char
**
argv
)
...
...
@@ -5194,6 +5231,8 @@ static void test_input_desktop( char **argv )
test_SendInput
(
'F'
,
wch
);
test_SendInput_keyboard_messages
(
'F'
,
scan
,
wch
,
wch_shift
,
'\x06'
);
test_keyboard_ll_hook_blocking
();
ok_ret
(
1
,
SetCursorPos
(
pos
.
x
,
pos
.
y
)
);
}
...
...
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