ReactOS  0.4.14-dev-593-g1793dcc
reg.c File Reference
#include <windows.h>
#include <errno.h>
#include <stdlib.h>
#include <wine/unicode.h>
#include <wine/debug.h>
#include <wine/heap.h>
#include "reg.h"
Include dependency graph for reg.c:

Go to the source code of this file.

Enumerations

enum  operations {
  REG_ADD, REG_DELETE, REG_IMPORT, REG_EXPORT,
  REG_QUERY, REG_SAVE, REG_RESTORE, REG_INVALID
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (reg)
 
voidheap_xalloc (size_t size)
 
voidheap_xrealloc (void *buf, size_t size)
 
void output_writeconsole (const WCHAR *str, DWORD wlen)
 
static void output_formatstring (const WCHAR *fmt, __ms_va_list va_args)
 
static void output_error (LSTATUS status)
 
void WINAPIV output_message (unsigned int id,...)
 
static void WINAPIV output_string (const WCHAR *fmt,...)
 
BOOL ask_confirm (unsigned int msgid, WCHAR *reg_info)
 
static BOOL path_rootname_cmp (const WCHAR *input_path, const WCHAR *rootkey_name)
 
HKEY path_get_rootkey (const WCHAR *path)
 
static DWORD wchar_get_type (const WCHAR *type_name)
 
static BYTE hexchar_to_byte (WCHAR ch)
 
static LPBYTE get_regdata (const WCHAR *data, DWORD reg_type, WCHAR separator, DWORD *reg_count)
 
static BOOL sane_path (const WCHAR *key)
 
static int reg_add (HKEY root, WCHAR *path, WCHAR *value_name, BOOL value_empty, WCHAR *type, WCHAR separator, WCHAR *data, BOOL force)
 
static int reg_delete (HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL value_all, BOOL force)
 
static WCHARreg_data_to_wchar (DWORD type, const BYTE *src, DWORD size_bytes)
 
static const WCHARreg_type_to_wchar (DWORD type)
 
static void output_value (const WCHAR *value_name, DWORD type, BYTE *data, DWORD data_size)
 
WCHARbuild_subkey_path (WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len)
 
static int query_value (HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse)
 
static int query_all (HKEY key, WCHAR *path, BOOL recurse)
 
static int reg_query (HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL recurse)
 
static WCHARget_long_key (HKEY root, WCHAR *path)
 
BOOL parse_registry_key (const WCHAR *key, HKEY *root, WCHAR **path, WCHAR **long_key)
 
static BOOL is_switch (const WCHAR *s, const WCHAR c)
 
static BOOL set_privilege (LPCWSTR privilegeName, BOOL enabled)
 
static int reg_save (int argc, WCHAR *argv[])
 
static int reg_restore (int argc, WCHAR *argv[])
 
static BOOL is_help_switch (const WCHAR *s)
 
static enum operations get_operation (const WCHAR *str, int *op_help)
 
int wmain (int argc, WCHAR *argvW[])
 

Variables

static const WCHAR short_hklm [] = {'H','K','L','M',0}
 
static const WCHAR short_hkcu [] = {'H','K','C','U',0}
 
static const WCHAR short_hkcr [] = {'H','K','C','R',0}
 
static const WCHAR short_hku [] = {'H','K','U',0}
 
static const WCHAR short_hkcc [] = {'H','K','C','C',0}
 
static const WCHAR long_hklm [] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E',0}
 
static const WCHAR long_hkcu [] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R',0}
 
static const WCHAR long_hkcr [] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}
 
static const WCHAR long_hku [] = {'H','K','E','Y','_','U','S','E','R','S',0}
 
static const WCHAR long_hkcc [] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','C','O','N','F','I','G',0}
 
struct {
   HKEY   key
 
   const WCHAR *   short_name
 
   const WCHAR *   long_name
 
root_rels []
 
static const WCHAR type_none [] = {'R','E','G','_','N','O','N','E',0}
 
static const WCHAR type_sz [] = {'R','E','G','_','S','Z',0}
 
static const WCHAR type_expand_sz [] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0}
 
static const WCHAR type_binary [] = {'R','E','G','_','B','I','N','A','R','Y',0}
 
static const WCHAR type_dword [] = {'R','E','G','_','D','W','O','R','D',0}
 
static const WCHAR type_dword_le [] = {'R','E','G','_','D','W','O','R','D','_','L','I','T','T','L','E','_','E','N','D','I','A','N',0}
 
static const WCHAR type_dword_be [] = {'R','E','G','_','D','W','O','R','D','_','B','I','G','_','E','N','D','I','A','N',0}
 
static const WCHAR type_multi_sz [] = {'R','E','G','_','M','U','L','T','I','_','S','Z',0}
 
struct {
   DWORD   type
 
