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
05642573
Commit
05642573
authored
Apr 05, 2016
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hidclass.sys: Use the instance id for the device link.
Signed-off-by:
Aric Stewart
<
aric@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4b5bed45
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
16 deletions
+9
-16
device.c
dlls/hidclass.sys/device.c
+7
-14
hid.h
dlls/hidclass.sys/hid.h
+1
-1
pnp.c
dlls/hidclass.sys/pnp.c
+1
-1
No files found.
dlls/hidclass.sys/device.c
View file @
05642573
...
...
@@ -40,12 +40,7 @@ WINE_DECLARE_DEBUG_CHANNEL(hid_report);
static
const
WCHAR
device_name_fmtW
[]
=
{
'\\'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'\\'
,
'H'
,
'I'
,
'D'
,
'#'
,
'%'
,
'p'
,
'&'
,
'%'
,
'p'
,
0
};
static
const
WCHAR
device_regname_fmtW
[]
=
{
'H'
,
'I'
,
'D'
,
'\\'
,
'v'
,
'i'
,
'd'
,
'_'
,
'%'
,
'0'
,
'4'
,
'x'
,
'&'
,
'p'
,
'i'
,
'd'
,
'_'
,
'%'
,
'0'
,
'4'
,
'x'
,
'&'
,
'%'
,
's'
,
'\\'
,
'%'
,
'i'
,
'&'
,
'%'
,
's'
,
0
};
static
const
WCHAR
device_link_fmtW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'h'
,
'i'
,
'd'
,
'#'
,
'v'
,
'i'
,
'd'
,
'_'
,
'%'
,
'0'
,
'4'
,
'x'
,
'&'
,
'p'
,
'i'
,
'd'
,
'_'
,
'%'
,
'0'
,
'4'
,
'x'
,
'&'
,
'%'
,
's'
,
'#'
,
'%'
,
'i'
,
'&'
,
'%'
,
's'
,
'#'
,
'%'
,
's'
,
0
};
static
const
WCHAR
device_link_fmtW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'%'
,
's'
,
'#'
,
'%'
,
's'
,
0
};
/* GUID_DEVINTERFACE_HID */
static
const
WCHAR
class_guid
[]
=
{
'{'
,
'4'
,
'D'
,
'1'
,
'E'
,
'5'
,
'5'
,
'B'
,
'2'
,
'-'
,
'F'
,
'1'
,
'6'
,
'F'
,
'-'
,
'1'
,
'1'
,
'C'
,
'F'
,
'-'
,
'8'
,
'8'
,
'C'
,
'B'
,
'-'
,
'0'
,
'0'
,
...
...
@@ -83,10 +78,10 @@ NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRAT
return
S_OK
;
}
NTSTATUS
HID_LinkDevice
(
DEVICE_OBJECT
*
device
,
LPCWSTR
serial
,
LPCWSTR
index
)
NTSTATUS
HID_LinkDevice
(
DEVICE_OBJECT
*
device
)
{
WCHAR
regname
[
255
];
WCHAR
dev_link
[
255
];
WCHAR
*
ptr
;
SP_DEVINFO_DATA
Data
;
UNICODE_STRING
nameW
,
linkW
;
NTSTATUS
status
;
...
...
@@ -97,9 +92,9 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device, LPCWSTR serial, LPCWSTR index)
HidD_GetHidGuid
(
&
hidGuid
);
ext
=
device
->
DeviceExtension
;
sprintfW
(
dev_link
,
device_link_fmtW
,
ext
->
in
formation
.
VendorID
,
ext
->
information
.
ProductID
,
index
,
ext
->
information
.
VersionNumber
,
serial
,
class_guid
);
sprintfW
(
dev_link
,
device_link_fmtW
,
ext
->
in
stance_id
,
class_guid
);
ptr
=
dev_link
+
4
;
do
{
if
(
*
ptr
==
'\\'
)
*
ptr
=
'#'
;
}
while
(
*
ptr
++
);
struprW
(
dev_link
);
RtlInitUnicodeString
(
&
nameW
,
ext
->
device_name
);
...
...
@@ -117,8 +112,6 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device, LPCWSTR serial, LPCWSTR index)
return
status
;
}
sprintfW
(
regname
,
device_regname_fmtW
,
ext
->
information
.
VendorID
,
ext
->
information
.
ProductID
,
index
,
ext
->
information
.
VersionNumber
,
serial
);
devinfo
=
SetupDiGetClassDevsW
(
&
GUID_DEVCLASS_HIDCLASS
,
NULL
,
NULL
,
DIGCF_DEVICEINTERFACE
);
if
(
!
devinfo
)
{
...
...
@@ -126,7 +119,7 @@ NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device, LPCWSTR serial, LPCWSTR index)
return
GetLastError
();
}
Data
.
cbSize
=
sizeof
(
Data
);
if
(
!
SetupDiCreateDeviceInfoW
(
devinfo
,
regname
,
&
GUID_DEVCLASS_HIDCLASS
,
NULL
,
NULL
,
DICD_INHERIT_CLASSDRVS
,
&
Data
))
if
(
!
SetupDiCreateDeviceInfoW
(
devinfo
,
ext
->
instance_id
,
&
GUID_DEVCLASS_HIDCLASS
,
NULL
,
NULL
,
DICD_INHERIT_CLASSDRVS
,
&
Data
))
{
if
(
GetLastError
()
==
ERROR_DEVINST_ALREADY_EXISTS
)
{
...
...
dlls/hidclass.sys/hid.h
View file @
05642573
...
...
@@ -86,7 +86,7 @@ minidriver* find_minidriver(DRIVER_OBJECT* driver) DECLSPEC_HIDDEN;
/* Internal device functions */
NTSTATUS
HID_CreateDevice
(
DEVICE_OBJECT
*
native_device
,
HID_MINIDRIVER_REGISTRATION
*
driver
,
DEVICE_OBJECT
**
device
)
DECLSPEC_HIDDEN
;
NTSTATUS
HID_LinkDevice
(
DEVICE_OBJECT
*
device
,
LPCWSTR
serial
,
LPCWSTR
index
)
DECLSPEC_HIDDEN
;
NTSTATUS
HID_LinkDevice
(
DEVICE_OBJECT
*
device
)
DECLSPEC_HIDDEN
;
void
HID_DeleteDevice
(
HID_MINIDRIVER_REGISTRATION
*
driver
,
DEVICE_OBJECT
*
device
)
DECLSPEC_HIDDEN
;
void
HID_StartDeviceThread
(
DEVICE_OBJECT
*
device
)
DECLSPEC_HIDDEN
;
...
...
dlls/hidclass.sys/pnp.c
View file @
05642573
...
...
@@ -250,7 +250,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
sprintfW
(
ext
->
instance_id
,
device_instanceid_fmtW
,
device_enumeratorW
,
ext
->
information
.
VendorID
,
ext
->
information
.
ProductID
,
interface
,
ext
->
information
.
VersionNumber
,
serial
);
sprintfW
(
ext
->
device_id
,
device_deviceid_fmtW
,
device_enumeratorW
,
ext
->
information
.
VendorID
,
ext
->
information
.
ProductID
);
HID_LinkDevice
(
device
,
serial
,
interface
);
HID_LinkDevice
(
device
);
ext
->
poll_interval
=
DEFAULT_POLL_INTERVAL
;
...
...
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