Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shcore/shcore.spec | 4 +-- dlls/shlwapi/reg.c | 68 --------------------------------------- dlls/shlwapi/shlwapi.spec | 4 +-- 3 files changed, 4 insertions(+), 72 deletions(-)
diff --git a/dlls/shcore/shcore.spec b/dlls/shcore/shcore.spec index 6ad1297989..4c2717948d 100644 --- a/dlls/shcore/shcore.spec +++ b/dlls/shcore/shcore.spec @@ -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) diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 163351995c..370161df12 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -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.@] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 30c34cb988..a51088dba8 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -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)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shlwapi/reg.c | 77 --------------------------------------- dlls/shlwapi/shlwapi.spec | 4 +- 2 files changed, 2 insertions(+), 79 deletions(-)
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 370161df12..5faad4a2d6 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -1513,83 +1513,6 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, return dwRet; }
-/************************************************************************* - * 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.@] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index a51088dba8..f8ffd36725 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -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)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shlwapi/reg.c | 45 --------------------------------------- dlls/shlwapi/shlwapi.spec | 4 ++-- 2 files changed, 2 insertions(+), 47 deletions(-)
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 5faad4a2d6..ffc1c303a6 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -1666,51 +1666,6 @@ LONG WINAPI SHEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpszSubKey, return RegEnumKeyExW(hKey, dwIndex, lpszSubKey, pwLen, NULL, NULL, NULL, NULL); }
-/************************************************************************* - * SHEnumValueA [SHLWAPI.@] - * - * Enumerate values in a registry key. - * - * PARAMS - * hKey [I] Handle to registry key - * dwIndex [I] Index of key to enumerate - * lpszValue [O] Pointer updated with the values name - * pwLen [O] Pointer updated with the values length - * pwType [O] Pointer updated with the values type - * pvData [O] Pointer updated with the values data - * pcbData [O] Pointer updated with the values size - * - * RETURNS - * Success: ERROR_SUCCESS. Output parameters are updated. - * Failure: An error code from RegEnumValueA(). - */ -LONG WINAPI SHEnumValueA(HKEY hKey, DWORD dwIndex, LPSTR lpszValue, - LPDWORD pwLen, LPDWORD pwType, - LPVOID pvData, LPDWORD pcbData) -{ - TRACE("(hkey=%p,%d,%s,%p,%p,%p,%p)\n", hKey, dwIndex, - debugstr_a(lpszValue), pwLen, pwType, pvData, pcbData); - - return RegEnumValueA(hKey, dwIndex, lpszValue, pwLen, NULL, - pwType, pvData, pcbData); -} - -/************************************************************************* - * SHEnumValueW [SHLWAPI.@] - * - * See SHEnumValueA. - */ -LONG WINAPI SHEnumValueW(HKEY hKey, DWORD dwIndex, LPWSTR lpszValue, - LPDWORD pwLen, LPDWORD pwType, - LPVOID pvData, LPDWORD pcbData) -{ - TRACE("(hkey=%p,%d,%s,%p,%p,%p,%p)\n", hKey, dwIndex, - debugstr_w(lpszValue), pwLen, pwType, pvData, pcbData); - - return RegEnumValueW(hKey, dwIndex, lpszValue, pwLen, NULL, - pwType, pvData, pcbData); -} - /************************************************************************* * @ [SHLWAPI.205] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index f8ffd36725..31fb6ad7e3 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -698,8 +698,8 @@ @ stdcall SHDeleteValueW(long wstr wstr) @ stdcall SHEnumKeyExA(long long str ptr) @ stdcall SHEnumKeyExW(long long wstr ptr) -@ stdcall SHEnumValueA(long long str ptr ptr ptr ptr) -@ stdcall SHEnumValueW(long long wstr ptr ptr ptr ptr) +@ stdcall SHEnumValueA(long long str ptr ptr ptr ptr) shcore.SHEnumValueA +@ stdcall SHEnumValueW(long long wstr ptr ptr ptr ptr) shcore.SHEnumValueW @ stdcall SHGetInverseCMAP ( ptr long ) @ stdcall SHGetThreadRef(ptr) shcore.SHGetThreadRef @ stdcall SHGetValueA ( long str str ptr ptr ptr )
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shlwapi/reg.c | 36 ------------------------------------ dlls/shlwapi/shlwapi.spec | 4 ++-- 2 files changed, 2 insertions(+), 38 deletions(-)
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index ffc1c303a6..e59d162a9f 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -1630,42 +1630,6 @@ DWORD WINAPI SHDeleteValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue) return dwRet; }
-/************************************************************************* - * SHEnumKeyExA [SHLWAPI.@] - * - * Enumerate sub keys in a registry key. - * - * PARAMS - * hKey [I] Handle to registry key - * dwIndex [I] Index of key to enumerate - * lpszSubKey [O] Pointer updated with the subkey name - * pwLen [O] Pointer updated with the subkey length - * - * RETURNS - * Success: ERROR_SUCCESS. lpszSubKey and pwLen are updated. - * Failure: An error code from RegEnumKeyExA(). - */ -LONG WINAPI SHEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpszSubKey, - LPDWORD pwLen) -{ - TRACE("(hkey=%p,%d,%s,%p)\n", hKey, dwIndex, debugstr_a(lpszSubKey), pwLen); - - return RegEnumKeyExA(hKey, dwIndex, lpszSubKey, pwLen, NULL, NULL, NULL, NULL); -} - -/************************************************************************* - * SHEnumKeyExW [SHLWAPI.@] - * - * See SHEnumKeyExA. - */ -LONG WINAPI SHEnumKeyExW(HKEY hKey, DWORD dwIndex, LPWSTR lpszSubKey, - LPDWORD pwLen) -{ - TRACE("(hkey=%p,%d,%s,%p)\n", hKey, dwIndex, debugstr_w(lpszSubKey), pwLen); - - return RegEnumKeyExW(hKey, dwIndex, lpszSubKey, pwLen, NULL, NULL, NULL, NULL); -} - /************************************************************************* * @ [SHLWAPI.205] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 31fb6ad7e3..37ca328448 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -696,8 +696,8 @@ @ stdcall SHDeleteOrphanKeyW(long wstr) @ stdcall SHDeleteValueA(long str str) @ stdcall SHDeleteValueW(long wstr wstr) -@ stdcall SHEnumKeyExA(long long str ptr) -@ stdcall SHEnumKeyExW(long long wstr ptr) +@ stdcall SHEnumKeyExA(long long str ptr) shcore.SHEnumKeyExA +@ stdcall SHEnumKeyExW(long long wstr ptr) shcore.SHEnumKeyExW @ stdcall SHEnumValueA(long long str ptr ptr ptr ptr) shcore.SHEnumValueA @ stdcall SHEnumValueW(long long wstr ptr ptr ptr ptr) shcore.SHEnumValueW @ stdcall SHGetInverseCMAP ( ptr long )
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shlwapi/reg.c | 31 ------------------------------- dlls/shlwapi/shlwapi.spec | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-)
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index e59d162a9f..fa091abd85 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -2131,37 +2131,6 @@ DWORD WINAPI SHCopyKeyW(HKEY hKeySrc, LPCWSTR lpszSrcSubKey, HKEY hKeyDst, DWORD * The following functions are ORDINAL ONLY: */
-/************************************************************************* - * @ [SHLWAPI.280] - * - * Read an integer value from the registry, falling back to a default. - * - * PARAMS - * hKey [I] Registry key to read from - * lpszValue [I] Value name to read - * iDefault [I] Default value to return - * - * RETURNS - * The value contained in the given registry value if present, otherwise - * iDefault. - */ -int WINAPI SHRegGetIntW(HKEY hKey, LPCWSTR lpszValue, int iDefault) -{ - TRACE("(%p,%s,%d)\n", hKey, debugstr_w(lpszValue), iDefault); - - if (hKey) - { - WCHAR szBuff[32]; - DWORD dwSize = sizeof(szBuff); - szBuff[0] = '\0'; - SHQueryValueExW(hKey, lpszValue, 0, 0, szBuff, &dwSize); - - if(*szBuff >= '0' && *szBuff <= '9') - return StrToIntW(szBuff); - } - return iDefault; -} - /************************************************************************* * @ [SHLWAPI.343] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 37ca328448..4c31724b48 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -277,7 +277,7 @@ 277 stub -noname SHDialogBox 278 stdcall -noname SHCreateWorkerWindowW(ptr ptr long long ptr long) 279 stdcall -noname SHInvokeDefaultCommand(ptr ptr ptr) -280 stdcall -ordinal SHRegGetIntW(ptr wstr long) +280 stdcall -ordinal SHRegGetIntW(ptr wstr long) shcore.SHRegGetIntW 281 stdcall -noname SHPackDispParamsV(ptr ptr long ptr) 282 varargs -noname SHPackDispParams(ptr ptr long) 283 stdcall -noname IConnectionPoint_InvokeWithCancel(ptr long long long long)