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
b7f43c99
Commit
b7f43c99
authored
Sep 14, 2015
by
Aric Stewart
Committed by
Alexandre Julliard
Sep 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Add USB Descriptor parsing.
parent
69d57ee7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
0 deletions
+41
-0
Makefile.in
dlls/hidclass.sys/Makefile.in
+1
-0
descriptor.c
dlls/hidclass.sys/descriptor.c
+0
-0
hid.h
dlls/hidclass.sys/hid.h
+3
-0
pnp.c
dlls/hidclass.sys/pnp.c
+37
-0
No files found.
dlls/hidclass.sys/Makefile.in
View file @
b7f43c99
...
...
@@ -5,6 +5,7 @@ DELAYIMPORTS = setupapi hid
C_SRCS
=
\
buffer.c
\
descriptor.c
\
device.c
\
main.c
\
pnp.c
dlls/hidclass.sys/descriptor.c
0 → 100644
View file @
b7f43c99
This diff is collapsed.
Click to expand it.
dlls/hidclass.sys/hid.h
View file @
b7f43c99
...
...
@@ -81,3 +81,6 @@ void HID_DeleteDevice(HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT *device
/* Pseudo-Plug and Play support*/
NTSTATUS
WINAPI
PNP_AddDevice
(
DRIVER_OBJECT
*
driver
,
DEVICE_OBJECT
*
PDO
)
DECLSPEC_HIDDEN
;
void
PNP_CleanupPNP
(
DRIVER_OBJECT
*
driver
)
DECLSPEC_HIDDEN
;
/* Parsing HID Report Descriptors into preparsed data */
WINE_HIDP_PREPARSED_DATA
*
ParseDescriptor
(
BYTE
*
descriptor
,
unsigned
int
length
)
DECLSPEC_HIDDEN
;
dlls/hidclass.sys/pnp.c
View file @
b7f43c99
...
...
@@ -53,6 +53,9 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
DWORD
index
=
HID_STRING_ID_ISERIALNUMBER
;
NATIVE_DEVICE
*
tracked_device
,
*
ptr
;
INT
interface_index
=
1
;
HID_DESCRIPTOR
descriptor
;
BYTE
*
reportDescriptor
;
INT
i
;
static
const
WCHAR
ig_fmtW
[]
=
{
'I'
,
'G'
,
'_'
,
'%'
,
'i'
,
0
};
static
const
WCHAR
im_fmtW
[]
=
{
'I'
,
'M'
,
'_'
,
'%'
,
'i'
,
0
};
...
...
@@ -104,6 +107,40 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
list_add_tail
(
&
tracked_devices
,
&
tracked_device
->
entry
);
status
=
call_minidriver
(
IOCTL_HID_GET_DEVICE_DESCRIPTOR
,
device
,
NULL
,
0
,
&
descriptor
,
sizeof
(
descriptor
));
if
(
status
!=
STATUS_SUCCESS
)
{
ERR
(
"Cannot get Device Descriptor(%x)
\n
"
,
status
);
HID_DeleteDevice
(
&
minidriver
->
minidriver
,
device
);
return
status
;
}
for
(
i
=
0
;
i
<
descriptor
.
bNumDescriptors
;
i
++
)
if
(
descriptor
.
DescriptorList
[
i
].
bReportType
==
HID_REPORT_DESCRIPTOR_TYPE
)
break
;
if
(
i
>=
descriptor
.
bNumDescriptors
)
{
ERR
(
"No Report Descriptor found in reply
\n
"
);
HID_DeleteDevice
(
&
minidriver
->
minidriver
,
device
);
return
status
;
}
reportDescriptor
=
HeapAlloc
(
GetProcessHeap
(),
0
,
descriptor
.
DescriptorList
[
i
].
wReportLength
);
status
=
call_minidriver
(
IOCTL_HID_GET_REPORT_DESCRIPTOR
,
device
,
NULL
,
0
,
reportDescriptor
,
descriptor
.
DescriptorList
[
i
].
wReportLength
);
if
(
status
!=
STATUS_SUCCESS
)
{
ERR
(
"Cannot get Report Descriptor(%x)
\n
"
,
status
);
HID_DeleteDevice
(
&
minidriver
->
minidriver
,
device
);
HeapFree
(
GetProcessHeap
(),
0
,
reportDescriptor
);
return
status
;
}
ext
->
preparseData
=
ParseDescriptor
(
reportDescriptor
,
descriptor
.
DescriptorList
[
0
].
wReportLength
);
ext
->
information
.
DescriptorSize
=
ext
->
preparseData
->
dwSize
;
HeapFree
(
GetProcessHeap
(),
0
,
reportDescriptor
);
serial
[
0
]
=
0
;
status
=
call_minidriver
(
IOCTL_HID_GET_STRING
,
device
,
&
index
,
sizeof
(
DWORD
),
serial
,
sizeof
(
serial
));
...
...
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