shlwapi: Forward SHDeleteEmptyKey() to shcore.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-12-04 08:02:48 +03:00 committed by Alexandre Julliard
parent ac516a700c
commit a587b7938b
4 changed files with 6 additions and 74 deletions

View File

@ -19,8 +19,8 @@
@ stdcall SHCreateStreamOnFileEx(wstr long long long ptr ptr) shlwapi.SHCreateStreamOnFileEx
@ stdcall SHCreateStreamOnFileW(wstr long ptr) shlwapi.SHCreateStreamOnFileW
@ stdcall SHCreateThreadRef(ptr ptr) shlwapi.SHCreateThreadRef
@ stdcall SHDeleteEmptyKeyA(long ptr) shlwapi.SHDeleteEmptyKeyA
@ stdcall SHDeleteEmptyKeyW(long ptr) shlwapi.SHDeleteEmptyKeyW
@ stdcall SHDeleteEmptyKeyA(long str) shlwapi.SHDeleteEmptyKeyA
@ stdcall SHDeleteEmptyKeyW(long wstr) shlwapi.SHDeleteEmptyKeyW
@ stdcall SHDeleteKeyA(long str) shlwapi.SHDeleteKeyA
@ stdcall SHDeleteKeyW(long wstr) shlwapi.SHDeleteKeyW
@ stdcall SHDeleteValueA(long str str) shlwapi.SHDeleteValueA

View File

@ -40,8 +40,8 @@
@ stdcall SHCreateThread(ptr ptr long ptr)
@ stdcall SHCreateThreadRef(ptr ptr)
@ stub SHCreateThreadWithHandle
@ stdcall SHDeleteEmptyKeyA(long ptr)
@ stdcall SHDeleteEmptyKeyW(long ptr)
@ stdcall SHDeleteEmptyKeyA(long str)
@ stdcall SHDeleteEmptyKeyW(long wstr)
@ stdcall SHDeleteKeyA(long str)
@ stdcall SHDeleteKeyW(long wstr)
@ stdcall SHDeleteValueA(long str str)

View File

@ -1590,74 +1590,6 @@ DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey)
return dwRet;
}
/*************************************************************************
* SHDeleteEmptyKeyA [SHLWAPI.@]
*
* Delete a registry key with no sub keys.
*
* PARAMS
* hKey [I] Handle to registry key
* lpszSubKey [I] Name of sub key to delete
*
* RETURNS
* Success: ERROR_SUCCESS. The key is deleted.
* Failure: If the key is not empty, returns ERROR_KEY_HAS_CHILDREN. Otherwise
* returns an error code from RegOpenKeyExA(), RegQueryInfoKeyA() or
* RegDeleteKeyA().
*/
DWORD WINAPI SHDeleteEmptyKeyA(HKEY hKey, LPCSTR lpszSubKey)
{
DWORD dwRet, dwKeyCount = 0;
HKEY hSubKey = 0;
TRACE("(hkey=%p,%s)\n", hKey, debugstr_a(lpszSubKey));
dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
if(!dwRet)
{
dwRet = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, &dwKeyCount,
NULL, NULL, NULL, NULL, NULL, NULL, NULL);
RegCloseKey(hSubKey);
if(!dwRet)
{
if (!dwKeyCount)
dwRet = RegDeleteKeyA(hKey, lpszSubKey);
else
dwRet = ERROR_KEY_HAS_CHILDREN;
}
}
return dwRet;
}
/*************************************************************************
* SHDeleteEmptyKeyW [SHLWAPI.@]
*
* See SHDeleteEmptyKeyA.
*/
DWORD WINAPI SHDeleteEmptyKeyW(HKEY hKey, LPCWSTR lpszSubKey)
{
DWORD dwRet, dwKeyCount = 0;
HKEY hSubKey = 0;
TRACE("(hkey=%p, %s)\n", hKey, debugstr_w(lpszSubKey));
dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey);
if(!dwRet)
{
dwRet = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &dwKeyCount,
NULL, NULL, NULL, NULL, NULL, NULL, NULL);
RegCloseKey(hSubKey);
if(!dwRet)
{
if (!dwKeyCount)
dwRet = RegDeleteKeyW(hKey, lpszSubKey);
else
dwRet = ERROR_KEY_HAS_CHILDREN;
}
}
return dwRet;
}
/*************************************************************************
* SHDeleteOrphanKeyA [SHLWAPI.@]
*

View File

@ -688,8 +688,8 @@
@ stdcall SHCreateStreamOnFileW(wstr long ptr) shcore.SHCreateStreamOnFileW
@ stdcall SHCreateStreamWrapper(ptr ptr long ptr)
@ stdcall SHCreateThreadRef(ptr ptr) shcore.SHCreateThreadRef
@ stdcall SHDeleteEmptyKeyA(long ptr)
@ stdcall SHDeleteEmptyKeyW(long ptr)
@ stdcall SHDeleteEmptyKeyA(long str) shcore.SHDeleteEmptyKeyA
@ stdcall SHDeleteEmptyKeyW(long wstr) shcore.SHDeleteEmptyKeyW
@ stdcall SHDeleteKeyA(long str)
@ stdcall SHDeleteKeyW(long wstr)
@ stdcall SHDeleteOrphanKeyA(long str)