#include <stdio.h>
#include "reg.h"
#include <wine/debug.h>
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (reg) |
|
void | output_writeconsole (const WCHAR *str, DWORD wlen) |
|
static void | output_formatstring (const WCHAR *fmt, va_list va_args) |
|
void WINAPIV | output_message (unsigned int id,...) |
|
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 BOOL | sane_path (const WCHAR *key) |
|
WCHAR * | build_subkey_path (WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len) |
|
WCHAR * | get_long_key (HKEY root, WCHAR *path) |
|
BOOL | parse_registry_key (const WCHAR *key, HKEY *root, WCHAR **path) |
|
BOOL | is_char (const WCHAR s, const WCHAR c) |
|
BOOL | is_switch (const WCHAR *s, const WCHAR c) |
|
static BOOL | is_help_switch (const WCHAR *s) |
|
static enum operations | get_operation (const WCHAR *str, int *op_help) |
|
int __cdecl | wmain (int argc, WCHAR *argvW[]) |
|
◆ operations
Enumerator |
---|
REG_ADD | |
REG_COPY | |
REG_DELETE | |
REG_EXPORT | |
REG_IMPORT | |
REG_QUERY | |
REG_INVALID | |
Definition at line 285 of file reg.c.
◆ ask_confirm()
Definition at line 127 of file reg.c.
128{
136
141
143
144 while (1)
145 {
150 if (answer[0] == Ybuffer[0])
152 if (answer[0] == Nbuffer[0])
154 }
155}
void WINAPIV output_message(unsigned int id,...)
#define STRING_DEFAULT_VALUE
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleW(IN HANDLE hConsoleInput, OUT LPVOID lpBuffer, IN DWORD nNumberOfCharsToRead, OUT LPDWORD lpNumberOfCharsRead, IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
GLuint GLuint GLsizei count
static PEXPLICIT_ACCESSW *static HMODULE hmod
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
Referenced by get_file_handle(), run_add(), and run_delete().
◆ build_subkey_path()
◆ get_long_key()
Definition at line 208 of file reg.c.
209{
212
214 {
216 break;
217 }
218
220
222 {
225 return long_key;
226 }
227
231 return long_key;
232}
static const struct @2 root_rels[]
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
Referenced by reg_delete(), reg_export(), and reg_query().
◆ get_operation()
Definition at line 295 of file reg.c.
296{
298
299 static const struct op_info op_array[] =
300 {
308 };
309
311
313 {
315 {
316 *op_help =
ptr->help_id;
318 }
319 }
320
322}
#define STRING_IMPORT_USAGE
#define STRING_DELETE_USAGE
#define STRING_QUERY_USAGE
#define STRING_COPY_USAGE
#define STRING_EXPORT_USAGE
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Referenced by wmain().
◆ is_char()
◆ is_help_switch()
Definition at line 280 of file reg.c.
281{
283}
BOOL is_switch(const WCHAR *s, const WCHAR c)
Referenced by wmain().
◆ is_switch()
Definition at line 272 of file reg.c.
273{
276
277 return ((
s[0] ==
'/' ||
s[0] ==
'-') &&
is_char(
s[1],
c));
278}
BOOL is_char(const WCHAR s, const WCHAR c)
Referenced by is_help_switch().
◆ output_formatstring()
Definition at line 76 of file reg.c.
77{
80
84 {
86 return;
87 }
90}
void output_writeconsole(const WCHAR *str, DWORD wlen)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_STRING
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Referenced by output_message(), and output_string().
◆ output_message()
Definition at line 92 of file reg.c.
93{
97
99 {
101 return;
102 }
103
107
109
113
115}
static void output_formatstring(const WCHAR *fmt, va_list va_args)
Referenced by ask_confirm(), ask_overwrite_value(), delete_registry_key(), export_key(), get_file_handle(), get_regdata(), key_name_state(), open_export_key(), output_error(), parse_registry_key(), parse_win31_line_state(), query_value(), reg_add(), reg_copy(), reg_delete(), reg_export(), reg_import(), reg_query(), REGPROC_open_export_file(), REGPROC_unescape_string(), run_add(), run_delete(), run_query(), sane_path(), unescape_string(), unknown_data_state(), and wmain().
◆ output_string()
◆ output_writeconsole()
Definition at line 53 of file reg.c.
54{
56
59 {
61 char *msgA;
62
63
64
65
66
69
73 }
74}
#define WideCharToMultiByte
UINT WINAPI DECLSPEC_HOTPATCH GetConsoleOutputCP(VOID)
BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleW(IN HANDLE hConsoleOutput, IN CONST VOID *lpBuffer, IN DWORD nNumberOfCharsToWrite, OUT LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define STD_OUTPUT_HANDLE
Referenced by get_file_handle(), and output_formatstring().
◆ parse_registry_key()
Definition at line 234 of file reg.c.
235{
237
240
243 {
246 }
247
249
252
253 (*path)++;
254
256 {
259 }
260
262 if (*
p ==
'\\') *
p = 0;
263
265}
HKEY path_get_rootkey(const WCHAR *path)
static BOOL sane_path(const WCHAR *key)
#define STRING_INVALID_SYSTEM_KEY
Referenced by reg_add(), reg_copy(), reg_delete(), reg_export(), and reg_query().
◆ path_get_rootkey()
◆ path_rootname_cmp()
Definition at line 157 of file reg.c.
158{
160
162 (input_path[
length] == 0 || input_path[
length] ==
'\\'));
163}
GLuint GLsizei GLsizei * length
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
Referenced by path_get_rootkey().
◆ sane_path()
Definition at line 179 of file reg.c.
180{
182
183 if (
i < 3 || (
key[
i - 1] ==
'\\' &&
key[
i - 2] ==
'\\'))
184 {
187 }
188
189 if (
key[0] ==
'\\' &&
key[1] ==
'\\' &&
key[2] !=
'\\')
190 {
193 }
194
196}
#define STRING_INVALID_KEY
Referenced by parse_registry_key().
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
reg |
| ) |
|
◆ wmain()
Definition at line 324 of file reg.c.
325{
327
329 {
332 return 1;
333 }
334
336 {
338 return 0;
339 }
340
342
344 {
347 return 1;
348 }
351
353 {
355
358 return 0;
359 }
360
363
366
369
372
375
377
381 return 1;
382}
int reg_add(int argc, WCHAR *argvW[])
int reg_copy(int argc, WCHAR *argvW[])
int reg_delete(int argc, WCHAR *argvW[])
int reg_export(int argc, WCHAR *argvW[])
int reg_import(int argc, WCHAR *argvW[])
int reg_query(int argc, WCHAR *argvW[])
static enum operations get_operation(const WCHAR *str, int *op_help)
static BOOL is_help_switch(const WCHAR *s)
#define STRING_INVALID_SYNTAX
#define STRING_INVALID_OPTION
#define STRING_REG_VIEW_USAGE
static const WCHAR invalid[]
_CRTIMP wchar_t *__cdecl _wcsupr(_Inout_z_ wchar_t *_String)
◆ key
◆ long_name
const struct { ... } root_rels[] |
Initial value:=
{
}
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_CONFIG
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT
Referenced by get_long_key(), and path_get_rootkey().
◆ short_name
◆ type_rels