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
6d7828e8
Commit
6d7828e8
authored
Oct 30, 2019
by
Andrew Eikum
Committed by
Alexandre Julliard
Nov 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Support RIDI_PREPARSEDDATA in GetRawInputDeviceInfo.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0b7f4b40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
rawinput.c
dlls/user32/rawinput.c
+18
-0
Makefile.in
dlls/user32/tests/Makefile.in
+1
-1
input.c
dlls/user32/tests/input.c
+41
-0
No files found.
dlls/user32/rawinput.c
View file @
6d7828e8
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "ddk/hidsdi.h"
#include "ddk/hidsdi.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/server.h"
#include "wine/server.h"
#include "wine/hid.h"
#include "user_private.h"
#include "user_private.h"
...
@@ -467,6 +468,23 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE device, UINT command, void *data, UINT
...
@@ -467,6 +468,23 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE device, UINT command, void *data, UINT
to_copy
=
&
info
;
to_copy
=
&
info
;
break
;
break
;
case
RIDI_PREPARSEDDATA
:
avail_bytes
=
*
data_size
;
if
(
device
==
WINE_MOUSE_HANDLE
||
device
==
WINE_KEYBOARD_HANDLE
)
{
to_copy_bytes
=
0
;
*
data_size
=
0
;
to_copy
=
NULL
;
}
else
{
to_copy_bytes
=
((
WINE_HIDP_PREPARSED_DATA
*
)
hid_device
->
data
)
->
dwSize
;
*
data_size
=
to_copy_bytes
;
to_copy
=
hid_device
->
data
;
}
break
;
default:
default:
FIXME
(
"command %#x not supported
\n
"
,
command
);
FIXME
(
"command %#x not supported
\n
"
,
command
);
return
~
0U
;
return
~
0U
;
...
...
dlls/user32/tests/Makefile.in
View file @
6d7828e8
TESTDLL
=
user32.dll
TESTDLL
=
user32.dll
IMPORTS
=
user32 gdi32 advapi32
IMPORTS
=
user32 gdi32 advapi32
hid
C_SRCS
=
\
C_SRCS
=
\
broadcast.c
\
broadcast.c
\
...
...
dlls/user32/tests/input.c
View file @
6d7828e8
...
@@ -55,6 +55,7 @@
...
@@ -55,6 +55,7 @@
#include "winbase.h"
#include "winbase.h"
#include "winuser.h"
#include "winuser.h"
#include "winnls.h"
#include "winnls.h"
#include "ddk/hidsdi.h"
#include "wine/test.h"
#include "wine/test.h"
...
@@ -1605,6 +1606,7 @@ static void test_GetRawInputDeviceList(void)
...
@@ -1605,6 +1606,7 @@ static void test_GetRawInputDeviceList(void)
RAWINPUTDEVICELIST
devices
[
32
];
RAWINPUTDEVICELIST
devices
[
32
];
UINT
ret
,
oret
,
devcount
,
odevcount
,
i
;
UINT
ret
,
oret
,
devcount
,
odevcount
,
i
;
DWORD
err
;
DWORD
err
;
BOOLEAN
br
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pGetRawInputDeviceList
(
NULL
,
NULL
,
0
);
ret
=
pGetRawInputDeviceList
(
NULL
,
NULL
,
0
);
...
@@ -1642,6 +1644,7 @@ static void test_GetRawInputDeviceList(void)
...
@@ -1642,6 +1644,7 @@ static void test_GetRawInputDeviceList(void)
UINT
sz
,
len
;
UINT
sz
,
len
;
RID_DEVICE_INFO
info
;
RID_DEVICE_INFO
info
;
HANDLE
file
;
HANDLE
file
;
char
*
ppd
;
/* get required buffer size */
/* get required buffer size */
name
[
0
]
=
'\0'
;
name
[
0
]
=
'\0'
;
...
@@ -1688,6 +1691,44 @@ static void test_GetRawInputDeviceList(void)
...
@@ -1688,6 +1691,44 @@ static void test_GetRawInputDeviceList(void)
file
=
CreateFileW
(
name
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
file
=
CreateFileW
(
name
,
0
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
todo_wine_if
(
info
.
dwType
!=
RIM_TYPEHID
)
todo_wine_if
(
info
.
dwType
!=
RIM_TYPEHID
)
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Failed to open %s, error %u
\n
"
,
wine_dbgstr_w
(
name
),
GetLastError
());
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Failed to open %s, error %u
\n
"
,
wine_dbgstr_w
(
name
),
GetLastError
());
sz
=
0
;
ret
=
pGetRawInputDeviceInfoW
(
devices
[
i
].
hDevice
,
RIDI_PREPARSEDDATA
,
NULL
,
&
sz
);
ok
(
ret
==
0
,
"GetRawInputDeviceInfo gave wrong return: %u
\n
"
,
ret
);
ok
((
info
.
dwType
==
RIM_TYPEHID
&&
sz
!=
0
)
||
(
info
.
dwType
!=
RIM_TYPEHID
&&
sz
==
0
),
"Got wrong PPD size for type 0x%x: %u
\n
"
,
info
.
dwType
,
sz
);
ppd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
ret
=
pGetRawInputDeviceInfoW
(
devices
[
i
].
hDevice
,
RIDI_PREPARSEDDATA
,
ppd
,
&
sz
);
ok
(
ret
==
sz
,
"GetRawInputDeviceInfo gave wrong return: %u, should be %u
\n
"
,
ret
,
sz
);
if
(
file
!=
INVALID_HANDLE_VALUE
&&
ret
==
sz
)
{
PHIDP_PREPARSED_DATA
preparsed
;
if
(
info
.
dwType
==
RIM_TYPEHID
)
{
br
=
HidD_GetPreparsedData
(
file
,
&
preparsed
);
ok
(
br
==
TRUE
,
"HidD_GetPreparsedData failed
\n
"
);
if
(
br
)
ok
(
!
memcmp
(
preparsed
,
ppd
,
sz
),
"Expected to get same preparsed data
\n
"
);
}
else
{
/* succeeds on hardware, fails in some VMs */
br
=
HidD_GetPreparsedData
(
file
,
&
preparsed
);
todo_wine
ok
(
br
==
TRUE
||
broken
(
br
==
FALSE
),
"HidD_GetPreparsedData failed
\n
"
);
}
if
(
br
)
HidD_FreePreparsedData
(
preparsed
);
}
HeapFree
(
GetProcessHeap
(),
0
,
ppd
);
CloseHandle
(
file
);
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