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
54800316
Commit
54800316
authored
Mar 31, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Also check devices not in the set when using DICD_GENERATE_ID.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8ec29106
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
devinst.c
dlls/setupapi/devinst.c
+15
-19
No files found.
dlls/setupapi/devinst.c
View file @
54800316
...
...
@@ -1513,6 +1513,7 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(HDEVINFO devinfo, const WCHAR *name, const
HKEY
enum_hkey
;
HKEY
instance_hkey
;
struct
device
*
device
;
LONG
l
;
TRACE
(
"devinfo %p, name %s, class %s, description %s, hwnd %p, flags %#x, device_data %p.
\n
"
,
devinfo
,
debugstr_w
(
name
),
debugstr_guid
(
class
),
debugstr_w
(
description
),
...
...
@@ -1540,8 +1541,8 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(HDEVINFO devinfo, const WCHAR *name, const
}
if
((
flags
&
DICD_GENERATE_ID
))
{
static
const
WCHAR
formatW
[]
=
{
'R'
,
'O'
,
'O'
,
'T'
,
'\\'
,
'%'
,
's'
,
'\\'
,
'%'
,
'0'
,
'4'
,
'
d
'
,
0
};
int
instance_id
,
highest_id
=
-
1
;
static
const
WCHAR
formatW
[]
=
{
'R'
,
'O'
,
'O'
,
'T'
,
'\\'
,
'%'
,
's'
,
'\\'
,
'%'
,
'0'
,
'4'
,
'
u
'
,
0
};
unsigned
int
instance_id
;
if
(
strchrW
(
name
,
'\\'
))
{
...
...
@@ -1549,25 +1550,20 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(HDEVINFO devinfo, const WCHAR *name, const
return
FALSE
;
}
LIST_FOR_EACH_ENTRY
(
device
,
&
set
->
devices
,
struct
device
,
entry
)
for
(
instance_id
=
0
;
;
++
instance_id
)
{
const
WCHAR
*
instance_str
=
strrchrW
(
device
->
instanceId
,
'\\'
);
WCHAR
*
endptr
;
if
(
instance_str
)
instance_str
++
;
else
instance_str
=
device
->
instanceId
;
instance_id
=
strtoulW
(
instance_str
,
&
endptr
,
10
);
if
(
*
instance_str
&&
!*
endptr
)
highest_id
=
max
(
highest_id
,
instance_id
);
}
if
(
snprintfW
(
id
,
ARRAY_SIZE
(
id
),
formatW
,
name
,
instance_id
)
==
-
1
)
{
SetLastError
(
ERROR_INVALID_DEVINST_NAME
);
return
FALSE
;
}
if
(
snprintfW
(
id
,
ARRAY_SIZE
(
id
),
formatW
,
name
,
highest_id
+
1
)
==
-
1
)
{
SetLastError
(
ERROR_INVALID_DEVINST_NAME
);
return
FALSE
;
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
Enum
,
0
,
NULL
,
0
,
KEY_READ
,
NULL
,
&
enum_hkey
,
NULL
);
if
(
!
(
l
=
RegOpenKeyExW
(
enum_hkey
,
id
,
0
,
KEY_READ
,
&
instance_hkey
)))
RegCloseKey
(
instance_hkey
);
if
(
l
==
ERROR_FILE_NOT_FOUND
)
break
;
RegCloseKey
(
enum_hkey
);
}
}
else
...
...
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