Commit 684fbf41 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shlwapi: Forward SHSetValue() to shcore.dll.

parent 975b270e
......@@ -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
......
......@@ -48,79 +48,6 @@ 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.@]
*
* Get a value from the registry, expanding environment variable strings.
......
......@@ -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)
......
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