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
9b7d1041
Commit
9b7d1041
authored
Feb 18, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implemented RegDeleteKeyExA/W.
parent
8543c324
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
23 deletions
+48
-23
advapi32.spec
dlls/advapi32/advapi32.spec
+2
-0
registry.c
dlls/advapi32/registry.c
+43
-23
winreg.h
include/winreg.h
+3
-0
No files found.
dlls/advapi32/advapi32.spec
View file @
9b7d1041
...
...
@@ -472,6 +472,8 @@
@ stdcall RegCreateKeyExW(long wstr long ptr long long ptr ptr ptr)
@ stdcall RegCreateKeyW(long wstr ptr)
@ stdcall RegDeleteKeyA(long str)
@ stdcall RegDeleteKeyExA(long str long long)
@ stdcall RegDeleteKeyExW(long wstr long long)
@ stdcall RegDeleteKeyW(long wstr)
@ stdcall RegDeleteTreeA(long str)
@ stdcall RegDeleteTreeW(long wstr)
...
...
dlls/advapi32/registry.c
View file @
9b7d1041
...
...
@@ -931,11 +931,9 @@ LSTATUS WINAPI RegCloseKey( HKEY hkey )
/******************************************************************************
* RegDeleteKeyW [ADVAPI32.@]
*
* See RegDeleteKeyA.
* RegDeleteKeyExW [ADVAPI32.@]
*/
LSTATUS
WINAPI
RegDeleteKey
W
(
HKEY
hkey
,
LPCWSTR
name
)
LSTATUS
WINAPI
RegDeleteKey
ExW
(
HKEY
hkey
,
LPCWSTR
name
,
REGSAM
access
,
DWORD
reserved
)
{
DWORD
ret
;
HKEY
tmp
;
...
...
@@ -944,7 +942,8 @@ LSTATUS WINAPI RegDeleteKeyW( HKEY hkey, LPCWSTR name )
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
if
(
!
(
ret
=
RegOpenKeyExW
(
hkey
,
name
,
0
,
DELETE
,
&
tmp
)))
access
&=
KEY_WOW64_64KEY
|
KEY_WOW64_32KEY
;
if
(
!
(
ret
=
RegOpenKeyExW
(
hkey
,
name
,
0
,
access
|
DELETE
,
&
tmp
)))
{
ret
=
RtlNtStatusToDosError
(
NtDeleteKey
(
tmp
)
);
RegCloseKey
(
tmp
);
...
...
@@ -955,24 +954,20 @@ LSTATUS WINAPI RegDeleteKeyW( HKEY hkey, LPCWSTR name )
/******************************************************************************
* RegDeleteKeyA [ADVAPI32.@]
*
* Delete a registry key.
*
* PARAMS
* hkey [I] Handle to parent key containing the key to delete
* name [I] Name of the key user hkey to delete
*
* NOTES
*
* MSDN is wrong when it says that hkey must be opened with the DELETE access
* right. In reality, it opens a new handle with DELETE access.
* RegDeleteKeyW [ADVAPI32.@]
*
* RETURNS
* Success: ERROR_SUCCESS
* Failure: Error code
* See RegDeleteKeyA.
*/
LSTATUS
WINAPI
RegDeleteKeyA
(
HKEY
hkey
,
LPCSTR
name
)
LSTATUS
WINAPI
RegDeleteKeyW
(
HKEY
hkey
,
LPCWSTR
name
)
{
return
RegDeleteKeyExW
(
hkey
,
name
,
0
,
0
);
}
/******************************************************************************
* RegDeleteKeyExA [ADVAPI32.@]
*/
LSTATUS
WINAPI
RegDeleteKeyExA
(
HKEY
hkey
,
LPCSTR
name
,
REGSAM
access
,
DWORD
reserved
)
{
DWORD
ret
;
HKEY
tmp
;
...
...
@@ -981,7 +976,8 @@ LSTATUS WINAPI RegDeleteKeyA( HKEY hkey, LPCSTR name )
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
if
(
!
(
ret
=
RegOpenKeyExA
(
hkey
,
name
,
0
,
DELETE
,
&
tmp
)))
access
&=
KEY_WOW64_64KEY
|
KEY_WOW64_32KEY
;
if
(
!
(
ret
=
RegOpenKeyExA
(
hkey
,
name
,
0
,
access
|
DELETE
,
&
tmp
)))
{
if
(
!
is_version_nt
())
/* win95 does recursive key deletes */
{
...
...
@@ -989,7 +985,7 @@ LSTATUS WINAPI RegDeleteKeyA( HKEY hkey, LPCSTR name )
while
(
!
RegEnumKeyA
(
tmp
,
0
,
name
,
sizeof
(
name
)))
{
if
(
RegDeleteKey
A
(
tmp
,
name
))
/* recurse */
if
(
RegDeleteKey
ExA
(
tmp
,
name
,
access
,
reserved
))
/* recurse */
break
;
}
}
...
...
@@ -1001,6 +997,30 @@ LSTATUS WINAPI RegDeleteKeyA( HKEY hkey, LPCSTR name )
}
/******************************************************************************
* RegDeleteKeyA [ADVAPI32.@]
*
* Delete a registry key.
*
* PARAMS
* hkey [I] Handle to parent key containing the key to delete
* name [I] Name of the key user hkey to delete
*
* NOTES
*
* MSDN is wrong when it says that hkey must be opened with the DELETE access
* right. In reality, it opens a new handle with DELETE access.
*
* RETURNS
* Success: ERROR_SUCCESS
* Failure: Error code
*/
LSTATUS
WINAPI
RegDeleteKeyA
(
HKEY
hkey
,
LPCSTR
name
)
{
return
RegDeleteKeyExA
(
hkey
,
name
,
0
,
0
);
}
/******************************************************************************
* RegSetValueExW [ADVAPI32.@]
...
...
include/winreg.h
View file @
9b7d1041
...
...
@@ -104,6 +104,9 @@ WINADVAPI LSTATUS WINAPI RegCreateKeyExW(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSA
WINADVAPI
LSTATUS
WINAPI
RegDeleteKeyA
(
HKEY
,
LPCSTR
);
WINADVAPI
LSTATUS
WINAPI
RegDeleteKeyW
(
HKEY
,
LPCWSTR
);
#define RegDeleteKey WINELIB_NAME_AW(RegDeleteKey)
WINADVAPI
LSTATUS
WINAPI
RegDeleteKeyExA
(
HKEY
,
LPCSTR
,
REGSAM
,
DWORD
);
WINADVAPI
LSTATUS
WINAPI
RegDeleteKeyExW
(
HKEY
,
LPCWSTR
,
REGSAM
,
DWORD
);
#define RegDeleteKeyEx WINELIB_NAME_AW(RegDeleteKeyEx)
WINADVAPI
LSTATUS
WINAPI
RegDeleteKeyValueA
(
HKEY
,
LPCSTR
,
LPCSTR
);
WINADVAPI
LSTATUS
WINAPI
RegDeleteKeyValueW
(
HKEY
,
LPCWSTR
,
LPCWSTR
);
#define RegDeleteKeyValue WINELIB_NAME_AW(RegDeleteKeyValue)
...
...
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