   const WCHAR *   name
 
type_rels []
 
static const WCHAR newlineW [] = {'\n',0}
 
static unsigned int num_values_found = 0
 

Enumeration Type Documentation

◆ operations

Enumerator
REG_ADD 
REG_DELETE 
REG_IMPORT 
REG_EXPORT 
REG_QUERY 
REG_SAVE 
REG_RESTORE 
REG_INVALID 

Definition at line 1055 of file reg.c.

1055  {
1056  REG_ADD,
1057  REG_DELETE,
1058  REG_IMPORT,
1059  REG_EXPORT,
1060  REG_QUERY,
1061  REG_SAVE,
1062  REG_RESTORE,
1063  REG_INVALID
1064 };
Definition: reg.c:1061
Definition: reg.c:1056

Function Documentation

◆ ask_confirm()

BOOL ask_confirm ( unsigned int  msgid,
WCHAR reg_info 
)

Definition at line 189 of file reg.c.

190 {
191  HMODULE hmod;
192  WCHAR Ybuffer[4];
193  WCHAR Nbuffer[4];
194  WCHAR defval[32];
195  WCHAR answer[MAX_PATH];
196  WCHAR *str;
197  DWORD count;
198 
200  LoadStringW(hmod, STRING_YES, Ybuffer, ARRAY_SIZE(Ybuffer));
201  LoadStringW(hmod, STRING_NO, Nbuffer, ARRAY_SIZE(Nbuffer));
202  LoadStringW(hmod, STRING_DEFAULT_VALUE, defval, ARRAY_SIZE(defval));
203 
204  str = (reg_info && *reg_info) ? reg_info : defval;
205 
206  while (1)
207  {
208  output_message(msgid, str);
211  answer[0] = toupperW(answer[0]);
212  if (answer[0] == Ybuffer[0])
213  return TRUE;
214  if (answer[0] == Nbuffer[0])
215  return FALSE;
216  }
217 }
#define TRUE
Definition: types.h:120
#define STRING_NO
Definition: resource.h:42
GLuint GLuint GLsizei count
Definition: gl.h:1545
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define STRING_YES
Definition: resource.h:41
#define STD_INPUT_HANDLE
Definition: winbase.h:264
WINE_UNICODE_INLINE WCHAR toupperW(WCHAR ch)
Definition: unicode.h:141
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleW(IN HANDLE hConsoleInput, OUT LPVOID lpBuffer, IN DWORD nNumberOfCharsToRead, OUT LPDWORD lpNumberOfCharsRead, IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
Definition: readwrite.c:1176
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:141
#define STRING_DEFAULT_VALUE
Definition: resource.h:44
#define ARRAY_SIZE(a)
Definition: main.h:24
#define STRING_YESNO
Definition: resource.h:40
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847

Referenced by get_file_handle(), reg_add(), reg_delete(), and reg_save().

◆ build_subkey_path()

WCHAR* build_subkey_path ( WCHAR path,
DWORD  path_len,
WCHAR subkey_name,
DWORD  subkey_len 
)

Definition at line 649 of file reg.c.

650 {
651  WCHAR *subkey_path;
652  static const WCHAR fmt[] = {'%','s','\\','%','s',0};
653 
654  subkey_path = heap_xalloc((path_len + subkey_len + 2) * sizeof(WCHAR));
655  sprintfW(subkey_path, fmt, path, subkey_name);
656 
657  return subkey_path;
658 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD path_len
Definition: batch.c:31
#define sprintfW
Definition: unicode.h:58
void * heap_xalloc(size_t size)
Definition: reg.c:83
Definition: dsound.c:943

Referenced by export_registry_data(), query_all(), and query_value().

◆ get_long_key()

static WCHAR* get_long_key ( HKEY  root,
WCHAR path 
)
static

Definition at line 853 of file reg.c.

854 {
856  WCHAR *long_key;
857  WCHAR fmt[] = {'%','s','\\','%','s',0};
858 
859  for (i = 0; i < array_size; i++)
860  {
861  if (root == root_rels[i].key)
862  break;
863  }
864 
866 
867  if (!path)
868  {
869  long_key = heap_xalloc((len + 1) * sizeof(WCHAR));
870  strcpyW(long_key, root_rels[i].long_name);
871  return long_key;
872  }
873 
874  len += strlenW(path) + 1; /* add one for the backslash */
875  long_key = heap_xalloc((len + 1) * sizeof(WCHAR));
876  sprintfW(long_key, fmt, root_rels[i].long_name, path);
877  return long_key;
878 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static UINT array_size
Definition: msctf.c:67
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * long_name
Definition: reg.c:44
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define ARRAY_SIZE(a)
Definition: main.h:24
#define sprintfW
Definition: unicode.h:58
void * heap_xalloc(size_t size)
Definition: reg.c:83
static const struct @2 root_rels[]
Definition: dsound.c:943
Definition: path.c:41

Referenced by parse_registry_key().

◆ get_operation()

static enum operations get_operation ( const WCHAR str,
int op_help 
)
static

Definition at line 1066 of file reg.c.

1067 {
1068  struct op_info { const WCHAR *op; int id; int help_id; };
1069 
1070  static const WCHAR add[] = {'a','d','d',0};
1071  static const WCHAR delete[] = {'d','e','l','e','t','e',0};
1072  static const WCHAR import[] = {'i','m','p','o','r','t',0};
1073  static const WCHAR export[] = {'e','x','p','o','r','t',0};
1074  static const WCHAR query[] = {'q','u','e','r','y',0};
1075  static const WCHAR save[] = L"save";
1076  static const WCHAR restore[] = L"restore";
1077 
1078  static const struct op_info op_array[] =
1079  {
1081  { delete, REG_DELETE, STRING_DELETE_USAGE },
1082  { import, REG_IMPORT, STRING_IMPORT_USAGE },
1083  { export, REG_EXPORT, STRING_EXPORT_USAGE },
1085  { save, REG_SAVE, STRING_SAVE_USAGE },
1086  { restore, REG_RESTORE, STRING_RESTORE_USAGE },
1087  { NULL, -1, 0 }
1088  };
1089 
1090  const struct op_info *ptr;
1091 
1092  for (ptr = op_array; ptr->op; ptr++)
1093  {
1094  if (!lstrcmpiW(str, ptr->op))
1095  {
1096  *op_help = ptr->help_id;
1097  return ptr->id;
1098  }
1099  }
1100 
1101  return REG_INVALID;
1102 }
int add
Definition: i386-dis.c:3122
#define STRING_SAVE_USAGE
Definition: resource.h:64
#define STRING_RESTORE_USAGE
Definition: resource.h:65
#define STRING_QUERY_USAGE
Definition: resource.h:29
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
Definition: reg.c:1061
#define STRING_EXPORT_USAGE
Definition: resource.h:61
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define STRING_IMPORT_USAGE
Definition: resource.h:57
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
#define STRING_DELETE_USAGE
Definition: resource.h:28
GLenum GLuint id
Definition: glext.h:5579
UINT op
Definition: effect.c:223
Definition: reg.c:1056
#define STRING_ADD_USAGE
Definition: resource.h:27
GLenum query
Definition: glext.h:7781

Referenced by wmain().

◆ get_regdata()

static LPBYTE get_regdata ( const WCHAR data,
DWORD  reg_type,
WCHAR  separator,
DWORD reg_count 
)
static

Definition at line 270 of file reg.c.

271 {
272  static const WCHAR empty;
273  LPBYTE out_data = NULL;
274  *reg_count = 0;
275 
276  if (!data) data = &empty;
277 
278  switch (reg_type)
279  {
280  case REG_NONE:
281  case REG_SZ:
282  case REG_EXPAND_SZ:
283  {
284  *reg_count = (lstrlenW(data) + 1) * sizeof(WCHAR);
285  out_data = heap_xalloc(*reg_count);
286  lstrcpyW((LPWSTR)out_data,data);
287  break;
288  }
289  case REG_DWORD:
290  /* case REG_DWORD_LITTLE_ENDIAN: */
291  case REG_DWORD_BIG_ENDIAN: /* Yes, this is correct! */
292  {
293  LPWSTR rest;
294  unsigned long val;
295  val = wcstoul(data, &rest, (tolowerW(data[1]) == 'x') ? 16 : 10);
296  if (*rest || data[0] == '-' || (val == ~0u && errno == ERANGE)) {
298  break;
299  }
300  *reg_count = sizeof(DWORD);
301  out_data = heap_xalloc(*reg_count);
302  ((LPDWORD)out_data)[0] = val;
303  break;
304  }
305  case REG_BINARY:
306  {
307  BYTE hex0, hex1;
308  int i = 0, destByteIndex = 0, datalen = lstrlenW(data);
309  *reg_count = ((datalen + datalen % 2) / 2) * sizeof(BYTE);
310  out_data = heap_xalloc(*reg_count);
311  if(datalen % 2)
312  {
313  hex1 = hexchar_to_byte(data[i++]);
314  if(hex1 == 0xFF)
315  goto no_hex_data;
316  out_data[destByteIndex++] = hex1;
317  }
318  for(;i + 1 < datalen;i += 2)
319  {
320  hex0 = hexchar_to_byte(data[i]);
321  hex1 = hexchar_to_byte(data[i + 1]);
322  if(hex0 == 0xFF || hex1 == 0xFF)
323  goto no_hex_data;
324  out_data[destByteIndex++] = (hex0 << 4) | hex1;
325  }
326  break;
327  no_hex_data:
328  /* cleanup, print error */
329  heap_free(out_data);
331  out_data = NULL;
332  break;
333  }
334  case REG_MULTI_SZ:
335  {
336  int i, destindex, len = strlenW(data);
337  WCHAR *buffer = heap_xalloc((len + 2) * sizeof(WCHAR));
338 
339  for (i = 0, destindex = 0; i < len; i++, destindex++)
340  {
341  if (!separator && data[i] == '\\' && data[i + 1] == '0')
342  {
343  buffer[destindex] = 0;
344  i++;
345  }
346  else if (data[i] == separator)
347  buffer[destindex] = 0;
348  else
349  buffer[destindex] = data[i];
350 
351  if (destindex && !buffer[destindex - 1] && (!buffer[destindex] || destindex == 1))
352  {
353  heap_free(buffer);
355  return NULL;
356  }
357  }
358  buffer[destindex] = 0;
359  if (destindex && buffer[destindex - 1])
360  buffer[++destindex] = 0;
361  *reg_count = (destindex + 1) * sizeof(WCHAR);
362  return (BYTE *)buffer;
363  }
364  default:
366  }
367 
368  return out_data;
369 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
static const WCHAR separator[]
Definition: asmname.c:65
#define STRING_MISSING_HEXDATA
Definition: resource.h:37
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define REG_BINARY
Definition: nt_native.h:1496
GLuint buffer
Definition: glext.h:5915
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
#define STRING_INVALID_STRING
Definition: resource.h:48
int errno
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1027
#define lstrlenW
Definition: compat.h:415
static BYTE hexchar_to_byte(WCHAR ch)
Definition: reg.c:258
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:52
#define REG_MULTI_SZ
Definition: nt_native.h:1501
smooth NULL
Definition: ftsmooth.c:416
#define STRING_MISSING_INTEGER
Definition: resource.h:36
GLuint GLfloat * val
Definition: glext.h:7180
__wchar_t WCHAR
Definition: xmlstorage.h:180
WINE_UNICODE_INLINE WCHAR tolowerW(WCHAR ch)
Definition: unicode.h:135
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define ERANGE
Definition: acclib.h:92
#define LPDWORD
Definition: nt_native.h:46
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
#define REG_DWORD_BIG_ENDIAN
Definition: nt_native.h:1499
#define STRING_UNHANDLED_TYPE
Definition: resource.h:38
#define lstrcpyW
Definition: compat.h:414
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
BOOL empty
Definition: button.c:170
void * heap_xalloc(size_t size)
Definition: reg.c:83
#define REG_NONE
Definition: nt_native.h:1492
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static ULONG ULONG *static const UNICODE_STRING void DWORD
Definition: reg.c:135
#define REG_DWORD
Definition: sdbapi.c:596
type_t * reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:5992
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
#define REG_SZ
Definition: layer.c:22

Referenced by reg_add().

◆ heap_xalloc()

void* heap_xalloc ( size_t  size)

Definition at line 83 of file reg.c.

84 {
85  void *buf = heap_alloc(size);
86  if (!buf)
87  {
88  ERR("Out of memory!\n");
89  exit(1);
90  }
91  return buf;
92 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLsizeiptr size
Definition: glext.h:5919
#define ERR(fmt,...)
Definition: debug.h:109
void exit(int exitcode)
Definition: _exit.c:33

Referenced by build_subkey_path(), dword_data_state(), escape_string(), export_dword_data(), export_hex_data(), export_hex_data_type(), export_key_name(), export_registry_data(), export_string_data(), export_value_name(), get_lineA(), get_lineW(), get_long_key(), get_regdata(), GetWideString(), GetWideStringN(), header_state(), open_key(), output_writeconsole(), query_all(), query_value(), quoted_value_name_state(), reg_data_to_wchar(), and reg_delete().

◆ heap_xrealloc()

void* heap_xrealloc ( void buf,
size_t  size 
)

Definition at line 94 of file reg.c.

95 {
96  void *new_buf = heap_realloc(buf, size);
97 
98  if (!new_buf)
99  {
100  ERR("Out of memory!\n");
101  exit(1);
102  }
103 
104  return new_buf;
105 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
GLsizeiptr size
Definition: glext.h:5919
#define ERR(fmt,...)
Definition: debug.h:109
void exit(int exitcode)
Definition: _exit.c:33

Referenced by convert_hex_csv_to_hex(), export_registry_data(), get_lineA(), get_lineW(), query_all(), query_value(), and reg_delete().

◆ hexchar_to_byte()

static BYTE hexchar_to_byte ( WCHAR  ch)
inlinestatic

Definition at line 258 of file reg.c.

259 {
260  if (ch >= '0' && ch <= '9')
261  return ch - '0';
262  else if (ch >= 'a' && ch <= 'f')
263  return ch - 'a' + 10;
264  else if (ch >= 'A' && ch <= 'F')
265  return ch - 'A' + 10;
266  else
267  return -1;
268 }

Referenced by get_regdata().

◆ is_help_switch()

static BOOL is_help_switch ( const WCHAR s)
static

Definition at line 1047 of file reg.c.

1048 {
1049  if (is_switch(s, '?') || is_switch(s, 'h'))
1050  return TRUE;
1051 
1052  return FALSE;
1053 }
#define TRUE
Definition: types.h:120
static BOOL is_switch(const WCHAR *s, const WCHAR c)
Definition: reg.c:901
GLdouble s
Definition: gl.h:2039

Referenced by wmain().

◆ is_switch()

static BOOL is_switch ( const WCHAR s,
const WCHAR  c 
)
static

Definition at line 901 of file reg.c.

902 {
903  if (strlenW(s) > 2)
904  return FALSE;
905 
906  if ((s[0] == '/' || s[0] == '-') && (s[1] == c || s[1] == toupperW(c)))
907  return TRUE;
908 
909  return FALSE;
910 }
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
WINE_UNICODE_INLINE WCHAR toupperW(WCHAR ch)
Definition: unicode.h:141
const GLubyte * c
Definition: glext.h:8905
GLdouble s
Definition: gl.h:2039

Referenced by is_help_switch().

◆ output_error()

static void output_error ( LSTATUS  status)
static

Definition at line 147 of file reg.c.

148 {
149  WCHAR* str;
150  DWORD len;
151 
154  if (len == 0 && GetLastError() != NO_ERROR)
155  {
156  WINE_FIXME("Could not format error code: le=%u, error=%u", GetLastError(), status);
157  return;
158  }
159 
161  LocalFree(str);
162 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define NO_ERROR
Definition: dderror.h:5
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
GLenum GLsizei len
Definition: glext.h:6722
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
void output_writeconsole(const WCHAR *str, DWORD wlen)
Definition: reg.c:107
#define WINE_FIXME
Definition: debug.h:365
Definition: ps.c:97

Referenced by reg_restore(), reg_save(), and set_privilege().

◆ output_formatstring()

static void output_formatstring ( const WCHAR fmt,
__ms_va_list  va_args 
)
static

Definition at line 130 of file reg.c.

131 {
132  WCHAR *str;
133  DWORD len;
134 
137  fmt, 0, 0, (WCHAR *)&str, 0, &va_args);
138  if (len == 0 && GetLastError() != NO_ERROR)
139  {
140  WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt));
141  return;
142  }
144  LocalFree(str);
145 }
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:402
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define NO_ERROR
Definition: dderror.h:5
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
GLenum GLsizei len
Definition: glext.h:6722
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
void output_writeconsole(const WCHAR *str, DWORD wlen)
Definition: reg.c:107
Definition: dsound.c:943
#define WINE_FIXME
Definition: debug.h:365

Referenced by output_message(), and output_string().

◆ output_message()

void WINAPIV output_message ( unsigned int  id,
  ... 
)

Definition at line 164 of file reg.c.

165 {
166  WCHAR fmt[1024];
167  __ms_va_list va_args;
168 
170  {
171  WINE_FIXME("LoadString failed with %d\n", GetLastError());
172  return;
173  }
174  __ms_va_start(va_args, id);
175  output_formatstring(fmt, va_args);
176  __ms_va_end(va_args);
177 }
static static const char __ms_va_list
Definition: printf.c:76
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
smooth NULL
Definition: ftsmooth.c:416
static void output_formatstring(const WCHAR *fmt, __ms_va_list va_args)
Definition: reg.c:130
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ARRAY_SIZE(a)
Definition: main.h:24
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
Definition: dsound.c:943
#define WINE_FIXME
Definition: debug.h:365

Referenced by ask_confirm(), get_file_handle(), get_regdata(), key_name_state(), parse_registry_key(), parse_win31_line_state(), query_value(), reg_add(), reg_delete(), reg_export(), reg_import(), reg_query(), reg_restore(), reg_save(), sane_path(), unescape_string(), and wmain().

◆ output_string()

static void WINAPIV output_string ( const WCHAR fmt,
  ... 
)
static

Definition at line 179 of file reg.c.

180 {
181  __ms_va_list va_args;
182 
183  __ms_va_start(va_args, fmt);
184  output_formatstring(fmt, va_args);
185  __ms_va_end(va_args);
186 }
static static const char __ms_va_list
Definition: printf.c:76
static void output_formatstring(const WCHAR *fmt, __ms_va_list va_args)
Definition: reg.c:130
#define __ms_va_end(list)
Definition: windef.h:458
#define __ms_va_start(list, arg)
Definition: windef.h:457
Definition: dsound.c:943

Referenced by output_value(), query_all(), query_value(), and reg_query().

◆ output_value()

static void output_value ( const WCHAR value_name,
DWORD  type,
BYTE data,
DWORD  data_size 
)
static

Definition at line 620 of file reg.c.

621 {
622  static const WCHAR fmt[] = {' ',' ',' ',' ','%','1',0};
623  WCHAR defval[32];
624  WCHAR *reg_data;
625 
626  if (value_name && value_name[0])
627  output_string(fmt, value_name);
628  else
629  {
631  output_string(fmt, defval);
632  }
634 
635  if (data)
636  {
637  reg_data = reg_data_to_wchar(type, data, data_size);
638  output_string(fmt, reg_data);
639  heap_free(reg_data);
640  }
641  else
642  {
644  output_string(fmt, defval);
645  }
647 }
#define STRING_VALUE_NOT_SET
Definition: resource.h:56
static const WCHAR newlineW[]
Definition: reg.c:81
static void WINAPIV output_string(const WCHAR *fmt,...)
Definition: reg.c:179
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
static WCHAR * reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes)
Definition: reg.c:538
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define STRING_DEFAULT_VALUE
Definition: resource.h:44
#define ARRAY_SIZE(a)
Definition: main.h:24
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
Definition: dsound.c:943
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
static const WCHAR * reg_type_to_wchar(DWORD type)
Definition: reg.c:608

Referenced by query_all(), and query_value().

◆ output_writeconsole()

void output_writeconsole ( const WCHAR str,
DWORD  wlen 
)

Definition at line 107 of file reg.c.

108 {
109  DWORD count, ret;
110 
112  if (!ret)
113  {
114  DWORD len;
115  char *msgA;
116 
117  /* On Windows WriteConsoleW() fails if the output is redirected. So fall
118  * back to WriteFile(), assuming the console encoding is still the right
119  * one in that case.
120  */
122  msgA = heap_xalloc(len);
123 
124  WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, msgA, len, NULL, NULL);
126  heap_free(msgA);
127  }
128 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define WideCharToMultiByte
Definition: compat.h:101
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleW(IN HANDLE hConsoleOutput, IN CONST VOID *lpBuffer, IN DWORD nNumberOfCharsToWrite, OUT LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
Definition: readwrite.c:1449
GLuint GLuint GLsizei count
Definition: gl.h:1545
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleOutputCP(VOID)
Definition: console.c:2453
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define STD_OUTPUT_HANDLE
Definition: winbase.h:265
void * heap_xalloc(size_t size)
Definition: reg.c:83
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by get_file_handle(), output_error(), and output_formatstring().

◆ parse_registry_key()

BOOL parse_registry_key ( const WCHAR key,
HKEY root,
WCHAR **  path,
WCHAR **  long_key 
)

Definition at line 880 of file reg.c.

881 {
882  if (!sane_path(key))
883  return FALSE;
884 
885  *path = strchrW(key, '\\');
886  if (*path) (*path)++;
887 
889  if (!*root)
890  {
891  if (*path) *(*path - 1) = 0;
893  return FALSE;
894  }
895 
896  *long_key = get_long_key(*root, *path);
897 
898  return TRUE;
899 }
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
static WCHAR * get_long_key(HKEY root, WCHAR *path)
Definition: reg.c:853
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
#define STRING_INVALID_SYSTEM_KEY
Definition: resource.h:62
static BOOL sane_path(const WCHAR *key)
Definition: reg.c:371
HKEY path_get_rootkey(const WCHAR *path)
Definition: reg.c:227
Definition: path.c:41

Referenced by reg_export(), reg_restore(), reg_save(), and wmain().

◆ path_get_rootkey()

HKEY path_get_rootkey ( const WCHAR path)

Definition at line 227 of file reg.c.

228 {
229  DWORD i;
230 
231  for (i = 0; i < ARRAY_SIZE(root_rels); i++)
232  {
235  return root_rels[i].key;
236  }
237 
238  return NULL;
239 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
static BOOL path_rootname_cmp(const WCHAR *input_path, const WCHAR *rootkey_name)
Definition: reg.c:219
unsigned long DWORD
Definition: ntddk_ex.h:95
const WCHAR * short_name
Definition: reg.c:43
const WCHAR * long_name
Definition: reg.c:44
#define ARRAY_SIZE(a)
Definition: main.h:24
static const struct @2 root_rels[]
Definition: path.c:41

Referenced by parse_key_name(), and parse_registry_key().

◆ path_rootname_cmp()

static BOOL path_rootname_cmp ( const WCHAR input_path,
const WCHAR rootkey_name 
)
inlinestatic

Definition at line 219 of file reg.c.

220 {
221  DWORD length = strlenW(rootkey_name);
222 
223  return (!strncmpiW(input_path, rootkey_name, length) &&
224  (input_path[length] == 0 || input_path[length] == '\\'));
225 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by path_get_rootkey().

◆ query_all()

static int query_all ( HKEY  key,
WCHAR path,
BOOL  recurse 
)
static

Definition at line 739 of file reg.c.

740 {
741  LONG rc;
742  DWORD max_value_len = 256, value_len;
743  DWORD max_data_bytes = 2048, data_size;
744  DWORD subkey_len;
745  DWORD i, type, path_len;
746  WCHAR fmt[] = {'%','1','\n',0};
747  WCHAR fmt_path[] = {'%','1','\\','%','2','\n',0};
748  WCHAR *value_name, *subkey_name, *subkey_path;
749  BYTE *data;
750  HKEY subkey;
751 
753 
754  value_name = heap_xalloc(max_value_len * sizeof(WCHAR));
755  data = heap_xalloc(max_data_bytes);
756 
757  i = 0;
758  for (;;)
759  {
760  value_len = max_value_len;
761  data_size = max_data_bytes;
762  rc = RegEnumValueW(key, i, value_name, &value_len, NULL, &type, data, &data_size);
763  if (rc == ERROR_SUCCESS)
764  {
765  output_value(value_name, type, data, data_size);
766  i++;
767  }
768  else if (rc == ERROR_MORE_DATA)
769  {
770  if (data_size > max_data_bytes)
771  {
772  max_data_bytes = data_size;
773  data = heap_xrealloc(data, max_data_bytes);
774  }
775  else
776  {
777  max_value_len *= 2;
778  value_name = heap_xrealloc(value_name, max_value_len * sizeof(WCHAR));
779  }
780  }
781  else break;
782  }
783 
784  heap_free(data);
785  heap_free(value_name);
786 
787  if (i || recurse)
789 
790  subkey_name = heap_xalloc(MAX_SUBKEY_LEN * sizeof(WCHAR));
791 
792  path_len = strlenW(path);
793 
794  i = 0;
795  for (;;)
796  {
797  subkey_len = MAX_SUBKEY_LEN;
798  rc = RegEnumKeyExW(key, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
799  if (rc == ERROR_SUCCESS)
800  {
801  if (recurse)
802  {
803  subkey_path = build_subkey_path(path, path_len, subkey_name, subkey_len);
804  if (!RegOpenKeyExW(key, subkey_name, 0, KEY_READ, &subkey))
805  {
806  query_all(subkey, subkey_path, recurse);
807  RegCloseKey(subkey);
808  }
809  heap_free(subkey_path);
810  }
811  else output_string(fmt_path, path, subkey_name);
812  i++;
813  }
814  else break;
815  }
816 
817  heap_free(subkey_name);
818 
819  if (i && !recurse)
821 
822  return 0;
823 }
static const WCHAR newlineW[]
Definition: reg.c:81
#define MAX_SUBKEY_LEN
Definition: reg.h:24
static void WINAPIV output_string(const WCHAR *fmt,...)
Definition: reg.c:179
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2853
smooth NULL
Definition: ftsmooth.c:416
WCHAR * build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len)
Definition: reg.c:649
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
unsigned char BYTE
Definition: mem.h:68
void * heap_xrealloc(void *buf, size_t size)
Definition: reg.c:94
static void output_value(const WCHAR *value_name, DWORD type, BYTE *data, DWORD data_size)
Definition: reg.c:620
#define ERROR_MORE_DATA
Definition: dderror.h:13
static DWORD path_len
Definition: batch.c:31
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
void * heap_xalloc(size_t size)
Definition: reg.c:83
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
static int query_all(HKEY key, WCHAR *path, BOOL recurse)
Definition: reg.c:739
Definition: dsound.c:943
Definition: path.c:41
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
DWORD type
Definition: reg.c:66

Referenced by reg_query().

◆ query_value()

static int query_value ( HKEY  key,
WCHAR value_name,
WCHAR path,
BOOL  recurse 
)
static

Definition at line 662 of file reg.c.

663 {
664  LONG rc;
665  DWORD max_data_bytes = 2048, data_size;
666  DWORD subkey_len;
667  DWORD type, path_len, i;
668  BYTE *data;
669  WCHAR fmt[] = {'%','1','\n',0};
670  WCHAR *subkey_name, *subkey_path;
671  HKEY subkey;
672 
673  data = heap_xalloc(max_data_bytes);
674 
675  for (;;)
676  {
677  data_size = max_data_bytes;
678  rc = RegQueryValueExW(key, value_name, NULL, &type, data, &data_size);
679  if (rc == ERROR_MORE_DATA)
680  {
681  max_data_bytes = data_size;
682  data = heap_xrealloc(data, max_data_bytes);
683  }
684  else break;
685  }
686 
687  if (rc == ERROR_SUCCESS)
688  {
690  output_value(value_name, type, data, data_size);
693  }
694 
695  heap_free(data);
696 
697  if (!recurse)
698  {
699  if (rc == ERROR_FILE_NOT_FOUND)
700  {
701  if (value_name && *value_name)
702  {
704  return 1;
705  }
708  }
709  return 0;
710  }
711 
712  subkey_name = heap_xalloc(MAX_SUBKEY_LEN * sizeof(WCHAR));
713 
714  path_len = strlenW(path);
715 
716  i = 0;
717  for (;;)
718  {
719  subkey_len = MAX_SUBKEY_LEN;
720  rc = RegEnumKeyExW(key, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
721  if (rc == ERROR_SUCCESS)
722  {
723  subkey_path = build_subkey_path(path, path_len, subkey_name, subkey_len);
724  if (!RegOpenKeyExW(key, subkey_name, 0, KEY_READ, &subkey))
725  {
726  query_value(subkey, value_name, subkey_path, recurse);
727  RegCloseKey(subkey);
728  }
729  heap_free(subkey_path);
730  i++;
731  }
732  else break;
733  }
734 
735  heap_free(subkey_name);
736  return 0;
737 }
static const WCHAR newlineW[]
Definition: reg.c:81
#define MAX_SUBKEY_LEN
Definition: reg.h:24
static void WINAPIV output_string(const WCHAR *fmt,...)
Definition: reg.c:179
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
#define STRING_CANNOT_FIND
Definition: resource.h:34
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
WCHAR * build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len)
Definition: reg.c:649
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
unsigned char BYTE
Definition: mem.h:68
void * heap_xrealloc(void *buf, size_t size)
Definition: reg.c:94
static void output_value(const WCHAR *value_name, DWORD type, BYTE *data, DWORD data_size)
Definition: reg.c:620
#define ERROR_MORE_DATA
Definition: dderror.h:13
static DWORD path_len
Definition: batch.c:31
static unsigned int num_values_found
Definition: reg.c:660
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
void * heap_xalloc(size_t size)
Definition: reg.c:83
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
Definition: dsound.c:943
Definition: path.c:41
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
DWORD type
Definition: reg.c:66
static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse)
Definition: reg.c:662
#define REG_SZ
Definition: layer.c:22

Referenced by reg_query().

◆ reg_add()

static int reg_add ( HKEY  root,
WCHAR path,
WCHAR value_name,
BOOL  value_empty,
WCHAR type,
WCHAR  separator,
WCHAR data,
BOOL  force 
)
static

Definition at line 390 of file reg.c.

392 {
393  HKEY key;
394 
396  {
398  return 1;
399  }
400 
401  if (value_name || value_empty || data)
402  {
403  DWORD reg_type;
404  DWORD reg_count = 0;
405  BYTE* reg_data = NULL;
406 
407  if (!force)
408  {
409  if (RegQueryValueExW(key, value_name, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
410  {
411  if (!ask_confirm(STRING_OVERWRITE_VALUE, value_name))
412  {
413  RegCloseKey(key);
415  return 0;
416  }
417  }
418  }
419 
421  if (reg_type == ~0u)
422  {
423  RegCloseKey(key);
425  return 1;
426  }
428  {
429  RegCloseKey(key);
431  return 1;
432  }
433 
434  if (!(reg_data = get_regdata(data, reg_type, separator, &reg_count)))
435  {
436  RegCloseKey(key);
437  return 1;
438  }
439 
440  RegSetValueExW(key, value_name, 0, reg_type, reg_data, reg_count);
441  heap_free(reg_data);
442  }
443 
444  RegCloseKey(key);
446 
447  return 0;
448 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define STRING_OVERWRITE_VALUE
Definition: resource.h:39
static const WCHAR separator[]
Definition: asmname.c:65
#define ERROR_SUCCESS
Definition: deptool.c:10
static DWORD wchar_get_type(const WCHAR *type_name)
Definition: reg.c:241
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define STRING_SUCCESS
Definition: resource.h:30
#define STRING_INVALID_CMDLINE
Definition: resource.h:32
#define STRING_INVALID_KEY
Definition: resource.h:31
smooth NULL
Definition: ftsmooth.c:416
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
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, DWORD *reg_count)
Definition: reg.c:270
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HKEY key
Definition: reg.c:42
unsigned char BYTE
Definition: mem.h:68
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1199
#define REG_DWORD_BIG_ENDIAN
Definition: nt_native.h:1499
BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info)
Definition: reg.c:189
#define STRING_UNSUPPORTED_TYPE
Definition: resource.h:35
#define REG_DWORD
Definition: sdbapi.c:596
type_t * reg_type(type_t *type, const char *name, struct namespace *namespace, int t)
Definition: parser.tab.c:5992
#define STRING_CANCELLED
Definition: resource.h:43
Definition: path.c:41
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by wmain().

◆ reg_data_to_wchar()

static WCHAR* reg_data_to_wchar ( DWORD  type,
const BYTE src,
DWORD  size_bytes 
)
static

Definition at line 538 of file reg.c.

539 {
540  WCHAR *buffer = NULL;
541  int i;
542 
543  switch (type)
544  {
545  case REG_SZ:
546  case REG_EXPAND_SZ:
547  buffer = heap_xalloc(size_bytes);
548  strcpyW(buffer, (WCHAR *)src);
549  break;
550  case REG_NONE:
551  case REG_BINARY:
552  {
553  WCHAR *ptr;
554  static const WCHAR fmt[] = {'%','0','2','X',0};
555 
556  buffer = heap_xalloc((size_bytes * 2 + 1) * sizeof(WCHAR));
557  ptr = buffer;
558  for (i = 0; i < size_bytes; i++)
559  ptr += sprintfW(ptr, fmt, src[i]);
560  break;
561  }
562  case REG_DWORD:
563  /* case REG_DWORD_LITTLE_ENDIAN: */
565  {
566  const int zero_x_dword = 10;
567  static const WCHAR fmt[] = {'0','x','%','x',0};
568 
569  buffer = heap_xalloc((zero_x_dword + 1) * sizeof(WCHAR));
570  sprintfW(buffer, fmt, *(DWORD *)src);
571  break;
572  }
573  case REG_MULTI_SZ:
574  {
575  const int two_wchars = 2 * sizeof(WCHAR);
576  DWORD tmp_size;
577  const WCHAR *tmp = (const WCHAR *)src;
578  int len, destindex;
579 
580  if (size_bytes <= two_wchars)
581  {
582  buffer = heap_xalloc(sizeof(WCHAR));
583  *buffer = 0;
584  return buffer;
585  }
586 
587  tmp_size = size_bytes - two_wchars; /* exclude both null terminators */
588  buffer = heap_xalloc(tmp_size * 2 + sizeof(WCHAR));
589  len = tmp_size / sizeof(WCHAR);
590 
591  for (i = 0, destindex = 0; i < len; i++, destindex++)
592  {
593  if (tmp[i])
594  buffer[destindex] = tmp[i];
595  else
596  {
597  buffer[destindex++] = '\\';
598  buffer[destindex] = '0';
599  }
600  }
601  buffer[destindex] = 0;
602  break;
603  }
604  }
605  return buffer;
606 }
#define REG_BINARY
Definition: nt_native.h:1496
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define REG_MULTI_SZ
Definition: nt_native.h:1501
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
#define REG_DWORD_BIG_ENDIAN
Definition: nt_native.h:1499
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define sprintfW
Definition: unicode.h:58
void * heap_xalloc(size_t size)
Definition: reg.c:83
#define REG_NONE
Definition: nt_native.h:1492
#define REG_DWORD
Definition: sdbapi.c:596
Definition: dsound.c:943
#define REG_SZ
Definition: layer.c:22

Referenced by output_value().

◆ reg_delete()

static int reg_delete ( HKEY  root,
WCHAR path,
WCHAR key_name,
WCHAR value_name,
BOOL  value_empty,
BOOL  value_all,
BOOL  force 
)
static

Definition at line 450 of file reg.c.

452 {
453  HKEY key;
454 
455  if (!force)
456  {
457  BOOL ret;
458 
459  if (value_name || value_empty)
460  ret = ask_confirm(STRING_DELETE_VALUE, value_name);
461  else if (value_all)
463  else
465 
466  if (!ret)
467  {
469  return 0;
470  }
471  }
472 
473  /* Delete subtree only if no /v* option is given */
474  if (!value_name && !value_empty && !value_all)
475  {
477  {
479  return 1;
480  }
482  return 0;
483  }
484 
486  {
488  return 1;
489  }
490 
491  if (value_all)
492  {
493  DWORD max_value_len = 256, value_len;
494  WCHAR *value_name;
495  LONG rc;
496 
497  value_name = heap_xalloc(max_value_len * sizeof(WCHAR));
498 
499  while (1)
500  {
501  value_len = max_value_len;
502  rc = RegEnumValueW(key, 0, value_name, &value_len, NULL, NULL, NULL, NULL);
503  if (rc == ERROR_SUCCESS)
504  {
505  rc = RegDeleteValueW(key, value_name);
506  if (rc != ERROR_SUCCESS)
507  {
508  heap_free(value_name);
509  RegCloseKey(key);
511  return 1;
512  }
513  }
514  else if (rc == ERROR_MORE_DATA)
515  {
516  max_value_len *= 2;
517  value_name = heap_xrealloc(value_name, max_value_len * sizeof(WCHAR));
518  }
519  else break;
520  }
521  heap_free(value_name);
522  }
523  else if (value_name || value_empty)
524  {
525  if (RegDeleteValueW(key, value_empty ? NULL : value_name) != ERROR_SUCCESS)
526  {
527  RegCloseKey(key);
529  return 1;
530  }
531  }
532 
533  RegCloseKey(key);
535  return 0;
536 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define STRING_DELETE_VALUE
Definition: resource.h:45
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
#define STRING_VALUEALL_FAILED
Definition: resource.h:49
#define STRING_DELETE_VALUEALL
Definition: resource.h:46
#define STRING_CANNOT_FIND
Definition: resource.h:34
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3296
#define STRING_SUCCESS
Definition: resource.h:30
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2853
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define STRING_DELETE_SUBKEY
Definition: resource.h:47
HKEY key
Definition: reg.c:42
void * heap_xrealloc(void *buf, size_t size)
Definition: reg.c:94
#define ERROR_MORE_DATA
Definition: dderror.h:13
LSTATUS WINAPI RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
Definition: reg.c:1746
BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info)
Definition: reg.c:189
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2355
void * heap_xalloc(size_t size)
Definition: reg.c:83
#define STRING_CANCELLED
Definition: resource.h:43
Definition: path.c:41
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by wmain().

◆ reg_query()

static int reg_query ( HKEY  root,
WCHAR path,
WCHAR key_name,
WCHAR value_name,
BOOL  value_empty,
BOOL  recurse 
)
static

Definition at line 825 of file reg.c.

827 {
828  HKEY key;
829  int ret;
830 
832  {
834  return 1;
835  }
836 
838 
839  if (value_name || value_empty)
840  {
841  ret = query_value(key, value_name, key_name, recurse);
842  if (recurse)
844  }
845  else
846  ret = query_all(key, key_name, recurse);
847 
848  RegCloseKey(key);
849 
850  return ret;
851 }
static const WCHAR newlineW[]
Definition: reg.c:81
static void WINAPIV output_string(const WCHAR *fmt,...)
Definition: reg.c:179
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
#define STRING_CANNOT_FIND
Definition: resource.h:34
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
int ret
HKEY key
Definition: reg.c:42
#define STRING_MATCHES_FOUND
Definition: resource.h:51
static unsigned int num_values_found
Definition: reg.c:660
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
static int query_all(HKEY key, WCHAR *path, BOOL recurse)
Definition: reg.c:739
Definition: path.c:41
static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse)
Definition: reg.c:662

Referenced by wmain().

◆ reg_restore()

static int reg_restore ( int  argc,
WCHAR argv[] 
)
static

Definition at line 1011 of file reg.c.

1012 {
1013  HKEY root, hkey;
1014  LSTATUS status;
1015  WCHAR* path, * long_key;
1016 
1017  if (argc != 4) goto error;
1018 
1019  if (!parse_registry_key(argv[2], &root, &path, &long_key))
1020  return 1;
1021 
1022  if (RegOpenKeyExW(root, path, 0, KEY_READ, &hkey))
1023  {
1025  return 1;
1026  }
1027 
1028  if (!set_privilege(SE_BACKUP_NAME, TRUE)) return 1;
1029  if (!set_privilege(SE_RESTORE_NAME, TRUE)) return 1;
1030 
1031  status = RegRestoreKeyW(hkey, argv[3], 0);
1032  RegCloseKey(hkey);
1033 
1034  if (status != ERROR_SUCCESS) {
1036  return 1;
1037  }
1038 
1039  return 0;
1040 
1041 error:
1044  return 1;
1045 }
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
GLsizei const GLchar ** path
Definition: glext.h:7234
#define SE_BACKUP_NAME
struct _root root
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path, WCHAR **long_key)
Definition: reg.c:880
#define argv
Definition: mplay32.c:18
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define STRING_INVALID_KEY
Definition: resource.h:31
#define STRING_FUNC_HELP
Definition: resource.h:55
LONG WINAPI RegRestoreKeyW(HKEY hKey, LPCWSTR lpFile, DWORD dwFlags)
Definition: reg.c:4525
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define STRING_INVALID_SYNTAX
Definition: resource.h:52
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define SE_RESTORE_NAME
static BOOL set_privilege(LPCWSTR privilegeName, BOOL enabled)
Definition: reg.c:912
static void output_error(LSTATUS status)
Definition: reg.c:147
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97
WINE_UNICODE_INLINE WCHAR * struprW(WCHAR *str)
Definition: unicode.h:288

Referenced by wmain().

◆ reg_save()

static int reg_save ( int  argc,
WCHAR argv[] 
)
static

Definition at line 964 of file reg.c.

964  {
965  HKEY root, hkey;
966  LSTATUS status;
967  WCHAR* path, *long_key;
968 
969  if (argc < 4 || argc > 5) goto error;
970 
971  if (!parse_registry_key(argv[2], &root, &path, &long_key))
972  return 1;
973 
975  {
976  if (argc == 5 && !strcmpiW(argv[4], L"/y"))
977  {
978  DeleteFile(argv[3]);
979  }
980  else
981  {
983  DeleteFile(argv[3]);
984  }
985  }
986 
987  if (RegOpenKeyExW(root, path, 0, KEY_READ, &hkey))
988  {
990  return 1;
991  }
992 
993  if (!set_privilege(SE_BACKUP_NAME, TRUE)) return 1;
994 
996  RegCloseKey(hkey);
997 
998  if (status != ERROR_SUCCESS) {
1000  return 1;
1001  }
1002 
1003  return 0;
1004 
1005 error:
1008  return 1;
1009 }
LONG WINAPI RegSaveKeyExW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags)
Definition: reg.c:4743
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
#define KEY_READ
Definition: nt_native.h:1023
GLsizei const GLchar ** path
Definition: glext.h:7234
#define SE_BACKUP_NAME
struct _root root
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path, WCHAR **long_key)
Definition: reg.c:880
#define argv
Definition: mplay32.c:18
#define DeleteFile
Definition: winbase.h:3598
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define STRING_INVALID_KEY
Definition: resource.h:31
#define STRING_FUNC_HELP
Definition: resource.h:55
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define STRING_INVALID_SYNTAX
Definition: resource.h:52
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
static const WCHAR L[]
Definition: oid.c:1250
#define REG_LATEST_FORMAT
Definition: cmtypes.h:98
#define GetFileAttributes
Definition: winbase.h:3649
#define strcmpiW(s1, s2)
Definition: unicode.h:39
BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info)
Definition: reg.c:189
#define STRING_OVERWRITE_FILE
Definition: resource.h:63
static BOOL set_privilege(LPCWSTR privilegeName, BOOL enabled)
Definition: reg.c:912
static void output_error(LSTATUS status)
Definition: reg.c:147
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97
WINE_UNICODE_INLINE WCHAR * struprW(WCHAR *str)
Definition: unicode.h:288

Referenced by wmain().

◆ reg_type_to_wchar()

static const WCHAR* reg_type_to_wchar ( DWORD  type)
static

Definition at line 608 of file reg.c.

609 {
611 
612  for (i = 0; i < array_size; i++)
613  {
614  if (type == type_rels[i].type)
615  return type_rels[i].name;
616  }
617  return NULL;
618 }
static const struct @3 type_rels[]
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static UINT array_size
Definition: msctf.c:67
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by output_value().

◆ sane_path()

static BOOL sane_path ( const WCHAR key)
static

Definition at line 371 of file reg.c.

372 {
373  unsigned int i = strlenW(key);
374 
375  if (i < 3 || (key[i - 1] == '\\' && key[i - 2] == '\\'))
376  {
378  return FALSE;
379  }
380 
381  if (key[0] == '\\' && key[1] == '\\' && key[2] != '\\')
382  {
384  return FALSE;
385  }
386 
387  return TRUE;
388 }
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define STRING_INVALID_KEY
Definition: resource.h:31
#define STRING_NO_REMOTE
Definition: resource.h:33
Definition: path.c:41

Referenced by parse_registry_key().

◆ set_privilege()

static BOOL set_privilege ( LPCWSTR  privilegeName,
BOOL  enabled 
)
static

Definition at line 912 of file reg.c.

913 {
914  HANDLE hToken = INVALID_HANDLE_VALUE;
917 
919  {
920  tp.PrivilegeCount = 1;
921  tp.Privileges[0].Attributes = (enabled ? SE_PRIVILEGE_ENABLED : 0);
922 
923  if (LookupPrivilegeValueW(NULL, privilegeName, &tp.Privileges[0].Luid))
924  {
925  if (AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL))
926  {
928  {
930  goto fail;
931  }
932  }
933  else
934  {
935  error = GetLastError();
936  goto fail;
937  }
938  }
939  else
940  {
941  error = GetLastError();
942  goto fail;
943  }
944  }
945  else
946  {
947  error = GetLastError();
948  goto fail;
949  }
950 
951  CloseHandle(hToken);
952  return TRUE;
953 
954 fail:
955  // Don't allow a success error to be printed, as that would confuse the user.
956  // "Access denied" seems like a reasonable default.
958  if (hToken != INVALID_HANDLE_VALUE) CloseHandle(hToken);
959 
961  return FALSE;
962 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
smooth NULL
Definition: ftsmooth.c:416
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2855
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:376
static void output_error(LSTATUS status)
Definition: reg.c:147
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
#define ERROR_NOT_ALL_ASSIGNED
Definition: winerror.h:782
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:876

Referenced by reg_restore(), and reg_save().

◆ wchar_get_type()

static DWORD wchar_get_type ( const WCHAR type_name)
static

Definition at line 241 of file reg.c.

242 {
243  DWORD i;
244 
245  if (!type_name)
246  return REG_SZ;
247 
248  for (i = 0; i < ARRAY_SIZE(type_rels); i++)
249  {
250  if (!strcmpiW(type_rels[i].name, type_name))
251  return type_rels[i].type;
252  }
253 
254  return ~0u;
255 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
static const struct @3 type_rels[]
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned long DWORD
Definition: ntddk_ex.h:95
#define strcmpiW(s1, s2)
Definition: unicode.h:39
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: name.c:38
#define REG_SZ
Definition: layer.c:22

Referenced by reg_add().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( reg  )

◆ wmain()

int wmain ( int  argc,
WCHAR argvW[] 
)

Definition at line 1104 of file reg.c.

1105 {
1106  int i, op, op_help, ret;
1107  BOOL show_op_help = FALSE;
1108  static const WCHAR switchVAW[] = {'v','a',0};
1109  static const WCHAR switchVEW[] = {'v','e',0};
1110  WCHAR *key_name, *path, *value_name = NULL, *type = NULL, *data = NULL, separator = '\0';
1111  BOOL value_empty = FALSE, value_all = FALSE, recurse = FALSE, force = FALSE;
1112  HKEY root;
1113 
1114  if (argc == 1)
1115  {
1118  return 1;
1119  }
1120 
1121  if (is_help_switch(argvW[1]))
1122  {
1124  return 0;
1125  }
1126 
1127  op = get_operation(argvW[1], &op_help);
1128 
1129  if (op == REG_INVALID)
1130  {
1133  return 1;
1134  }
1135 
1136  if (argc > 2)
1137  show_op_help = is_help_switch(argvW[2]);
1138 
1139  if (argc == 2 || ((show_op_help || op == REG_IMPORT) && argc > 3))
1140  {
1143  return 1;
1144  }
1145  else if (show_op_help)
1146  {
1147  output_message(op_help);
1148  return 0;
1149  }
1150 
1151  if (op == REG_IMPORT)
1152  return reg_import(argvW[2]);
1153 
1154  if (op == REG_EXPORT)
1155  return reg_export(argc, argvW);
1156 
1157  if (op == REG_SAVE)
1158  return reg_save(argc, argvW);
1159 
1160  if (op == REG_RESTORE)
1161  return reg_restore(argc, argvW);
1162 
1163  if (!parse_registry_key(argvW[2], &root, &path, &key_name))
1164  return 1;
1165 
1166  for (i = 3; i < argc; i++)
1167  {
1168  if (argvW[i][0] == '/' || argvW[i][0] == '-')
1169  {
1170  WCHAR *ptr = &argvW[i][1];
1171 
1172  if (!lstrcmpiW(ptr, switchVEW))
1173  {
1174  value_empty = TRUE;
1175  continue;
1176  }
1177  else if (!lstrcmpiW(ptr, switchVAW))
1178  {
1179  value_all = TRUE;
1180  continue;
1181  }
1182  else if (!ptr[0] || ptr[1])
1183  {
1185  return 1;
1186  }
1187 
1188  switch(tolowerW(argvW[i][1]))
1189  {
1190  case 'v':
1191  if (value_name || !(value_name = argvW[++i]))
1192  {
1194  return 1;
1195  }
1196  break;
1197  case 't':
1198  if (type || !(type = argvW[++i]))
1199  {
1201  return 1;
1202  }
1203  break;
1204  case 'd':
1205  if (data || !(data = argvW[++i]))
1206  {
1208  return 1;
1209  }
1210  break;
1211  case 's':
1212  if (op == REG_QUERY)
1213  {
1214  recurse = TRUE;
1215  break;
1216  }
1217 
1218  ptr = argvW[++i];
1219  if (!ptr || strlenW(ptr) != 1)
1220  {
1222  return 1;
1223  }
1224  separator = ptr[0];
1225  break;
1226  case 'f':
1227  force = TRUE;
1228  break;
1229  default:
1231  return 1;
1232  }
1233  }
1234  }
1235 
1236  if ((value_name && value_empty) || (value_name && value_all) || (value_empty && value_all))
1237  {
1239  return 1;
1240  }
1241 
1242  if (op == REG_ADD)
1243  ret = reg_add(root, path, value_name, value_empty, type, separator, data, force);
1244  else if (op == REG_DELETE)
1245  ret = reg_delete(root, path, key_name, value_name, value_empty, value_all, force);
1246  else
1247  ret = reg_query(root, path, key_name, value_name, value_empty, recurse);
1248  return ret;
1249 }
static int argc
Definition: ServiceArgs.c:12
#define STRING_USAGE
Definition: resource.h:26
static int reg_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL value_all, BOOL force)
Definition: reg.c:450
#define TRUE
Definition: types.h:120
static const WCHAR separator[]
Definition: asmname.c:65
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
GLsizei const GLchar ** path
Definition: glext.h:7234
struct _root root
static int reg_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL recurse)
Definition: reg.c:825
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void WINAPIV output_message(unsigned int id,...)
Definition: reg.c:164
static BOOL is_help_switch(const WCHAR *s)
Definition: reg.c:1047
BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path, WCHAR **long_key)
Definition: reg.c:880
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: reg.c:1061
unsigned int BOOL
Definition: ntddk_ex.h:94
#define STRING_INVALID_CMDLINE
Definition: resource.h:32
static PVOID ptr
Definition: dispmode.c:27
static enum operations get_operation(const WCHAR *str, int *op_help)
Definition: reg.c:1066
#define STRING_FUNC_HELP
Definition: resource.h:55
static int reg_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL value_empty, WCHAR *type, WCHAR separator, WCHAR *data, BOOL force)
Definition: reg.c:390
smooth NULL
Definition: ftsmooth.c:416
static int reg_save(int argc, WCHAR *argv[])
Definition: reg.c:964
static int reg_restore(int argc, WCHAR *argv[])
Definition: reg.c:1011
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define STRING_INVALID_SYNTAX
Definition: resource.h:52
#define STRING_REG_HELP
Definition: resource.h:54
WINE_UNICODE_INLINE WCHAR tolowerW(WCHAR ch)
Definition: unicode.h:135
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int ret
int reg_import(const WCHAR *filename)
Definition: import.c:995
UINT op
Definition: effect.c:223
int reg_export(int argc, WCHAR *argv[])
Definition: export.c:373
Definition: reg.c:1056
#define STRING_INVALID_OPTION
Definition: resource.h:53
WINE_UNICODE_INLINE WCHAR * struprW(WCHAR *str)
Definition: unicode.h:288

