diff --git a/reactos/dll/win32/advapi32_vista/CMakeLists.txt b/reactos/dll/win32/advapi32_vista/CMakeLists.txt index 0b9d7a75378..4ba2a0a537c 100644 --- a/reactos/dll/win32/advapi32_vista/CMakeLists.txt +++ b/reactos/dll/win32/advapi32_vista/CMakeLists.txt @@ -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}) diff --git a/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c b/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c new file mode 100644 index 00000000000..8701eb87df4 --- /dev/null +++ b/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c @@ -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; +} diff --git a/reactos/dll/win32/advapi32_vista/advapi32_vista.spec b/reactos/dll/win32/advapi32_vista/advapi32_vista.spec index 4ba49c3270a..a3a38a65b72 100644 --- a/reactos/dll/win32/advapi32_vista/advapi32_vista.spec +++ b/reactos/dll/win32/advapi32_vista/advapi32_vista.spec @@ -1,3 +1,4 @@ @ stdcall RegDeleteTreeA(long str) @ stdcall RegDeleteTreeW(long wstr) +@ stdcall RegSetKeyValueW(long wstr wstr long ptr long)