ReactOS 0.4.15-dev-8428-g6910fa6
regdump.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

DWORD GetInput (char *Buffer, int buflen)
 
int regdump (int argc, char *argv[])
 
BOOL ProcessCmdLine (LPSTR lpCmdLine)
 

Variables

HANDLE OutputHandle
 
HANDLE InputHandle
 

Function Documentation

◆ GetInput()

DWORD GetInput ( char Buffer,
int  buflen 
)

Definition at line 12 of file main.c.

13{
15
17 return Result;
18}
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleA(IN HANDLE hConsoleInput, OUT LPVOID lpBuffer, IN DWORD nNumberOfCharsToRead, OUT LPDWORD lpNumberOfCharsRead, IN PCONSOLE_READCONSOLE_CONTROL pInputControl OPTIONAL)
Definition: readwrite.c:1195
unsigned long DWORD
Definition: ntddk_ex.h:95
HANDLE InputHandle
Definition: main.c:9
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

◆ ProcessCmdLine()

BOOL ProcessCmdLine ( LPSTR  lpCmdLine)

Definition at line 150 of file regcmds.c.

151{
153 LPSTR s = lpCmdLine; /* command line pointer */
154 CHAR ch = *s; /* current character */
155
156 while (ch && ((ch == '-') || (ch == '/'))) {
157 char chu;
158 char ch2;
159
160 s++;
161 ch = *s;
162 ch2 = *(s+1);
163 chu = toupper(ch);
164 if (!ch2 || isspace(ch2)) {
165 if (chu == 'S' || chu == 'V') {
166 /* ignore these switches */
167 } else {
168 switch (chu) {
169 case 'D':
171 break;
172 case 'E':
174 break;
175 case 'V':
177 break;
178 case '?':
179 printf(usage);
180 return FALSE;
181 //exit(0);
182 break;
183 default:
185 return FALSE;
186 break;
187 }
188 }
189 s++;
190 } else {
191 if (ch2 == ':') {
192 switch (chu) {
193 case 'L':
194 /* fall through */
195 case 'R':
196 s += 2;
197 while (*s && !isspace(*s)) {
198 s++;
199 }
200 break;
201 default:
203 return FALSE;
204 break;
205 }
206 } else {
207 /* this is a file name, starting from '/' */
208 s--;
209 break;
210 }
211 }
212 /* skip spaces to the next parameter */
213 ch = *s;
214 while (ch && isspace(ch)) {
215 s++;
216 ch = *s;
217 }
218 }
219 if (action == ACTION_UNDEF) {
221 }
222 return PerformRegAction(action, s);
223}
#define isspace(c)
Definition: acclib.h:69
int toupper(int c)
Definition: utclib.c:881
REGEDIT_ACTION
Definition: regedit.c:120
#define FALSE
Definition: types.h:117
const WCHAR * action
Definition: action.c:7479
#define printf
Definition: freeldr.h:97
GLdouble s
Definition: gl.h:2039
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
Definition: regcmds.c:96
void error_unknown_switch(char chu, char *s)
Definition: regcmds.c:85
@ ACTION_ADD
Definition: regcmds.c:75
@ ACTION_EXPORT
Definition: regcmds.c:75
@ ACTION_DELETE
Definition: regcmds.c:75
@ ACTION_VIEW
Definition: regcmds.c:75
@ ACTION_UNDEF
Definition: regcmds.c:75
char * LPSTR
Definition: xmlstorage.h:182
char CHAR
Definition: xmlstorage.h:175

◆ regdump()

int regdump ( int  argc,
char argv[] 
)

Definition at line 89 of file regdump.c.

90{
91 char Buffer[500];
92
93 if (argc > 1) {
94// if (0 == _tcsstr(argv[1], _T("HKLM"))) {
95 if (strstr(argv[1], "help")) {
96 usage(argv[0]);
97 } else if (strstr(argv[1], "HKCR")) {
98 RegKeyPrint('1');
99 } else if (strstr(argv[1], "HKCU")) {
100 RegKeyPrint('2');
101 } else if (strstr(argv[1], "HKLM")) {
102 RegKeyPrint('3');
103 } else if (strstr(argv[1], "HKU")) {
104 RegKeyPrint('4');
105 } else if (strstr(argv[1], "HKCC")) {
106 RegKeyPrint('5');
107 } else if (strstr(argv[1], "HKRR")) {
108 RegKeyPrint('6');
109 } else {
110 dprintf("started with argc = %d, argv[1] = %s (unknown?)\n", argc, argv[1]);
111 }
112 return 0;
113 }
114 show_menu();
115 while (1) {
116 GetInput(Buffer, sizeof(Buffer));
117 switch (toupper(Buffer[0])) {
118 case '0':
119 return(0);
120 case '1':
122 goto doit;
123 case '2':
125 goto doit;
126 case '3':
128 goto doit;
129 case '4':
131 goto doit;
132 case '5':
134 goto doit;
135 case '6':
137 goto doit;
138 case '7':
140 goto doit;
141 case '8':
143 goto doit;
144 case '9':
146 goto doit;
147 case 'A':
148 case 'B':
149 case 'C':
150 case 'D':
151 case 'E':
152 case 'F':
153 RegKeyPrint(toupper(Buffer[0]) - 'A' + 1);
154 break;
155 default: doit:
156 if (!ProcessCmdLine(Buffer)) {
157 dprintf("invalid input.\n");
158 show_menu();
159 } else {
160 dprintf("done.\n");
161 }
162 break;
163 }
164 }
165 return 0;
166}
static int argc
Definition: ServiceArgs.c:12
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
BOOL ProcessCmdLine(IN LPWSTR lpCmdLine)
Definition: eventvwr.c:184
#define doit(a, b)
Definition: fieldoff.c:4
DWORD GetInput(char *Buffer, int buflen)
Definition: main.c:12
#define argv
Definition: mplay32.c:18
const char * default_cmd_line9
Definition: regdump.c:48
#define dprintf
Definition: regdump.c:33
const char * default_cmd_line3
Definition: regdump.c:42
const char * default_cmd_line7
Definition: regdump.c:46
const char * default_cmd_line1
Definition: regdump.c:40
const char * default_cmd_line6
Definition: regdump.c:45
const char * default_cmd_line2
Definition: regdump.c:41
void RegKeyPrint(int which)
const char * default_cmd_line4
Definition: regdump.c:43
const char * default_cmd_line5
Definition: regdump.c:44
const char * default_cmd_line8
Definition: regdump.c:47
void show_menu(void)
Definition: regdump.c:57

Referenced by main().

Variable Documentation

◆ InputHandle

◆ OutputHandle

HANDLE OutputHandle
extern