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
8b5faacf
Commit
8b5faacf
authored
Oct 12, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Oct 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement SetupDiDeleteDevRegKey.
parent
36229a74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
4 deletions
+125
-4
devinst.c
dlls/setupapi/devinst.c
+123
-2
setupapi.spec
dlls/setupapi/setupapi.spec
+1
-1
setupapi.h
include/setupapi.h
+1
-1
No files found.
dlls/setupapi/devinst.c
View file @
8b5faacf
...
@@ -439,8 +439,8 @@ static HKEY SETUPDI_CreateDrvKey(struct DeviceInfo *devInfo)
...
@@ -439,8 +439,8 @@ static HKEY SETUPDI_CreateDrvKey(struct DeviceInfo *devInfo)
KEY_ALL_ACCESS
,
NULL
,
&
classKey
,
NULL
);
KEY_ALL_ACCESS
,
NULL
,
&
classKey
,
NULL
);
if
(
!
l
)
if
(
!
l
)
{
{
static
const
WCHAR
fmt
[]
=
{
'%'
,
'0'
,
'4'
,
'
d
'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'%'
,
'0'
,
'4'
,
'
u
'
,
0
};
WCHAR
devId
[
5
];
WCHAR
devId
[
10
];
sprintfW
(
devId
,
fmt
,
devInfo
->
devId
);
sprintfW
(
devId
,
fmt
,
devInfo
->
devId
);
RegCreateKeyExW
(
classKey
,
devId
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
RegCreateKeyExW
(
classKey
,
devId
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
...
@@ -3678,3 +3678,124 @@ HKEY WINAPI SetupDiOpenDevRegKey(
...
@@ -3678,3 +3678,124 @@ HKEY WINAPI SetupDiOpenDevRegKey(
}
}
return
key
;
return
key
;
}
}
static
BOOL
SETUPDI_DeleteDevKey
(
struct
DeviceInfo
*
devInfo
)
{
HKEY
enumKey
;
BOOL
ret
=
FALSE
;
LONG
l
;
l
=
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
Enum
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
enumKey
,
NULL
);
if
(
!
l
)
{
ret
=
RegDeleteTreeW
(
enumKey
,
devInfo
->
instanceId
);
RegCloseKey
(
enumKey
);
}
else
SetLastError
(
l
);
return
ret
;
}
static
BOOL
SETUPDI_DeleteDrvKey
(
struct
DeviceInfo
*
devInfo
)
{
static
const
WCHAR
slash
[]
=
{
'\\'
,
0
};
WCHAR
classKeyPath
[
MAX_PATH
];
HKEY
classKey
;
LONG
l
;
BOOL
ret
=
FALSE
;
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'
,
'u'
,
0
};
WCHAR
devId
[
10
];
sprintfW
(
devId
,
fmt
,
devInfo
->
devId
);
ret
=
RegDeleteTreeW
(
classKey
,
devId
);
RegCloseKey
(
classKey
);
}
else
SetLastError
(
l
);
return
ret
;
}
/***********************************************************************
* SetupDiOpenDevRegKey (SETUPAPI.@)
*/
BOOL
WINAPI
SetupDiDeleteDevRegKey
(
HDEVINFO
DeviceInfoSet
,
PSP_DEVINFO_DATA
DeviceInfoData
,
DWORD
Scope
,
DWORD
HwProfile
,
DWORD
KeyType
)
{
struct
DeviceInfoSet
*
set
=
(
struct
DeviceInfoSet
*
)
DeviceInfoSet
;
struct
DeviceInfo
*
devInfo
;
BOOL
ret
=
FALSE
;
TRACE
(
"%p %p %d %d %d
\n
"
,
DeviceInfoSet
,
DeviceInfoData
,
Scope
,
HwProfile
,
KeyType
);
if
(
!
DeviceInfoSet
||
DeviceInfoSet
==
(
HDEVINFO
)
INVALID_HANDLE_VALUE
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
if
(
set
->
magic
!=
SETUP_DEVICE_INFO_SET_MAGIC
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
if
(
!
DeviceInfoData
||
DeviceInfoData
->
cbSize
!=
sizeof
(
SP_DEVINFO_DATA
)
||
!
DeviceInfoData
->
Reserved
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
Scope
!=
DICS_FLAG_GLOBAL
&&
Scope
!=
DICS_FLAG_CONFIGSPECIFIC
)
{
SetLastError
(
ERROR_INVALID_FLAGS
);
return
FALSE
;
}
if
(
KeyType
!=
DIREG_DEV
&&
KeyType
!=
DIREG_DRV
)
{
SetLastError
(
ERROR_INVALID_FLAGS
);
return
FALSE
;
}
devInfo
=
(
struct
DeviceInfo
*
)
DeviceInfoData
->
Reserved
;
if
(
devInfo
->
set
!=
set
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
devInfo
->
phantom
)
{
SetLastError
(
ERROR_DEVINFO_NOT_REGISTERED
);
return
FALSE
;
}
if
(
Scope
!=
DICS_FLAG_GLOBAL
)
FIXME
(
"unimplemented for scope %d
\n
"
,
Scope
);
switch
(
KeyType
)
{
case
DIREG_DEV
:
ret
=
SETUPDI_DeleteDevKey
(
devInfo
);
break
;
case
DIREG_DRV
:
ret
=
SETUPDI_DeleteDrvKey
(
devInfo
);
break
;
case
DIREG_BOTH
:
ret
=
SETUPDI_DeleteDevKey
(
devInfo
);
if
(
ret
)
ret
=
SETUPDI_DeleteDrvKey
(
devInfo
);
break
;
default:
WARN
(
"unknown KeyType %d
\n
"
,
KeyType
);
}
return
ret
;
}
dlls/setupapi/setupapi.spec
View file @
8b5faacf
...
@@ -292,7 +292,7 @@
...
@@ -292,7 +292,7 @@
@ stdcall SetupDiCreateDeviceInterfaceW(ptr ptr ptr wstr long ptr)
@ stdcall SetupDiCreateDeviceInterfaceW(ptr ptr ptr wstr long ptr)
@ stdcall SetupDiCreateDeviceInterfaceRegKeyA(ptr ptr long long ptr ptr)
@ stdcall SetupDiCreateDeviceInterfaceRegKeyA(ptr ptr long long ptr ptr)
@ stdcall SetupDiCreateDeviceInterfaceRegKeyW(ptr ptr long long ptr ptr)
@ stdcall SetupDiCreateDeviceInterfaceRegKeyW(ptr ptr long long ptr ptr)
@ st
ub SetupDiDeleteDevRegKey
@ st
dcall SetupDiDeleteDevRegKey(ptr ptr long long long)
@ stub SetupDiDeleteDeviceInfo
@ stub SetupDiDeleteDeviceInfo
@ stub SetupDiDeleteDeviceInterfaceData
@ stub SetupDiDeleteDeviceInterfaceData
@ stdcall SetupDiDeleteDeviceInterfaceRegKey(ptr ptr long)
@ stdcall SetupDiDeleteDeviceInterfaceRegKey(ptr ptr long)
...
...
include/setupapi.h
View file @
8b5faacf
...
@@ -1469,7 +1469,7 @@ HKEY WINAPI SetupDiCreateDevRegKeyW(HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD
...
@@ -1469,7 +1469,7 @@ HKEY WINAPI SetupDiCreateDevRegKeyW(HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD
BOOL
WINAPI
SetupDiDeleteDeviceInfo
(
HDEVINFO
,
PSP_DEVINFO_DATA
);
BOOL
WINAPI
SetupDiDeleteDeviceInfo
(
HDEVINFO
,
PSP_DEVINFO_DATA
);
BOOL
WINAPI
SetupDiDeleteDeviceInterfaceData
(
HDEVINFO
,
PSP_DEVICE_INTERFACE_DATA
);
BOOL
WINAPI
SetupDiDeleteDeviceInterfaceData
(
HDEVINFO
,
PSP_DEVICE_INTERFACE_DATA
);
BOOL
WINAPI
SetupDiDeleteDeviceInterfaceRegKey
(
HDEVINFO
,
PSP_DEVICE_INTERFACE_DATA
,
DWORD
);
BOOL
WINAPI
SetupDiDeleteDeviceInterfaceRegKey
(
HDEVINFO
,
PSP_DEVICE_INTERFACE_DATA
,
DWORD
);
BOOL
WINAPI
SetupDiDeleteDevRegKey
(
HDEVINFO
,
PSP_DEVI
CE_INTERFACE
_DATA
,
DWORD
,
DWORD
,
DWORD
);
BOOL
WINAPI
SetupDiDeleteDevRegKey
(
HDEVINFO
,
PSP_DEVI
NFO
_DATA
,
DWORD
,
DWORD
,
DWORD
);
BOOL
WINAPI
SetupDiDestroyClassImageList
(
PSP_CLASSIMAGELIST_DATA
);
BOOL
WINAPI
SetupDiDestroyClassImageList
(
PSP_CLASSIMAGELIST_DATA
);
BOOL
WINAPI
SetupDiDestroyDeviceInfoList
(
HDEVINFO
);
BOOL
WINAPI
SetupDiDestroyDeviceInfoList
(
HDEVINFO
);
BOOL
WINAPI
SetupDiDestroyDriverInfoList
(
HDEVINFO
,
PSP_DEVINFO_DATA
,
DWORD
);
BOOL
WINAPI
SetupDiDestroyDriverInfoList
(
HDEVINFO
,
PSP_DEVINFO_DATA
,
DWORD
);
...
...
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