Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shlwapi/reg.c | 31 ------------------------------- dlls/shlwapi/shlwapi.spec | 4 ++-- 2 files changed, 2 insertions(+), 33 deletions(-)
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index f33047ab38..83d83d3cb2 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -120,37 +120,6 @@ DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, return dwRet; }
-/************************************************************************* - * SHQueryInfoKeyA [SHLWAPI.@] - * - * Get information about a registry key. See RegQueryInfoKeyA(). - * - * RETURNS - * The result of calling RegQueryInfoKeyA(). - */ -LONG WINAPI SHQueryInfoKeyA(HKEY hKey, LPDWORD pwSubKeys, LPDWORD pwSubKeyMax, - LPDWORD pwValues, LPDWORD pwValueMax) -{ - TRACE("(hkey=%p,%p,%p,%p,%p)\n", hKey, pwSubKeys, pwSubKeyMax, - pwValues, pwValueMax); - return RegQueryInfoKeyA(hKey, NULL, NULL, NULL, pwSubKeys, pwSubKeyMax, - NULL, pwValues, pwValueMax, NULL, NULL, NULL); -} - -/************************************************************************* - * SHQueryInfoKeyW [SHLWAPI.@] - * - * See SHQueryInfoKeyA. - */ -LONG WINAPI SHQueryInfoKeyW(HKEY hKey, LPDWORD pwSubKeys, LPDWORD pwSubKeyMax, - LPDWORD pwValues, LPDWORD pwValueMax) -{ - TRACE("(hkey=%p,%p,%p,%p,%p)\n", hKey, pwSubKeys, pwSubKeyMax, - pwValues, pwValueMax); - return RegQueryInfoKeyW(hKey, NULL, NULL, NULL, pwSubKeys, pwSubKeyMax, - NULL, pwValues, pwValueMax, NULL, NULL, NULL); -} - /************************************************************************* * SHQueryValueExA [SHLWAPI.@] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index a0782607a7..98a3ab7d99 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -709,8 +709,8 @@ @ stdcall SHOpenRegStream2W(long wstr wstr long) shcore.SHOpenRegStream2W @ stdcall SHOpenRegStreamA(long str str long) shcore.SHOpenRegStreamA @ stdcall SHOpenRegStreamW(long wstr wstr long) shcore.SHOpenRegStreamW -@ stdcall SHQueryInfoKeyA(long ptr ptr ptr ptr) -@ stdcall SHQueryInfoKeyW(long ptr ptr ptr ptr) +@ stdcall -import SHQueryInfoKeyA(long ptr ptr ptr ptr) +@ stdcall -import SHQueryInfoKeyW(long ptr ptr ptr ptr) @ stdcall SHQueryValueExA(long str ptr ptr ptr ptr) @ stdcall SHQueryValueExW(long wstr ptr ptr ptr ptr) @ stdcall SHRegCloseUSKey(ptr)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shlwapi/reg.c | 51 --------------------------------------- dlls/shlwapi/shlwapi.spec | 4 +-- 2 files changed, 2 insertions(+), 53 deletions(-)
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 83d83d3cb2..0c982384b3 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -342,57 +342,6 @@ DWORD WINAPI SHDeleteOrphanKeyW(HKEY hKey, LPCWSTR lpszSubKey) return dwRet; }
-/************************************************************************* - * SHDeleteValueA [SHLWAPI.@] - * - * Delete a value from the registry. - * - * PARAMS - * hKey [I] Handle to registry key - * lpszSubKey [I] Name of sub key containing value to delete - * lpszValue [I] Name of value to delete - * - * RETURNS - * Success: ERROR_SUCCESS. The value is deleted. - * Failure: An error code from RegOpenKeyExA() or RegDeleteValueA(). - */ -DWORD WINAPI SHDeleteValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue) -{ - DWORD dwRet; - HKEY hSubKey; - - TRACE("(hkey=%p,%s,%s)\n", hKey, debugstr_a(lpszSubKey), debugstr_a(lpszValue)); - - dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_SET_VALUE, &hSubKey); - if (!dwRet) - { - dwRet = RegDeleteValueA(hSubKey, lpszValue); - RegCloseKey(hSubKey); - } - return dwRet; -} - -/************************************************************************* - * SHDeleteValueW [SHLWAPI.@] - * - * See SHDeleteValueA. - */ -DWORD WINAPI SHDeleteValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue) -{ - DWORD dwRet; - HKEY hSubKey; - - TRACE("(hkey=%p,%s,%s)\n", hKey, debugstr_w(lpszSubKey), debugstr_w(lpszValue)); - - dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_SET_VALUE, &hSubKey); - if (!dwRet) - { - dwRet = RegDeleteValueW(hSubKey, lpszValue); - RegCloseKey(hSubKey); - } - return dwRet; -} - /************************************************************************* * @ [SHLWAPI.205] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 98a3ab7d99..de25ed58c1 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -694,8 +694,8 @@ @ stdcall SHDeleteKeyW(long wstr) shcore.SHDeleteKeyW @ stdcall SHDeleteOrphanKeyA(long str) @ stdcall SHDeleteOrphanKeyW(long wstr) -@ stdcall SHDeleteValueA(long str str) -@ stdcall SHDeleteValueW(long wstr wstr) +@ stdcall -import SHDeleteValueA(long str str) +@ stdcall -import SHDeleteValueW(long wstr wstr) @ 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
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shlwapi/reg.c | 73 --------------------------------------- dlls/shlwapi/shlwapi.spec | 4 +-- 2 files changed, 2 insertions(+), 75 deletions(-)
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 0c982384b3..78188e8fcb 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -47,79 +47,6 @@ static const WCHAR szExtensionW[] = { 'E', 'x', 't','e','n','s','i','o','n','\0' INT WINAPI SHStringFromGUIDW(REFGUID,LPWSTR,INT); HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID,LPCWSTR,BOOL,BOOL,PHKEY);
-/************************************************************************* - * SHSetValueA [SHLWAPI.@] - * - * Set a value in the registry. - * - * PARAMS - * hKey [I] Handle to registry key - * lpszSubKey [I] Name of sub key under hKey - * lpszValue [I] Name of value to set - * dwType [I] Type of the value - * pvData [I] Data of the value - * cbData [I] Size of the value - * - * RETURNS - * Success: ERROR_SUCCESS. The value is set with the data given. - * Failure: An error code from RegCreateKeyExA() or RegSetValueExA() - * - * NOTES - * If lpszSubKey does not exist, it is created before the value is set. If - * lpszSubKey is NULL or an empty string, then the value is added directly - * to hKey instead. - */ -DWORD WINAPI SHSetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, - DWORD dwType, LPCVOID pvData, DWORD cbData) -{ - DWORD dwRet = ERROR_SUCCESS, dwDummy; - HKEY hSubKey; - - TRACE("(hkey=%p,%s,%s,%d,%p,%d)\n", hKey, debugstr_a(lpszSubKey), - debugstr_a(lpszValue), dwType, pvData, cbData); - - if (lpszSubKey && *lpszSubKey) - dwRet = RegCreateKeyExA(hKey, lpszSubKey, 0, NULL, - 0, KEY_SET_VALUE, NULL, &hSubKey, &dwDummy); - else - hSubKey = hKey; - if (!dwRet) - { - dwRet = RegSetValueExA(hSubKey, lpszValue, 0, dwType, pvData, cbData); - if (hSubKey != hKey) - RegCloseKey(hSubKey); - } - return dwRet; -} - -/************************************************************************* - * SHSetValueW [SHLWAPI.@] - * - * See SHSetValueA. - */ -DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, - DWORD dwType, LPCVOID pvData, DWORD cbData) -{ - DWORD dwRet = ERROR_SUCCESS, dwDummy; - HKEY hSubKey; - - TRACE("(hkey=%p,%s,%s,%d,%p,%d)\n", hKey, debugstr_w(lpszSubKey), - debugstr_w(lpszValue), dwType, pvData, cbData); - - if (lpszSubKey && *lpszSubKey) - dwRet = RegCreateKeyExW(hKey, lpszSubKey, 0, NULL, - 0, KEY_SET_VALUE, NULL, &hSubKey, &dwDummy); - else - hSubKey = hKey; - if (!dwRet) - { - dwRet = RegSetValueExW(hSubKey, lpszValue, 0, dwType, pvData, cbData); - if (hSubKey != hKey) - RegCloseKey(hSubKey); - } - return dwRet; -} - /************************************************************************* * SHQueryValueExA [SHLWAPI.@] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index de25ed58c1..ed7810c676 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -748,8 +748,8 @@ @ stdcall SHRegisterValidateTemplate(wstr long) @ stdcall SHReleaseThreadRef() shcore.SHReleaseThreadRef @ stdcall SHSetThreadRef(ptr) shcore.SHSetThreadRef -@ stdcall SHSetValueA (long str str long ptr long) -@ stdcall SHSetValueW (long wstr wstr long ptr long) +@ stdcall -import SHSetValueA(long str str long ptr long) +@ stdcall -import SHSetValueW(long wstr wstr long ptr long) @ stdcall SHSkipJunction(ptr ptr) @ stdcall SHStrDupA (str ptr) @ stdcall SHStrDupW (wstr ptr)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shlwapi/reg.c | 171 -------------------------------------- dlls/shlwapi/shlwapi.spec | 4 +- 2 files changed, 2 insertions(+), 173 deletions(-)
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 78188e8fcb..44e3bde56e 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -47,162 +47,6 @@ static const WCHAR szExtensionW[] = { 'E', 'x', 't','e','n','s','i','o','n','\0' INT WINAPI SHStringFromGUIDW(REFGUID,LPWSTR,INT); HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID,LPCWSTR,BOOL,BOOL,PHKEY);
-/************************************************************************* - * SHQueryValueExA [SHLWAPI.@] - * - * Get a value from the registry, expanding environment variable strings. - * - * PARAMS - * hKey [I] Handle to registry key - * lpszValue [I] Name of value to query - * lpReserved [O] Reserved for future use; must be NULL - * pwType [O] Optional pointer updated with the values type - * pvData [O] Optional pointer updated with the values data - * pcbData [O] Optional pointer updated with the values size - * - * RETURNS - * Success: ERROR_SUCCESS. Any non NULL output parameters are updated with - * information about the value. - * Failure: ERROR_OUTOFMEMORY if memory allocation fails, or the type of the - * data is REG_EXPAND_SZ and pcbData is NULL. Otherwise an error - * code from RegQueryValueExA() or ExpandEnvironmentStringsA(). - * - * NOTES - * Either pwType, pvData or pcbData may be NULL if the caller doesn't want - * the type, data or size information for the value. - * - * If the type of the data is REG_EXPAND_SZ, it is expanded to REG_SZ. The - * value returned will be truncated if it is of type REG_SZ and bigger than - * the buffer given to store it. - * - * REG_EXPAND_SZ: - * case-1: the unexpanded string is smaller than the expanded one - * subcase-1: the buffer is too small to hold the unexpanded string: - * function fails and returns the size of the unexpanded string. - * - * subcase-2: buffer is too small to hold the expanded string: - * the function return success (!!) and the result is truncated - * *** This is clearly an error in the native implementation. *** - * - * case-2: the unexpanded string is bigger than the expanded one - * The buffer must have enough space to hold the unexpanded - * string even if the result is smaller. - * - */ -DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue, - LPDWORD lpReserved, LPDWORD pwType, - LPVOID pvData, LPDWORD pcbData) -{ - DWORD dwRet, dwType, dwUnExpDataLen = 0, dwExpDataLen; - - TRACE("(hkey=%p,%s,%p,%p,%p,%p=%d)\n", hKey, debugstr_a(lpszValue), - lpReserved, pwType, pvData, pcbData, pcbData ? *pcbData : 0); - - if (pcbData) dwUnExpDataLen = *pcbData; - - dwRet = RegQueryValueExA(hKey, lpszValue, lpReserved, &dwType, pvData, &dwUnExpDataLen); - - if (pcbData && (dwType == REG_EXPAND_SZ)) - { - DWORD nBytesToAlloc; - - /* Expand type REG_EXPAND_SZ into REG_SZ */ - LPSTR szData; - - /* If the caller didn't supply a buffer or the buffer is too small we have - * to allocate our own - */ - if ((!pvData) || (dwRet == ERROR_MORE_DATA) ) - { - char cNull = '\0'; - nBytesToAlloc = dwUnExpDataLen; - - szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc); - RegQueryValueExA (hKey, lpszValue, lpReserved, NULL, (LPBYTE)szData, &nBytesToAlloc); - dwExpDataLen = ExpandEnvironmentStringsA(szData, &cNull, 1); - dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen); - LocalFree(szData); - } - else - { - nBytesToAlloc = (lstrlenA(pvData)+1) * sizeof (CHAR); - szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc); - lstrcpyA(szData, pvData); - dwExpDataLen = ExpandEnvironmentStringsA(szData, pvData, *pcbData / sizeof(CHAR)); - if (dwExpDataLen > *pcbData) dwRet = ERROR_MORE_DATA; - dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen); - LocalFree(szData); - } - } - - /* Update the type and data size if the caller wanted them */ - if ( dwType == REG_EXPAND_SZ ) dwType = REG_SZ; - if ( pwType ) *pwType = dwType; - if ( pcbData ) *pcbData = dwUnExpDataLen; - return dwRet; -} - - -/************************************************************************* - * SHQueryValueExW [SHLWAPI.@] - * - * See SHQueryValueExA. - */ -DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, - LPDWORD lpReserved, LPDWORD pwType, - LPVOID pvData, LPDWORD pcbData) -{ - DWORD dwRet, dwType, dwUnExpDataLen = 0, dwExpDataLen; - - TRACE("(hkey=%p,%s,%p,%p,%p,%p=%d)\n", hKey, debugstr_w(lpszValue), - lpReserved, pwType, pvData, pcbData, pcbData ? *pcbData : 0); - - if (pcbData) dwUnExpDataLen = *pcbData; - - dwRet = RegQueryValueExW(hKey, lpszValue, lpReserved, &dwType, pvData, &dwUnExpDataLen); - if (dwRet!=ERROR_SUCCESS && dwRet!=ERROR_MORE_DATA) - return dwRet; - - if (pcbData && (dwType == REG_EXPAND_SZ)) - { - DWORD nBytesToAlloc; - - /* Expand type REG_EXPAND_SZ into REG_SZ */ - LPWSTR szData; - - /* If the caller didn't supply a buffer or the buffer is too small we have - * to allocate our own - */ - if ((!pvData) || (dwRet == ERROR_MORE_DATA) ) - { - WCHAR cNull = '\0'; - nBytesToAlloc = dwUnExpDataLen; - - szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc); - RegQueryValueExW (hKey, lpszValue, lpReserved, NULL, (LPBYTE)szData, &nBytesToAlloc); - dwExpDataLen = ExpandEnvironmentStringsW(szData, &cNull, 1); - dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen); - LocalFree(szData); - } - else - { - nBytesToAlloc = (lstrlenW(pvData) + 1) * sizeof(WCHAR); - szData = LocalAlloc(LMEM_ZEROINIT, nBytesToAlloc); - lstrcpyW(szData, pvData); - dwExpDataLen = ExpandEnvironmentStringsW(szData, pvData, *pcbData/sizeof(WCHAR) ); - if (dwExpDataLen > *pcbData) dwRet = ERROR_MORE_DATA; - dwUnExpDataLen = max(nBytesToAlloc, dwExpDataLen); - LocalFree(szData); - } - } - - /* Update the type and data size if the caller wanted them */ - if ( dwType == REG_EXPAND_SZ ) dwType = REG_SZ; - if ( pwType ) *pwType = dwType; - if ( pcbData ) *pcbData = dwUnExpDataLen; - return dwRet; -} - /************************************************************************* * SHDeleteOrphanKeyA [SHLWAPI.@] * @@ -272,20 +116,6 @@ DWORD WINAPI SHDeleteOrphanKeyW(HKEY hKey, LPCWSTR lpszSubKey) /************************************************************************* * @ [SHLWAPI.205] * - * Get a value from the registry. - * - * PARAMS - * hKey [I] Handle to registry key - * pSubKey [I] Name of sub key containing value to get - * pValue [I] Name of value to get - * pwType [O] Destination for the values type - * pvData [O] Destination for the values data - * pbData [O] Destination for the values size - * - * RETURNS - * Success: ERROR_SUCCESS. Output parameters contain the details read. - * Failure: An error code from RegOpenKeyExA() or SHQueryValueExA(), - * or ERROR_INVALID_FUNCTION in the machine is in safe mode. */ DWORD WINAPI SHGetValueGoodBootA(HKEY hkey, LPCSTR pSubKey, LPCSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pbData) @@ -298,7 +128,6 @@ DWORD WINAPI SHGetValueGoodBootA(HKEY hkey, LPCSTR pSubKey, LPCSTR pValue, /************************************************************************* * @ [SHLWAPI.206] * - * Unicode version of SHGetValueGoodBootW. */ DWORD WINAPI SHGetValueGoodBootW(HKEY hkey, LPCWSTR pSubKey, LPCWSTR pValue, LPDWORD pwType, LPVOID pvData, LPDWORD pbData) diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index ed7810c676..b126a46a78 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -711,8 +711,8 @@ @ stdcall SHOpenRegStreamW(long wstr wstr long) shcore.SHOpenRegStreamW @ stdcall -import SHQueryInfoKeyA(long ptr ptr ptr ptr) @ stdcall -import SHQueryInfoKeyW(long ptr ptr ptr ptr) -@ stdcall SHQueryValueExA(long str ptr ptr ptr ptr) -@ stdcall SHQueryValueExW(long wstr ptr ptr ptr ptr) +@ stdcall -import SHQueryValueExA(long str ptr ptr ptr ptr) +@ stdcall -import SHQueryValueExW(long wstr ptr ptr ptr ptr) @ stdcall SHRegCloseUSKey(ptr) @ stdcall SHRegCreateUSKeyA(str long long ptr long) @ stdcall SHRegCreateUSKeyW(wstr long long ptr long)