shlwapi: Forward SHSetValue() to shcore.dll.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-05-12 22:41:10 +03:00 committed by Alexandre Julliard
parent 975b270e69
commit 684fbf413b
3 changed files with 3 additions and 76 deletions

View File

@ -49,7 +49,7 @@
@ stdcall SHRegSetPathW(long wstr wstr wstr long) shlwapi.SHRegSetPathW
@ stdcall SHReleaseThreadRef() shlwapi.SHReleaseThreadRef
@ stdcall SHSetThreadRef(ptr) shlwapi.SHSetThreadRef
@ stdcall SHSetValueA(long str str long ptr long) shlwapi.SHSetValueA
@ stdcall SHSetValueA(long str str long ptr long) shlwapi.SHSetValueA
@ stdcall SHSetValueW(long wstr wstr long ptr long) shlwapi.SHSetValueW
@ stdcall SHStrDupW(wstr ptr) shlwapi.SHStrDupW
@ stdcall SHUnicodeToAnsi(wstr ptr ptr) shlwapi.SHUnicodeToAnsi

View File

@ -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.@]
*

View File

@ -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)