Variable Documentation

◆ key

Definition at line 42 of file reg.c.

Referenced by ___w64_mingwthr_add_key_dtor(), ATL::CRegKey::_DoDeleteKeyTree(), _test_key_exists(), _test_key_not_exists(), _TIFFFindFieldByName(), ACTION_AppSearchIni(), ACTION_RegisterMIMEInfo(), add_param(), add_userkey(), AddDisplayDevice(), AddDlg_OnCommand(), afm_parse_kern_data(), afm_parse_kern_pairs(), afm_parse_track_kern(), afm_parser_next_key(), afm_parser_parse(), afm_parser_skip_section(), apply_image_attributes(), arbfp_blit_type_compare(), bsearch(), btrfs_read_sys_chunk_array(), cache_container_set_size(), CategoryMgr_FindClosestCategory(), CDecodeEnvelopedMsg_CrtlDecrypt(), CDecodeSignedMsg_VerifySignatureWithKey(), CertGetPublicKeyLength(), check_dirid(), cleanup_eventlog(), COM_OpenKeyForCLSID(), COMCAT_ICatInformation_GetCategoryDesc(), COMCAT_ICatInformation_IsClassOfCategories(), COMCAT_RegisterClassCategories(), compare_function_decl_rb(), compare_function_rb(), compare_hlsl_types_rb(), CountUniqueItems_Aux(), create_diff_row_query(), create_monodata(), create_new_eventlog(), create_server(), CRYPT_CreateKeyProv(), CRYPT_ExportPublicKeyInfoEx(), CRYPT_GetFuncFromReg(), CRYPT_ImportKeyTrans(), CRYPT_ImportSystemRootCertsToReg(), CRYPT_LoadSIPFunc(), CRYPT_RegOpenStore(), CRYPT_RegWriteToReg(), CRYPT_VerifySignature(), CRYPTDLG_CheckOnlineCRL(), CryptGetDefaultOIDDllList(), CryptRegisterDefaultOIDFunction(), CryptSIPRetrieveSubjectGuid(), CryptUnregisterDefaultOIDFunction(), d3dcompiler_shader_reflection_type_compare(), d3drm_animation2_AddPositionKey(), d3drm_animation2_AddRotateKey(), d3drm_animation2_AddScaleKey(), d3drm_animation2_DeleteKey(), d3drm_animation2_GetKeys(), DECLARE_INTERFACE_(), deformat_component(), deformat_environment(), deformat_file(), DEVENUM_ICreateDevEnum_CreateClassEnumerator(), dictInsertBefore(), dump_child_(), EDIT_CheckCombo(), ensure_useragent(), export_is_key_exportable(), export_registry_key(), IconCache::extract(), fetch_machine_product(), CFontInfo::File(), ft_hash_str_insert(), ft_hash_str_lookup(), FTP_Connect(), get_cert_mgr_usages(), get_default_proxy_reg_value(), get_install_root(), hhp_pair::get_key(), get_key_state(), get_key_value(), get_mono_path_from_registry(), get_reg_dword(), get_shell_icon_size(), GetInstalledVersion_WowUser(), GetScanCode(), glsl_program_key_compare(), hash_bucket(), hash_insert(), HashFindFreeKeyBlock(), HashInsert(), hhp_pair::hhp_pair(), I_CryptReadTrustedPublisherDWORDValueFromRegistry(), ICInfo(), ICInstall(), ICRemove(), inf_value_parse(), CAutoComplete::Init(), init_driver(), InitLogs(), InputProcessorProfiles_EnableLanguageProfile(), InputProcessorProfiles_EnableLanguageProfileByDefault(), InputProcessorProfiles_IsEnabledLanguageProfile(), install_inf_file(), INTERNET_LoadProxySettings(), INTERNET_SaveProxySettings(), iocp_async_closesocket(), iocp_async_read(), iocp_async_read_closesocket(), iocp_async_read_thread(), iocp_async_read_thread_closesocket(), ITERATE_InstallService(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), load_sys_chunks(), MMDevEnum_GetDefaultAudioEndpoint(), MMDevice_Create(), MMDevPropStore_OpenPropKey(), MSI_EnumComponentQualifiers(), msi_publish_install_properties(), msi_validate_product_id(), NdrDllRegisterProxy(), notif_thread_proc(), ok_keys_(), okChildInt_(), okChildIntBroken_(), okChildPath_(), okChildString_(), ole_server(), param_rb_compare(), process_hook_section(), ProcessKeys(), PROFILE_DeleteAllKeys(), PROFILE_DeleteKey(), PROFILE_Find(), PROFILE_Free(), PROFILE_GetSection(), PROFILE_Load(), PROFILE_Save(), rdssl_sign_ok(), CFontCache::Read(), read_oid_info(), reg_add(), reg_delete(), reg_query(), register_codepages(), register_interfaces(), register_key_defvalueA(), register_key_defvalueW(), register_verb(), RegisterTypeLib(), resolve_keypath(), RfsdLookupFileName(), RfsdProcessDirEntry(), save_cert_mgr_usages(), SECUR32_initializeProviders(), set_ldids(), ATL::CSimpleMap< TKey, TVal, TEqual >::SetAtIndex(), ATL::CRegKey::SetKeyValue(), Settings_GetOutputPath(), Settings_GetShouldWriteDump(), SETUPDI_CreateDevKey(), SETUPDI_OpenDevKey(), SETUPDI_OpenDrvKey(), SetupDiCreateDeviceInterfaceRegKeyA(), SetupDiCreateDevRegKeyA(), SetupDiCreateDevRegKeyW(), SetupDiOpenClassRegKeyExW(), SetupDiOpenDevRegKey(), ATL::CRegKey::SetValue(), SHGetObjectCompatFlags(), SHGetShellKey(), si_compar(), sparse_array_add(), sqliteKeywordCode(), START_TEST(), sti_compar(), test__lfind_s(), test_Add(), test_animation(), test_autocreation(), test_comparemode(), test_completion(), test_completion_port(), test_device_interface_key(), test_dik_codes(), test_Exists(), test_findOIDInfo(), test_get_profiles_dir(), test_hash_value(), test_header(), test_IACLCustomMRU_Continue(), test_ICInfo(), test_IEnumVARIANT(), test_import_hmac(), test_install_from(), test_interfaces(), test_internet_features(), test_Item(), test_Keys(), test_ldap_parse_sort_control(), test_long_value_name(), test_NonExistentPath(), test_notify(), test_NtCreateKey(), test_NtOpenKey(), test_NtQueryKey(), test_NtQueryValueKey(), test_NtSetValueKey(), test_null_provider(), test_perflib_key(), test_publish_components(), test_query(), test_readTrustedPublisherDWORD(), test_redirection(), test_reg_delete_key(), test_register_device_iface(), test_register_font(), test_registerDefaultOIDFunction(), test_registerOIDInfo(), test_registry(), test_registry_property_a(), test_registry_property_w(), test_RegNotifyChangeKeyValue(), test_RegOpenCurrentUser(), test_RegPolicyFlags(), test_Remove(), test_remove_env_strings(), test_remove_registry_values(), test_save(), test_SHGetFolderPathA(), test_SHRegCloseUSKey(), test_signed_msg_encoding(), test_signed_msg_update(), test_sioAddressListChange(), test_symlinks(), test_synchronous_WSAIoctl(), testAcquireCertPrivateKey(), testAcquireSecurityContext(), testCreateSelfSignCert(), testExportPublicKey(), testGetPublicKeyLength(), testImportPublicKey(), Tests_Insert_And_Delete(), testSignCert(), TIFFFindField(), TLB_register_interface(), TOOLBAR_Save(), TreeNodeMake(), tt_face_get_kerning(), TuiEditBox(), TuiMessageBoxCritical(), UpdateKeyStateFromMsg(), urlcache_hash_entry_create(), usp10_compare_script_range(), VARIANT_GetNamedFormat(), verify_mru_(), wine_get_sortkey(), wined3d_ffp_frag_program_key_compare(), wined3d_ffp_vertex_program_key_compare(), WinHttpGetDefaultProxyConfiguration(), WinHttpSetDefaultProxyConfiguration(), WintrustGetRegPolicyFlags(), WintrustSetRegPolicyFlags(), write_superblocks(), xmlDictExists(), xmlDictGrow(), xmlDictLookup(), xmlDictQLookup(), xmlHashAddEntry3(), xmlHashGrow(), xmlHashLookup3(), xmlHashQLookup3(), xmlHashRemoveEntry3(), xmlHashUpdateEntry3(), and xsltAddKey().

