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
cb1d6517
Commit
cb1d6517
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: Implement SetupDiCreateDevRegKeyW.
parent
732b968b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
2 deletions
+77
-2
devinst.c
dlls/setupapi/devinst.c
+77
-2
No files found.
dlls/setupapi/devinst.c
View file @
cb1d6517
...
...
@@ -424,6 +424,32 @@ static HKEY SETUPDI_CreateDevKey(struct DeviceInfo *devInfo)
return
key
;
}
static
HKEY
SETUPDI_CreateDrvKey
(
struct
DeviceInfo
*
devInfo
)
{
static
const
WCHAR
slash
[]
=
{
'\\'
,
0
};
WCHAR
classKeyPath
[
MAX_PATH
];
HKEY
classKey
,
key
=
INVALID_HANDLE_VALUE
;
LONG
l
;
lstrcpyW
(
classKeyPath
,
ControlClass
);
lstrcatW
(
classKeyPath
,
slash
);
SETUPDI_GuidToString
(
&
devInfo
->
set
->
ClassGuid
,
classKeyPath
+
lstrlenW
(
classKeyPath
));
l
=
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
classKeyPath
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
classKey
,
NULL
);
if
(
!
l
)
{
static
const
WCHAR
fmt
[]
=
{
'%'
,
'0'
,
'4'
,
'd'
,
0
};
WCHAR
devId
[
5
];
sprintfW
(
devId
,
fmt
,
devInfo
->
devId
);
RegCreateKeyExW
(
classKey
,
devId
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
key
,
NULL
);
RegCloseKey
(
classKey
);
}
return
key
;
}
static
struct
DeviceInfo
*
SETUPDI_AllocateDeviceInfo
(
struct
DeviceInfoSet
*
set
,
DWORD
devId
,
LPCWSTR
instanceId
,
BOOL
phantom
)
{
...
...
@@ -1209,9 +1235,58 @@ HKEY WINAPI SetupDiCreateDevRegKeyW(
HINF
InfHandle
,
PCWSTR
InfSectionName
)
{
FIXME
(
"%p %p %d %d %d %p %s
\n
"
,
DeviceInfoSet
,
DeviceInfoData
,
Scope
,
struct
DeviceInfoSet
*
set
=
(
struct
DeviceInfoSet
*
)
DeviceInfoSet
;
struct
DeviceInfo
*
devInfo
;
HKEY
key
=
INVALID_HANDLE_VALUE
;
TRACE
(
"%p %p %d %d %d %p %s
\n
"
,
DeviceInfoSet
,
DeviceInfoData
,
Scope
,
HwProfile
,
KeyType
,
InfHandle
,
debugstr_w
(
InfSectionName
));
return
INVALID_HANDLE_VALUE
;
if
(
!
DeviceInfoSet
||
DeviceInfoSet
==
(
HDEVINFO
)
INVALID_HANDLE_VALUE
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
INVALID_HANDLE_VALUE
;
}
if
(
set
->
magic
!=
SETUP_DEVICE_INFO_SET_MAGIC
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
INVALID_HANDLE_VALUE
;
}
if
(
!
DeviceInfoData
||
DeviceInfoData
->
cbSize
!=
sizeof
(
SP_DEVINFO_DATA
)
||
!
DeviceInfoData
->
Reserved
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
INVALID_HANDLE_VALUE
;
}
devInfo
=
(
struct
DeviceInfo
*
)
DeviceInfoData
->
Reserved
;
if
(
devInfo
->
set
!=
set
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
INVALID_HANDLE_VALUE
;
}
if
(
devInfo
->
phantom
)
{
SetLastError
(
ERROR_DEVINFO_NOT_REGISTERED
);
return
INVALID_HANDLE_VALUE
;
}
if
(
Scope
!=
DICS_FLAG_GLOBAL
)
FIXME
(
"unimplemented for scope %d
\n
"
,
Scope
);
switch
(
KeyType
)
{
case
DIREG_DEV
:
key
=
SETUPDI_CreateDevKey
(
devInfo
);
break
;
case
DIREG_DRV
:
key
=
SETUPDI_CreateDrvKey
(
devInfo
);
break
;
default:
WARN
(
"unknown KeyType %d
\n
"
,
KeyType
);
}
if
(
InfHandle
)
SetupInstallFromInfSectionW
(
NULL
,
InfHandle
,
InfSectionName
,
SPINST_ALL
,
NULL
,
NULL
,
SP_COPY_NEWER_ONLY
,
NULL
,
NULL
,
DeviceInfoSet
,
DeviceInfoData
);
return
key
;
}
/***********************************************************************
...
...
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