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
cb5d1910
Commit
cb5d1910
authored
Mar 15, 2019
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Mar 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement SetupDiOpenDeviceInfoW().
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
64c09819
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
11 deletions
+86
-11
devinst.c
dlls/setupapi/devinst.c
+86
-0
stubs.c
dlls/setupapi/stubs.c
+0
-11
No files found.
dlls/setupapi/devinst.c
View file @
cb5d1910
...
...
@@ -3317,6 +3317,92 @@ HKEY WINAPI SetupDiOpenClassRegKeyExW(
}
/***********************************************************************
* SetupDiOpenDeviceInfoW (SETUPAPI.@)
*/
BOOL
WINAPI
SetupDiOpenDeviceInfoW
(
HDEVINFO
devinfo
,
PCWSTR
instance_id
,
HWND
hwnd_parent
,
DWORD
flags
,
PSP_DEVINFO_DATA
device_data
)
{
struct
DeviceInfoSet
*
set
;
struct
device
*
device
=
NULL
,
*
enum_device
;
WCHAR
classW
[
40
];
GUID
guid
;
HKEY
enumKey
=
NULL
;
HKEY
instanceKey
=
NULL
;
DWORD
phantom
;
DWORD
size
;
DWORD
error
=
ERROR_NO_SUCH_DEVINST
;
TRACE
(
"%p %s %p 0x%08x %p
\n
"
,
devinfo
,
debugstr_w
(
instance_id
),
hwnd_parent
,
flags
,
device_data
);
if
(
!
(
set
=
get_device_set
(
devinfo
)))
return
FALSE
;
if
(
!
instance_id
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
hwnd_parent
)
FIXME
(
"hwnd_parent unsupported
\n
"
);
if
(
flags
)
FIXME
(
"flags unsupported: 0x%08x
\n
"
,
flags
);
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
Enum
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
enumKey
,
NULL
);
/* Instance needs to be already existent in registry, if not, report ERROR_NO_SUCH_DEVINST */
if
(
RegOpenKeyExW
(
enumKey
,
instance_id
,
0
,
KEY_READ
,
&
instanceKey
))
goto
done
;
/* If it's an unregistered instance, aka phantom instance, report ERROR_NO_SUCH_DEVINST */
size
=
sizeof
(
phantom
);
if
(
!
RegQueryValueExW
(
instanceKey
,
Phantom
,
NULL
,
NULL
,
(
BYTE
*
)
&
phantom
,
&
size
))
goto
done
;
/* Check class GUID */
size
=
sizeof
(
classW
);
if
(
RegQueryValueExW
(
instanceKey
,
ClassGUID
,
NULL
,
NULL
,
(
BYTE
*
)
classW
,
&
size
))
goto
done
;
classW
[
37
]
=
0
;
UuidFromStringW
(
&
classW
[
1
],
&
guid
);
if
(
!
IsEqualGUID
(
&
set
->
ClassGuid
,
&
GUID_NULL
)
&&
!
IsEqualGUID
(
&
guid
,
&
set
->
ClassGuid
))
{
error
=
ERROR_CLASS_MISMATCH
;
goto
done
;
}
/* If current set already contains a same instance, don't create new ones */
LIST_FOR_EACH_ENTRY
(
enum_device
,
&
set
->
devices
,
struct
device
,
entry
)
{
if
(
!
strcmpiW
(
instance_id
,
enum_device
->
instanceId
))
{
device
=
enum_device
;
break
;
}
}
if
(
!
device
&&
!
(
device
=
SETUPDI_CreateDeviceInfo
(
set
,
&
guid
,
instance_id
,
FALSE
)))
goto
done
;
if
(
!
device_data
||
device_data
->
cbSize
==
sizeof
(
SP_DEVINFO_DATA
))
{
if
(
device_data
)
copy_device_data
(
device_data
,
device
);
error
=
NO_ERROR
;
}
else
error
=
ERROR_INVALID_USER_BUFFER
;
done:
RegCloseKey
(
instanceKey
);
RegCloseKey
(
enumKey
);
SetLastError
(
error
);
return
!
error
;
}
/***********************************************************************
* SetupDiOpenDeviceInterfaceW (SETUPAPI.@)
*/
BOOL
WINAPI
SetupDiOpenDeviceInterfaceW
(
...
...
dlls/setupapi/stubs.c
View file @
cb5d1910
...
...
@@ -323,17 +323,6 @@ BOOL WINAPI SetupDiOpenDeviceInfoA(HDEVINFO DeviceInfoSet, PCSTR DeviceInstanceI
}
/***********************************************************************
* SetupDiOpenDeviceInfoW (SETUPAPI.@)
*/
BOOL
WINAPI
SetupDiOpenDeviceInfoW
(
HDEVINFO
DeviceInfoSet
,
PCWSTR
DeviceInstanceId
,
HWND
hwndParent
,
DWORD
OpenFlags
,
PSP_DEVINFO_DATA
DeviceInfoData
)
{
FIXME
(
"%p %s %p 0x%08x %p: stub
\n
"
,
DeviceInfoSet
,
debugstr_w
(
DeviceInstanceId
),
hwndParent
,
OpenFlags
,
DeviceInfoData
);
return
FALSE
;
}
/***********************************************************************
* CM_Locate_DevNodeA (SETUPAPI.@)
*/
CONFIGRET
WINAPI
CM_Locate_DevNodeA
(
PDEVINST
pdnDevInst
,
DEVINSTID_A
pDeviceID
,
ULONG
ulFlags
)
...
...
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