Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5f42d67d
Commit
5f42d67d
authored
Dec 04, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Forward SHDeleteKey() to shcore.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a587b793
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
79 deletions
+2
-79
reg.c
dlls/shlwapi/reg.c
+0
-77
shlwapi.spec
dlls/shlwapi/shlwapi.spec
+2
-2
No files found.
dlls/shlwapi/reg.c
View file @
5f42d67d
...
...
@@ -1514,83 +1514,6 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
}
/*************************************************************************
* SHDeleteKeyA [SHLWAPI.@]
*
* Delete a registry key and any sub keys/values present
*
* This function forwards to the unicode version directly, to avoid
* handling subkeys that are not representable in ASCII.
*
* PARAMS
* hKey [I] Handle to registry key
* lpszSubKey [I] Name of sub key to delete
*
* RETURNS
* Success: ERROR_SUCCESS. The key is deleted.
* Failure: An error code from RegOpenKeyExA(), RegQueryInfoKeyA(),
* RegEnumKeyExA() or RegDeleteKeyA().
*/
DWORD
WINAPI
SHDeleteKeyA
(
HKEY
hKey
,
LPCSTR
lpszSubKey
)
{
WCHAR
subkeyW
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszSubKey
,
-
1
,
subkeyW
,
ARRAY_SIZE
(
subkeyW
));
return
SHDeleteKeyW
(
hKey
,
subkeyW
);
}
/*************************************************************************
* SHDeleteKeyW [SHLWAPI.@]
*
* See SHDeleteKeyA.
*/
DWORD
WINAPI
SHDeleteKeyW
(
HKEY
hKey
,
LPCWSTR
lpszSubKey
)
{
DWORD
dwRet
,
dwMaxSubkeyLen
=
0
,
dwSize
;
WCHAR
szNameBuf
[
MAX_PATH
],
*
lpszName
=
szNameBuf
;
HKEY
hSubKey
=
0
;
TRACE
(
"(hkey=%p,%s)
\n
"
,
hKey
,
debugstr_w
(
lpszSubKey
));
dwRet
=
RegOpenKeyExW
(
hKey
,
lpszSubKey
,
0
,
KEY_READ
,
&
hSubKey
);
if
(
!
dwRet
)
{
/* Find the maximum subkey length so that we can allocate a buffer */
dwRet
=
RegQueryInfoKeyW
(
hSubKey
,
NULL
,
NULL
,
NULL
,
NULL
,
&
dwMaxSubkeyLen
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
!
dwRet
)
{
dwMaxSubkeyLen
++
;
if
(
dwMaxSubkeyLen
>
ARRAY_SIZE
(
szNameBuf
))
/* Name too big: alloc a buffer for it */
lpszName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwMaxSubkeyLen
*
sizeof
(
WCHAR
));
if
(
!
lpszName
)
dwRet
=
ERROR_NOT_ENOUGH_MEMORY
;
else
{
while
(
dwRet
==
ERROR_SUCCESS
)
{
dwSize
=
dwMaxSubkeyLen
;
dwRet
=
RegEnumKeyExW
(
hSubKey
,
0
,
lpszName
,
&
dwSize
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
dwRet
==
ERROR_SUCCESS
||
dwRet
==
ERROR_MORE_DATA
)
dwRet
=
SHDeleteKeyW
(
hSubKey
,
lpszName
);
}
if
(
dwRet
==
ERROR_NO_MORE_ITEMS
)
dwRet
=
ERROR_SUCCESS
;
if
(
lpszName
!=
szNameBuf
)
HeapFree
(
GetProcessHeap
(),
0
,
lpszName
);
/* Free buffer if allocated */
}
}
RegCloseKey
(
hSubKey
);
if
(
!
dwRet
)
dwRet
=
RegDeleteKeyW
(
hKey
,
lpszSubKey
);
}
return
dwRet
;
}
/*************************************************************************
* SHDeleteOrphanKeyA [SHLWAPI.@]
*
* Delete a registry key with no sub keys or values.
...
...
dlls/shlwapi/shlwapi.spec
View file @
5f42d67d
...
...
@@ -690,8 +690,8 @@
@ stdcall SHCreateThreadRef(ptr ptr) shcore.SHCreateThreadRef
@ stdcall SHDeleteEmptyKeyA(long str) shcore.SHDeleteEmptyKeyA
@ stdcall SHDeleteEmptyKeyW(long wstr) shcore.SHDeleteEmptyKeyW
@ stdcall SHDeleteKeyA(long str)
@ stdcall SHDeleteKeyW(long wstr)
@ stdcall SHDeleteKeyA(long str)
shcore.SHDeleteKeyA
@ stdcall SHDeleteKeyW(long wstr)
shcore.SHDeleteKeyW
@ stdcall SHDeleteOrphanKeyA(long str)
@ stdcall SHDeleteOrphanKeyW(long wstr)
@ stdcall SHDeleteValueA(long str str)
...
...
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