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
26dd015f
Commit
26dd015f
authored
Dec 05, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Use strtoulW().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cda846b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
26 deletions
+5
-26
devinst.c
dlls/setupapi/devinst.c
+5
-26
No files found.
dlls/setupapi/devinst.c
View file @
26dd015f
...
...
@@ -1412,29 +1412,6 @@ BOOL WINAPI SetupDiCreateDeviceInfoA(HDEVINFO DeviceInfoSet, const char *name,
return
ret
;
}
static
DWORD
SETUPDI_DevNameToDevID
(
LPCWSTR
devName
)
{
LPCWSTR
ptr
;
int
devNameLen
=
lstrlenW
(
devName
);
DWORD
devInst
=
0
;
BOOL
valid
=
TRUE
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
devName
));
for
(
ptr
=
devName
;
valid
&&
*
ptr
&&
ptr
-
devName
<
devNameLen
;
)
{
if
(
isdigitW
(
*
ptr
))
{
devInst
*=
10
;
devInst
|=
*
ptr
-
'0'
;
ptr
++
;
}
else
valid
=
FALSE
;
}
TRACE
(
"%d
\n
"
,
valid
?
devInst
:
0xffffffff
);
return
valid
?
devInst
:
0xffffffff
;
}
/***********************************************************************
* SetupDiCreateDeviceInfoW (SETUPAPI.@)
*/
...
...
@@ -1483,14 +1460,16 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(HDEVINFO devinfo, const WCHAR *name, const
LIST_FOR_EACH_ENTRY
(
device
,
&
set
->
devices
,
struct
device
,
entry
)
{
const
WCHAR
*
instance_str
=
strrchrW
(
device
->
instanceId
,
'\\'
);
WCHAR
*
endptr
;
if
(
instance_str
)
instance_str
++
;
else
instance_str
=
device
->
instanceId
;
instance_id
=
SETUPDI_DevNameToDevID
(
instance_str
);
if
(
instance_id
!=
0xffffffff
&&
instance_id
>
highest_id
)
highest_id
=
instance_id
;
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
,
highest_id
+
1
)
==
-
1
)
...
...
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