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
1bbfd72a
Commit
1bbfd72a
authored
Sep 19, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Sep 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Add error checking to SetupDiCreateDeviceInfoW stub.
parent
c1ccd657
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
5 deletions
+39
-5
devinst.c
dlls/setupapi/devinst.c
+39
-2
devinst.c
dlls/setupapi/tests/devinst.c
+0
-3
No files found.
dlls/setupapi/devinst.c
View file @
1bbfd72a
...
...
@@ -752,13 +752,50 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(
DWORD
CreationFlags
,
PSP_DEVINFO_DATA
DeviceInfoData
)
{
struct
DeviceInfoSet
*
set
=
(
struct
DeviceInfoSet
*
)
DeviceInfoSet
;
BOOL
ret
=
FALSE
;
TRACE
(
"%p %s %s %s %p %x %p
\n
"
,
DeviceInfoSet
,
debugstr_w
(
DeviceName
),
debugstr_guid
(
ClassGuid
),
debugstr_w
(
DeviceDescription
),
hwndParent
,
CreationFlags
,
DeviceInfoData
);
FIXME
(
"stub
\n
"
);
if
(
!
DeviceName
)
{
SetLastError
(
ERROR_INVALID_DEVINST_NAME
);
return
FALSE
;
}
if
(
!
DeviceInfoSet
||
DeviceInfoSet
==
(
HDEVINFO
)
INVALID_HANDLE_VALUE
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
if
(
!
ClassGuid
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
set
->
magic
==
SETUP_DEVICE_INFO_SET_MAGIC
)
{
if
(
IsEqualGUID
(
&
set
->
ClassGuid
,
&
GUID_NULL
)
||
IsEqualGUID
(
ClassGuid
,
&
set
->
ClassGuid
))
ret
=
TRUE
;
else
SetLastError
(
ERROR_CLASS_MISMATCH
);
if
((
CreationFlags
&
DICD_GENERATE_ID
)
&&
strchrW
(
DeviceName
,
'\\'
))
{
SetLastError
(
ERROR_INVALID_DEVINST_NAME
);
ret
=
FALSE
;
}
if
(
ret
)
{
FIXME
(
"stub
\n
"
);
ret
=
FALSE
;
}
}
else
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
return
ret
;
}
/***********************************************************************
...
...
dlls/setupapi/tests/devinst.c
View file @
1bbfd72a
...
...
@@ -146,13 +146,11 @@ static void testCreateDeviceInfo(void)
}
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiCreateDeviceInfoA
(
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_DEVINST_NAME
,
"Expected ERROR_INVALID_DEVINST_NAME, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiCreateDeviceInfoA
(
NULL
,
"Root
\\
LEGACY_BOGUS
\\
0000"
,
NULL
,
NULL
,
NULL
,
0
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLEHANDLE, got %08x
\n
"
,
GetLastError
());
set
=
pSetupDiCreateDeviceInfoList
(
&
guid
,
NULL
);
...
...
@@ -166,7 +164,6 @@ static void testCreateDeviceInfo(void)
SetLastError
(
0xdeadbeef
);
ret
=
pSetupDiCreateDeviceInfoA
(
set
,
"Root
\\
LEGACY_BOGUS
\\
0000"
,
NULL
,
NULL
,
NULL
,
0
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %08x
\n
"
,
GetLastError
());
/* Finally, with all three required parameters, this succeeds: */
...
...
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