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
22724c2c
Commit
22724c2c
authored
Oct 11, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Oct 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Add helper function to open a device's hardware key.
parent
e6a9eb6b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
devinst.c
dlls/setupapi/devinst.c
+18
-9
No files found.
dlls/setupapi/devinst.c
View file @
22724c2c
...
@@ -407,6 +407,22 @@ static BOOL SETUPDI_SetInterfaceSymbolicLink(SP_DEVICE_INTERFACE_DATA *iface,
...
@@ -407,6 +407,22 @@ static BOOL SETUPDI_SetInterfaceSymbolicLink(SP_DEVICE_INTERFACE_DATA *iface,
return
ret
;
return
ret
;
}
}
static
HKEY
SETUPDI_CreateDevKey
(
struct
DeviceInfo
*
devInfo
)
{
HKEY
enumKey
,
key
=
INVALID_HANDLE_VALUE
;
LONG
l
;
l
=
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
Enum
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
enumKey
,
NULL
);
if
(
!
l
)
{
RegCreateKeyExW
(
enumKey
,
devInfo
->
instanceId
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
RegCloseKey
(
enumKey
);
}
return
key
;
}
static
struct
DeviceInfo
*
SETUPDI_AllocateDeviceInfo
(
struct
DeviceInfoSet
*
set
,
static
struct
DeviceInfo
*
SETUPDI_AllocateDeviceInfo
(
struct
DeviceInfoSet
*
set
,
LPCWSTR
instanceId
,
BOOL
phantom
)
LPCWSTR
instanceId
,
BOOL
phantom
)
{
{
...
@@ -420,23 +436,16 @@ static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(struct DeviceInfoSet *set,
...
@@ -420,23 +436,16 @@ static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(struct DeviceInfoSet *set,
(
lstrlenW
(
instanceId
)
+
1
)
*
sizeof
(
WCHAR
));
(
lstrlenW
(
instanceId
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
devInfo
->
instanceId
)
if
(
devInfo
->
instanceId
)
{
{
HKEY
enumKey
;
LONG
l
;
devInfo
->
key
=
INVALID_HANDLE_VALUE
;
devInfo
->
key
=
INVALID_HANDLE_VALUE
;
devInfo
->
phantom
=
phantom
;
devInfo
->
phantom
=
phantom
;
lstrcpyW
(
devInfo
->
instanceId
,
instanceId
);
lstrcpyW
(
devInfo
->
instanceId
,
instanceId
);
struprW
(
devInfo
->
instanceId
);
struprW
(
devInfo
->
instanceId
);
l
=
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
Enum
,
0
,
NULL
,
0
,
devInfo
->
key
=
SETUPDI_CreateDevKey
(
devInfo
);
KEY_ALL_ACCESS
,
NULL
,
&
enumKey
,
NULL
);
if
(
devInfo
->
key
!=
INVALID_HANDLE_VALUE
)
if
(
!
l
)
{
{
RegCreateKeyExW
(
enumKey
,
devInfo
->
instanceId
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
devInfo
->
key
,
NULL
);
if
(
phantom
)
if
(
phantom
)
RegSetValueExW
(
devInfo
->
key
,
Phantom
,
0
,
REG_DWORD
,
RegSetValueExW
(
devInfo
->
key
,
Phantom
,
0
,
REG_DWORD
,
(
LPBYTE
)
&
phantom
,
sizeof
(
phantom
));
(
LPBYTE
)
&
phantom
,
sizeof
(
phantom
));
RegCloseKey
(
enumKey
);
}
}
list_init
(
&
devInfo
->
interfaces
);
list_init
(
&
devInfo
->
interfaces
);
}
}
...
...
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