#include <stdlib.h>
#include <windows.h>
#include "resource.h"
Go to the source code of this file.
|
void | output_writeconsole (const WCHAR *str, DWORD wlen) |
|
void WINAPIV | output_message (unsigned int id,...) |
|
void WINAPIV | output_string (const WCHAR *fmt,...) |
|
BOOL | ask_confirm (unsigned int msgid, WCHAR *reg_info) |
|
HKEY | path_get_rootkey (const WCHAR *path) |
|
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) |
|
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[]) |
|
◆ MAX_SUBKEY_LEN
Definition at line 26 of file reg.h.
◆ 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().
◆ is_char()
◆ 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_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)
DWORD WINAPI GetLastError(void)
◆ 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()
◆ reg_add()
Definition at line 227 of file add.c.
228{
234
236 return 1;
237
239 {
241
242 if (argvW[
i][0] !=
'/' && argvW[
i][0] !=
'-')
244
246
248 {
251 continue;
252 }
254 {
257 continue;
258 }
260 {
263 continue;
264 }
265 else if (!
str[0] ||
str[1])
267
269 {
270 case 'v':
271 if (value_name || !(value_name = argvW[++
i]))
273 break;
274 case 't':
277 break;
278 case 'd':
281 break;
282 case 's':
287 break;
288 case 'f':
291 break;
292 default:
294 }
295 }
296
297 if (value_name && value_empty)
299
302
304
308 return 1;
309}
static int run_add(HKEY root, WCHAR *path, REGSAM sam, WCHAR *value_name, BOOL value_empty, WCHAR *type, WCHAR separator, WCHAR *data, BOOL force)
BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path)
#define STRING_INVALID_SYNTAX
static const WCHAR separator[]
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static const WCHAR invalid[]
_CRTIMP wchar_t *__cdecl _wcsupr(_Inout_z_ wchar_t *_String)
Referenced by wmain().
◆ reg_copy()
Definition at line 193 of file copy.c.
194{
199
202
204 return 1;
205
207 return 1;
208
210 {
212
213 if (argvW[
i][0] !=
'/' && argvW[
i][0] !=
'-')
215
217
219 {
222 continue;
223 }
225 {
228 continue;
229 }
230 else if (!
str[0] ||
str[1])
232
234 {
235 case 's':
238 break;
239 case 'f':
242 break;
243 default:
245 }
246 }
247
250
252 {
254 return 1;
255 }
256
258
260
264 return 1;
265}
static int run_copy(struct key *src, struct key *dest, REGSAM sam, BOOL recurse, BOOL force)
#define STRING_COPY_SRC_DEST_SAME
Referenced by wmain().
◆ reg_delete()
Definition at line 134 of file delete.c.
135{
141
143 return 1;
144
146 {
148
149 if (argvW[
i][0] !=
'/' && argvW[
i][0] !=
'-')
151
153
155 {
158 continue;
159 }
161 {
164 continue;
165 }
167 {
170 continue;
171 }
173 {
176 continue;
177 }
178 else if (!
str[0] ||
str[1])
180
182 {
183 case 'v':
184 if (value_name || !(value_name = argvW[++
i]))
186 break;
187 case 'f':
190 break;
191 default:
193 }
194 }
195
196 if ((value_name && value_empty) || (value_name && value_all) || (value_empty && value_all))
198
201
203
205
209 return 1;
210}
static int run_delete(HKEY root, WCHAR *path, REGSAM sam, WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL value_all, BOOL force)
WCHAR * get_long_key(HKEY root, WCHAR *path)
Referenced by wmain().
◆ reg_export()
Definition at line 347 of file export.c.
348{
355
357
359 return 1;
360
362 {
364
365 if (argvW[
i][0] !=
'/' && argvW[
i][0] !=
'-')
367
369
371 overwrite_file =
TRUE;
373 {
376 continue;
377 }
379 {
382 continue;
383 }
384 else
386 }
387
390
392 {
394 return 1;
395 }
396
398
404
406
408
412 return 1;
413}
static HANDLE get_file_handle(WCHAR *filename, BOOL overwrite_file)
static void export_newline(HANDLE hFile)
static void export_file_header(HANDLE hFile)
static int export_registry_data(HANDLE hFile, HKEY hkey, WCHAR *path, REGSAM sam)
#define STRING_KEY_NONEXIST
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Referenced by wmain().
◆ reg_import()
Definition at line 980 of file import.c.
981{
986
988
990
992 {
994
995 if (*
str !=
'/' && *
str !=
'-')
997
999
1004 else
1006 }
1007
1009
1011 if (!fp)
1012 {
1014 return 1;
1015 }
1016
1019
1022
1036
1038
1039
1042
1045
1048
1050 return 0;
1051
1054 return 1;
1055
1059 return 1;
1060}
#define STRING_FILE_NOT_FOUND
static WCHAR * get_lineA(FILE *fp)
static WCHAR * get_lineW(FILE *fp)
static WCHAR *(* get_line)(FILE *)
static const parser_state_func parser_funcs[NB_PARSER_STATES]
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
Referenced by wmain().
◆ reg_query()
Definition at line 339 of file query.c.
340{
345
347 return 1;
348
350 {
352
353 if (argvW[
i][0] !=
'/' && argvW[
i][0] !=
'-')
355
357
359 {
362 continue;
363 }
365 {
368 continue;
369 }
371 {
374 continue;
375 }
376 else if (!
str[0] ||
str[1])
378
380 {
381 case 'v':
382 if (value_name || !(value_name = argvW[++
i]))
384 break;
385 case 's':
388 break;
389 default:
391 }
392 }
393
394 if (value_name && value_empty)
396
399
401
403
407 return 1;
408}
static int run_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL recurse)
Referenced by wmain().
◆ type_rels