ReactOS  0.4.15-dev-2993-g14fbe80
RegSetKeyValue.c
Go to the documentation of this file.
1 
2 #include "advapi32_vista.h"
3 
4 /* Taken from Wine advapi32/registry.c */
5 
6 /******************************************************************************
7  * RegSetKeyValueW [ADVAPI32.@]
8  */
10 {
11  HKEY hsubkey = NULL;
12  DWORD ret;
13 
14  //TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_w(subkey), debugstr_w(name), type, data, len );
15 
16  if (subkey && subkey[0]) /* need to create the subkey */
17  {
18  if ((ret = RegCreateKeyW( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret;
19  hkey = hsubkey;
20  }
21 
22  ret = RegSetValueExW( hkey, name, 0, type, (const BYTE*)data, len );
23  if (hsubkey) RegCloseKey( hsubkey );
24  return ret;
25 }
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
LONG WINAPI RegSetKeyValueW(HKEY hkey, LPCWSTR subkey, LPCWSTR name, DWORD type, const void *data, DWORD len)
Definition: RegSetKeyValue.c:9
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
GLenum GLsizei len
Definition: glext.h:6722
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1199
unsigned char BYTE
Definition: xxhash.c:193
#define NULL
Definition: types.h:112
Definition: name.c:38
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545