[ADVAPI32_VISTA] Import RegSetKeyValueW() from Wine Staging 1.7.55. CORE-10536
authorAmine Khaldi <amine.khaldi@reactos.org>
Tue, 17 Nov 2015 11:17:12 +0000 (11:17 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Tue, 17 Nov 2015 11:17:12 +0000 (11:17 +0000)
svn path=/trunk/; revision=69913

reactos/dll/win32/advapi32_vista/CMakeLists.txt
reactos/dll/win32/advapi32_vista/RegSetKeyValue.c [new file with mode: 0644]
reactos/dll/win32/advapi32_vista/advapi32_vista.spec

index 0b9d7a7..4ba2a0a 100644 (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})
diff --git a/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c b/reactos/dll/win32/advapi32_vista/RegSetKeyValue.c
new file mode 100644 (file)
index 0000000..8701eb8
--- /dev/null
@@ -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;
+}
index 4ba49c3..a3a38a6 100644 (file)
@@ -1,3 +1,4 @@
 
 @ stdcall RegDeleteTreeA(long str)
 @ stdcall RegDeleteTreeW(long wstr)
+@ stdcall RegSetKeyValueW(long wstr wstr long ptr long)