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
5711f03e
Commit
5711f03e
authored
Nov 16, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Correctly calculate the required size in SetupDiGetDeviceInterfaceDetailA().
Don't include the null terminator twice.
parent
60af599b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
devinst.c
dlls/setupapi/devinst.c
+1
-1
devinst.c
dlls/setupapi/tests/devinst.c
+3
-4
No files found.
dlls/setupapi/devinst.c
View file @
5711f03e
...
...
@@ -3003,7 +3003,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(HDEVINFO devinfo, SP_DEVICE_INTERFA
if
(
iface
->
symlink
)
bytesNeeded
+=
WideCharToMultiByte
(
CP_ACP
,
0
,
iface
->
symlink
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
NULL
,
0
,
NULL
,
NULL
)
-
1
;
if
(
DeviceInterfaceDetailDataSize
>=
bytesNeeded
)
{
if
(
iface
->
symlink
)
...
...
dlls/setupapi/tests/devinst.c
View file @
5711f03e
...
...
@@ -1232,7 +1232,7 @@ static void test_device_iface_detail(void)
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Got unexpected error %#lx.
\n
"
,
GetLastError
());
expected_size
=
FIELD_OFFSET
(
SP_DEVICE_INTERFACE_DETAIL_DATA_A
,
DevicePath
[
strlen
(
path
)
+
1
]);
todo_wine
ok
(
size
==
expected_size
,
"Expected size %lu, got %lu.
\n
"
,
expected_size
,
size
);
ok
(
size
==
expected_size
,
"Expected size %lu, got %lu.
\n
"
,
expected_size
,
size
);
detail
=
heap_alloc
(
size
*
2
);
detail
->
cbSize
=
0
;
...
...
@@ -1255,9 +1255,8 @@ static void test_device_iface_detail(void)
SetLastError
(
0xdeadbeef
);
size
=
0xdeadbeef
;
ret
=
SetupDiGetDeviceInterfaceDetailA
(
set
,
&
iface
,
detail
,
expected_size
,
&
size
,
NULL
);
todo_wine
ok
(
ret
,
"Failed to get interface detail, error %#lx.
\n
"
,
GetLastError
());
if
(
ret
)
ok
(
!
strcasecmp
(
path
,
detail
->
DevicePath
),
"Got unexpected path %s.
\n
"
,
detail
->
DevicePath
);
ok
(
ret
,
"Failed to get interface detail, error %#lx.
\n
"
,
GetLastError
());
ok
(
!
strcasecmp
(
path
,
detail
->
DevicePath
),
"Got unexpected path %s.
\n
"
,
detail
->
DevicePath
);
todo_wine
ok
(
size
==
expected_size
,
"Expected size %lu, got %lu.
\n
"
,
expected_size
,
size
);
SetLastError
(
0xdeadbeef
);
...
...
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