[ADVAPI32_VISTA] Import RegSetKeyValueW() from Wine Staging 1.7.55. CORE-10536

svn path=/trunk/; revision=69913
This commit is contained in:
Amine Khaldi 2015-11-17 11:17:12 +00:00
parent 1024999f67
commit 0e5679dd6d
3 changed files with 27 additions and 0 deletions

View file

@ -8,6 +8,7 @@ spec2def(advapi32_vista.dll advapi32_vista.spec ADD_IMPORTLIB)
list(APPEND SOURCE
DllMain.c
RegDeleteTree.c
RegSetKeyValue.c
${CMAKE_CURRENT_BINARY_DIR}/advapi32_vista.def)
add_library(advapi32_vista SHARED ${SOURCE})

View file

@ -0,0 +1,25 @@
#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;
}

View file

@ -1,3 +1,4 @@
@ stdcall RegDeleteTreeA(long str)
@ stdcall RegDeleteTreeW(long wstr)
@ stdcall RegSetKeyValueW(long wstr wstr long ptr long)