reactos/dll/win32/advapi32_vista/RegSetKeyValue.c

26 lines
768 B
C
Raw Normal View History

#include "advapi32_vista.h"
/* Taken from Wine advapi32/registry.c */
/******************************************************************************
* RegSetKeyValueW [ADVAPI32.@]
*/
LONG WINAPI RegSetKeyValueW( HKEY hkey, LPCWSTR subkey, LPCWSTR name, DWORD type, const void *data, DWORD len )
{
HKEY hsubkey = NULL;
DWORD ret;
//TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_w(subkey), debugstr_w(name), type, data, len );
if (subkey && subkey[0]) /* need to create the subkey */
{
if ((ret = RegCreateKeyW( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret;
hkey = hsubkey;
}
ret = RegSetValueExW( hkey, name, 0, type, (const BYTE*)data, len );
if (hsubkey) RegCloseKey( hsubkey );
return ret;
}