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
510261a4
Commit
510261a4
authored
Jun 05, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Use SetupDiOpenDeviceInfo().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1e05e96c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
33 deletions
+4
-33
pnp.c
dlls/ntoskrnl.exe/pnp.c
+4
-33
No files found.
dlls/ntoskrnl.exe/pnp.c
View file @
510261a4
...
...
@@ -623,7 +623,6 @@ NTSTATUS WINAPI IoRegisterDeviceInterface(DEVICE_OBJECT *device, const GUID *cla
WCHAR
*
instance_id
;
DWORD
required
;
HDEVINFO
set
;
BOOL
rc
;
TRACE
(
"device %p, class_guid %s, refstr %s, symbolic_link %p.
\n
"
,
device
,
debugstr_guid
(
class_guid
),
debugstr_us
(
refstr
),
symbolic_link
);
...
...
@@ -634,39 +633,11 @@ NTSTATUS WINAPI IoRegisterDeviceInterface(DEVICE_OBJECT *device, const GUID *cla
status
=
get_instance_id
(
device
,
&
instance_id
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
rc
=
SetupDiCreateDeviceInfoW
(
set
,
instance_id
,
class_guid
,
NULL
,
NULL
,
0
,
&
sp_device
);
if
(
rc
==
0
)
if
(
!
SetupDiCreateDeviceInfoW
(
set
,
instance_id
,
class_guid
,
NULL
,
NULL
,
0
,
&
sp_device
)
&&
!
SetupDiOpenDeviceInfoW
(
set
,
instance_id
,
NULL
,
0
,
&
sp_device
)
)
{
if
(
GetLastError
()
==
ERROR_DEVINST_ALREADY_EXISTS
)
{
DWORD
index
=
0
;
DWORD
size
=
strlenW
(
instance_id
)
+
2
;
WCHAR
*
id
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
)
);
do
{
rc
=
SetupDiEnumDeviceInfo
(
set
,
index
,
&
sp_device
);
if
(
rc
&&
IsEqualGUID
(
&
sp_device
.
ClassGuid
,
class_guid
))
{
BOOL
check
;
check
=
SetupDiGetDeviceInstanceIdW
(
set
,
&
sp_device
,
id
,
size
,
&
required
);
if
(
check
&&
strcmpW
(
id
,
instance_id
)
==
0
)
break
;
}
index
++
;
}
while
(
rc
);
HeapFree
(
GetProcessHeap
(),
0
,
id
);
if
(
!
rc
)
{
ExFreePool
(
instance_id
);
return
STATUS_UNSUCCESSFUL
;
}
}
else
{
ExFreePool
(
instance_id
);
return
STATUS_UNSUCCESSFUL
;
}
ERR
(
"Failed to create device %s, error %#x.
\n
"
,
debugstr_w
(
instance_id
),
GetLastError
());
return
GetLastError
();
}
ExFreePool
(
instance_id
);
...
...
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