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
433ca7d8
Commit
433ca7d8
authored
Feb 25, 2008
by
Paul Vriens
Committed by
Alexandre Julliard
Feb 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/devinst: Struct size passed needs to be exact.
parent
d91f3a93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
devinst.c
dlls/setupapi/devinst.c
+2
-3
devinst.c
dlls/setupapi/tests/devinst.c
+9
-0
No files found.
dlls/setupapi/devinst.c
View file @
433ca7d8
...
...
@@ -2885,9 +2885,8 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
DeviceInterfaceDetailData
&&
(
DeviceInterfaceDetailData
->
cbSize
<
offsetof
(
SP_DEVICE_INTERFACE_DETAIL_DATA_A
,
DevicePath
)
+
sizeof
(
char
)
||
DeviceInterfaceDetailData
->
cbSize
>
sizeof
(
SP_DEVICE_INTERFACE_DETAIL_DATA_A
)))
if
(
DeviceInterfaceDetailData
&&
(
DeviceInterfaceDetailData
->
cbSize
!=
offsetof
(
SP_DEVICE_INTERFACE_DETAIL_DATA_A
,
DevicePath
)
+
sizeof
(
char
)))
{
SetLastError
(
ERROR_INVALID_USER_BUFFER
);
return
FALSE
;
...
...
dlls/setupapi/tests/devinst.c
View file @
433ca7d8
...
...
@@ -641,6 +641,15 @@ static void testGetDeviceInterfaceDetail(void)
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_USER_BUFFER
,
"Expected ERROR_INVALID_USER_BUFFER, got %08x
\n
"
,
GetLastError
());
detail
->
cbSize
=
sizeof
(
SP_DEVICE_INTERFACE_DETAIL_DATA_A
);
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiGetDeviceInterfaceDetailA
(
set
,
&
interfaceData
,
detail
,
size
,
&
size
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_USER_BUFFER
,
"Expected ERROR_INVALID_USER_BUFFER, got %08x
\n
"
,
GetLastError
());
/* Windows 2000 and up check for the exact size. Win9x returns ERROR_INVALID_PARAMETER
* on every call (so doesn't get here) and NT4 doesn't have this function.
*/
detail
->
cbSize
=
offsetof
(
SP_DEVICE_INTERFACE_DETAIL_DATA_A
,
DevicePath
)
+
sizeof
(
char
);
ret
=
pSetupDiGetDeviceInterfaceDetailA
(
set
,
&
interfaceData
,
detail
,
size
,
&
size
,
NULL
);
ok
(
ret
,
"SetupDiGetDeviceInterfaceDetailA failed: %d
\n
"
,
...
...
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