Commit a587b793 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shlwapi: Forward SHDeleteEmptyKey() to shcore.

parent ac516a70
......@@ -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
......
......@@ -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)
......
......@@ -1591,74 +1591,6 @@ DWORD WINAPI SHDeleteKeyW(HKEY hKey, LPCWSTR lpszSubKey)
}
/*************************************************************************
* 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.@]
*
* Delete a registry key with no sub keys or values.
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment