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
303717f4
Commit
303717f4
authored
Jan 28, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Test rawinput with the virtual HID touchscreen.
parent
e3c61ba7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
device8.c
dlls/dinput/tests/device8.c
+75
-0
No files found.
dlls/dinput/tests/device8.c
View file @
303717f4
...
...
@@ -1909,7 +1909,11 @@ static void test_hid_touch_screen(void)
.
todo
=
TRUE
,
};
RAWINPUTDEVICE
rawdevice
=
{.
usUsagePage
=
HID_USAGE_PAGE_DIGITIZER
,
.
usUsage
=
HID_USAGE_DIGITIZER_TOUCH_SCREEN
};
UINT
rawbuffer_count
,
rawbuffer_size
;
WCHAR
device_path
[
MAX_PATH
];
char
rawbuffer
[
1024
];
RAWINPUT
*
rawinput
;
HANDLE
file
;
DWORD
res
;
HWND
hwnd
;
...
...
@@ -1987,6 +1991,77 @@ static void test_hid_touch_screen(void)
ok
(
pointer_up_count
==
1
,
"got pointer_up_count %u
\n
"
,
pointer_up_count
);
/* test that we receive HID rawinput type with the touchscreen */
rawdevice
.
dwFlags
=
RIDEV_INPUTSINK
;
rawdevice
.
hwndTarget
=
hwnd
;
ret
=
RegisterRawInputDevices
(
&
rawdevice
,
1
,
sizeof
(
RAWINPUTDEVICE
)
);
ok
(
ret
,
"RegisterRawInputDevices failed, error %lu
\n
"
,
GetLastError
()
);
bus_send_hid_input
(
file
,
&
desc
,
&
touch_multiple
,
sizeof
(
touch_multiple
)
);
bus_wait_hid_input
(
file
,
&
desc
,
5000
);
bus_send_hid_input
(
file
,
&
desc
,
&
touch_release
,
sizeof
(
touch_release
)
);
bus_wait_hid_input
(
file
,
&
desc
,
5000
);
res
=
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
500
,
QS_POINTER
);
todo_wine
ok
(
!
res
,
"MsgWaitForMultipleObjects returned %#lx
\n
"
,
res
);
memset
(
rawbuffer
,
0
,
sizeof
(
rawbuffer
)
);
rawinput
=
(
RAWINPUT
*
)
rawbuffer
;
rawbuffer_size
=
sizeof
(
rawbuffer
);
rawbuffer_count
=
GetRawInputBuffer
(
rawinput
,
&
rawbuffer_size
,
sizeof
(
RAWINPUTHEADER
)
);
ok
(
rawbuffer_count
==
2
,
"got rawbuffer_count %u
\n
"
,
rawbuffer_count
);
ok
(
rawbuffer_size
==
sizeof
(
rawbuffer
),
"got rawbuffer_size %u
\n
"
,
rawbuffer_size
);
rawinput
=
(
RAWINPUT
*
)
rawbuffer
;
ok
(
rawinput
->
header
.
dwType
==
RIM_TYPEHID
,
"got dwType %lu
\n
"
,
rawinput
->
header
.
dwType
);
ok
(
rawinput
->
header
.
dwSize
==
offsetof
(
RAWINPUT
,
data
.
hid
.
bRawData
[
desc
.
caps
.
InputReportByteLength
*
rawinput
->
data
.
hid
.
dwCount
]),
"got header.dwSize %lu
\n
"
,
rawinput
->
header
.
dwSize
);
ok
(
rawinput
->
header
.
hDevice
!=
0
,
"got hDevice %p
\n
"
,
rawinput
->
header
.
hDevice
);
ok
(
rawinput
->
header
.
wParam
==
0
,
"got wParam %#Ix
\n
"
,
rawinput
->
header
.
wParam
);
ok
(
rawinput
->
data
.
hid
.
dwSizeHid
==
desc
.
caps
.
InputReportByteLength
,
"got dwSizeHid %lu
\n
"
,
rawinput
->
data
.
hid
.
dwSizeHid
);
ok
(
rawinput
->
data
.
hid
.
dwCount
==
1
,
"got dwCount %lu
\n
"
,
rawinput
->
data
.
hid
.
dwCount
);
ok
(
!
memcmp
(
rawinput
->
data
.
hid
.
bRawData
,
touch_multiple
.
report_buf
,
desc
.
caps
.
InputReportByteLength
),
"got unexpected report data
\n
"
);
rawdevice
.
dwFlags
=
RIDEV_REMOVE
;
rawdevice
.
hwndTarget
=
0
;
ret
=
RegisterRawInputDevices
(
&
rawdevice
,
1
,
sizeof
(
RAWINPUTDEVICE
)
);
ok
(
ret
,
"RegisterRawInputDevices failed, error %lu
\n
"
,
GetLastError
()
);
/* test that we don't receive mouse rawinput type with the touchscreen */
memset
(
rawbuffer
,
0
,
sizeof
(
rawbuffer
)
);
rawdevice
.
usUsagePage
=
HID_USAGE_PAGE_GENERIC
;
rawdevice
.
usUsage
=
HID_USAGE_GENERIC_MOUSE
;
rawdevice
.
dwFlags
=
RIDEV_INPUTSINK
;
rawdevice
.
hwndTarget
=
hwnd
;
ret
=
RegisterRawInputDevices
(
&
rawdevice
,
1
,
sizeof
(
RAWINPUTDEVICE
)
);
ok
(
ret
,
"RegisterRawInputDevices failed, error %lu
\n
"
,
GetLastError
()
);
bus_send_hid_input
(
file
,
&
desc
,
&
touch_multiple
,
sizeof
(
touch_multiple
)
);
res
=
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
500
,
QS_POINTER
);
todo_wine
ok
(
!
res
,
"MsgWaitForMultipleObjects returned %#lx
\n
"
,
res
);
bus_send_hid_input
(
file
,
&
desc
,
&
touch_release
,
sizeof
(
touch_release
)
);
res
=
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
500
,
QS_POINTER
);
todo_wine
ok
(
!
res
,
"MsgWaitForMultipleObjects returned %#lx
\n
"
,
res
);
rawinput
=
(
RAWINPUT
*
)
rawbuffer
;
rawbuffer_size
=
sizeof
(
rawbuffer
);
rawbuffer_count
=
GetRawInputBuffer
(
rawinput
,
&
rawbuffer_size
,
sizeof
(
RAWINPUTHEADER
)
);
ok
(
rawbuffer_count
==
0
,
"got rawbuffer_count %u
\n
"
,
rawbuffer_count
);
ok
(
rawbuffer_size
==
0
,
"got rawbuffer_size %u
\n
"
,
rawbuffer_size
);
rawdevice
.
dwFlags
=
RIDEV_REMOVE
;
rawdevice
.
hwndTarget
=
0
;
ret
=
RegisterRawInputDevices
(
&
rawdevice
,
1
,
sizeof
(
RAWINPUTDEVICE
)
);
ok
(
ret
,
"RegisterRawInputDevices failed, error %lu
\n
"
,
GetLastError
()
);
DestroyWindow
(
hwnd
);
CloseHandle
(
file
);
...
...
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