◆ long_hkcc

const WCHAR long_hkcc[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','C','O','N','F','I','G',0}
static

Definition at line 38 of file reg.c.

◆ long_hkcr

const WCHAR long_hkcr[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}
static

Definition at line 36 of file reg.c.

◆ long_hkcu

const WCHAR long_hkcu[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R',0}
static

Definition at line 35 of file reg.c.

◆ long_hklm

const WCHAR long_hklm[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E',0}
static

Definition at line 34 of file reg.c.

◆ long_hku

const WCHAR long_hku[] = {'H','K','E','Y','_','U','S','E','R','S',0}
static

Definition at line 37 of file reg.c.

◆ long_name

const WCHAR* long_name

Definition at line 44 of file reg.c.

Referenced by get_long_key(), lfn_check_orphaned(), lfn_get(), and path_get_rootkey().

◆ name

Definition at line 67 of file reg.c.

Referenced by reg_get_stringvalue(), and test_NtQueryLicenseKey().

◆ newlineW

const WCHAR newlineW[] = {'\n',0}
static

Definition at line 81 of file reg.c.

Referenced by comment_line(), output_value(), query_all(), query_value(), and reg_query().

◆ num_values_found

unsigned int num_values_found = 0
static

Definition at line 660 of file reg.c.

Referenced by query_value(), and reg_query().

◆ root_rels

const { ... } root_rels[]
Initial value:
=
{
}
#define HKEY_USERS
Definition: winreg.h:13
static const WCHAR long_hklm[]
Definition: reg.c:34
static const WCHAR long_hku[]
Definition: reg.c:37
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
static const WCHAR short_hklm[]
Definition: reg.c:29
static const WCHAR long_hkcr[]
Definition: reg.c:36
static const WCHAR short_hku[]
Definition: reg.c:32
static const WCHAR long_hkcu[]
Definition: reg.c:35
static const WCHAR long_hkcc[]
Definition: reg.c:38
static const WCHAR short_hkcc[]
Definition: reg.c:33
static const WCHAR short_hkcu[]
Definition: reg.c:30
static const WCHAR short_hkcr[]
Definition: reg.c:31
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by get_long_key(), and path_get_rootkey().

◆ short_hkcc

const WCHAR short_hkcc[] = {'H','K','C','C',0}
static

Definition at line 33 of file reg.c.

◆ short_hkcr

const WCHAR short_hkcr[] = {'H','K','C','R',0}
static

Definition at line 31 of file reg.c.

◆ short_hkcu

const WCHAR short_hkcu[] = {'H','K','C','U',0}
static

Definition at line 30 of file reg.c.

◆ short_hklm

const WCHAR short_hklm[] = {'H','K','L','M',0}
static

Definition at line 29 of file reg.c.

◆ short_hku

const WCHAR short_hku[] = {'H','K','U',0}
static

Definition at line 32 of file reg.c.

◆ short_name

◆ type

◆ type_binary

const WCHAR type_binary[] = {'R','E','G','_','B','I','N','A','R','Y',0}
static

Definition at line 58 of file reg.c.

◆ type_dword

const WCHAR type_dword[] = {'R','E','G','_','D','W','O','R','D',0}
static

Definition at line 59 of file reg.c.

◆ type_dword_be

const WCHAR type_dword_be[] = {'R','E','G','_','D','W','O','R','D','_','B','I','G','_','E','N','D','I','A','N',0}
static

Definition at line 61 of file reg.c.

◆ type_dword_le

const WCHAR type_dword_le[] = {'R','E','G','_','D','W','O','R','D','_','L','I','T','T','L','E','_','E','N','D','I','A','N',0}
static

Definition at line 60 of file reg.c.

◆ type_expand_sz

const WCHAR type_expand_sz[] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0}
static

Definition at line 57 of file reg.c.

◆ type_multi_sz

const WCHAR type_multi_sz[] = {'R','E','G','_','M','U','L','T','I','_','S','Z',0}
static

Definition at line 62 of file reg.c.

◆ type_none

const WCHAR type_none[] = {'R','E','G','_','N','O','N','E',0}
static

Definition at line 55 of file reg.c.

◆ type_rels

const { ... } type_rels[]
Initial value:
=
{
}
#define REG_BINARY
Definition: nt_native.h:1496
static const WCHAR type_sz[]
Definition: reg.c:56
static const WCHAR type_none[]
Definition: reg.c:55
static const WCHAR type_dword_be[]
Definition: reg.c:61
#define REG_MULTI_SZ
Definition: nt_native.h:1501
static const WCHAR type_multi_sz[]
Definition: reg.c:62
static const WCHAR type_binary[]
Definition: reg.c:58
#define REG_DWORD_LITTLE_ENDIAN
Definition: nt_native.h:1498
static const WCHAR type_dword[]
Definition: reg.c:59
#define REG_DWORD_BIG_ENDIAN
Definition: nt_native.h:1499
static const WCHAR type_expand_sz[]
Definition: reg.c:57
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define REG_NONE
Definition: nt_native.h:1492
static const WCHAR type_dword_le[]
Definition: reg.c:60
#define REG_DWORD
Definition: sdbapi.c:596
#define REG_SZ
Definition: layer.c:22

Referenced by reg_type_to_wchar(), and wchar_get_type().

◆ type_sz

const WCHAR type_sz[] = {'R','E','G','_','S','Z',0}
static

Definition at line 56 of file reg.c.