ReactOS 0.4.16-dev-1983-g1a17364
interpreter.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS DiskPart
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/system/diskpart/interpreter.c
5 * PURPOSE: Reads the user input and then invokes the selected
6 * command by the user.
7 * PROGRAMMERS: Lee Schroeder
8 */
9
10#include "diskpart.h"
11#include "diskpart_msg.h"
12
15
16
18{
19 {L"ACTIVE", NULL, NULL, active_main, IDS_HELP_ACTIVE, MSG_COMMAND_ACTIVE},
20 {L"ADD", NULL, NULL, add_main, IDS_HELP_ADD, MSG_COMMAND_ADD},
21 {L"ASSIGN", NULL, NULL, assign_main, IDS_HELP_ASSIGN, MSG_COMMAND_ASSIGN},
22 {L"ATTACH", NULL, NULL, attach_main, IDS_HELP_ATTACH, MSG_COMMAND_ATTACH},
23 {L"ATTRIBUTES", NULL, NULL, attributes_main, IDS_HELP_ATTRIBUTES, MSG_COMMAND_ATTRIBUTES},
24 {L"AUTOMOUNT", NULL, NULL, automount_main, IDS_HELP_AUTOMOUNT, MSG_COMMAND_AUTOMOUNT},
25 {L"BREAK", NULL, NULL, break_main, IDS_HELP_BREAK, MSG_COMMAND_BREAK},
26 {L"CLEAN", NULL, NULL, clean_main, IDS_HELP_CLEAN, MSG_COMMAND_CLEAN},
27 {L"COMPACT", NULL, NULL, compact_main, IDS_HELP_COMPACT, MSG_COMMAND_COMPACT},
28
29 {L"CONVERT", NULL, NULL, NULL, IDS_HELP_CONVERT, MSG_NONE},
30 {L"CONVERT", L"GPT", NULL, ConvertGPT, IDS_HELP_CONVERT_GPT, MSG_COMMAND_CONVERT_GPT},
31 {L"CONVERT", L"MBR", NULL, ConvertMBR, IDS_HELP_CONVERT_MBR, MSG_COMMAND_CONVERT_MBR},
32
33 {L"CREATE", NULL, NULL, NULL, IDS_HELP_CREATE, MSG_NONE},
34 {L"CREATE", L"PARTITION", NULL, NULL, IDS_HELP_CREATE_PARTITION, MSG_NONE},
35// {L"CREATE", L"PARTITION", L"EFI", CreateEfiPartition, IDS_HELP_CREATE_PARTITION_EFI, MSG_COMMAND_CREATE_PARTITION_EFI},
36 {L"CREATE", L"PARTITION", L"EXTENDED", CreateExtendedPartition, IDS_HELP_CREATE_PARTITION_EXTENDED, MSG_COMMAND_CREATE_PARTITION_EXTENDED},
37 {L"CREATE", L"PARTITION", L"LOGICAL", CreateLogicalPartition, IDS_HELP_CREATE_PARTITION_LOGICAL, MSG_COMMAND_CREATE_PARTITION_LOGICAL},
38// {L"CREATE", L"PARTITION", L"MSR", CreateMsrPartition, IDS_HELP_CREATE_PARTITION_MSR, MSG_COMMAND_CREATE_PARTITION_MSR},
39 {L"CREATE", L"PARTITION", L"PRIMARY", CreatePrimaryPartition, IDS_HELP_CREATE_PARTITION_PRIMARY, MSG_COMMAND_CREATE_PARTITION_PRIMARY},
40 {L"CREATE", L"VOLUME", NULL, NULL, IDS_HELP_CREATE_VOLUME, MSG_NONE},
41 {L"CREATE", L"VDISK", NULL, NULL, IDS_HELP_CREATE_VDISK, MSG_NONE},
42
43 {L"DELETE", NULL, NULL, NULL, IDS_HELP_DELETE, MSG_NONE},
44 {L"DELETE", L"DISK", NULL, DeleteDisk, IDS_HELP_DELETE_DISK, MSG_COMMAND_DELETE_DISK},
45 {L"DELETE", L"PARTITION", NULL, DeletePartition, IDS_HELP_DELETE_PARTITION, MSG_COMMAND_DELETE_PARTITION},
46 {L"DELETE", L"VOLUME", NULL, DeleteVolume, IDS_HELP_DELETE_VOLUME, MSG_COMMAND_DELETE_VOLUME},
47
48 {L"DETACH", NULL, NULL, detach_main, IDS_HELP_DETACH, MSG_COMMAND_DETACH},
49
50 {L"DETAIL", NULL, NULL, NULL, IDS_HELP_DETAIL, MSG_NONE},
51 {L"DETAIL", L"DISK", NULL, DetailDisk, IDS_HELP_DETAIL_DISK, MSG_COMMAND_DETAIL_DISK},
52 {L"DETAIL", L"PARTITION", NULL, DetailPartition, IDS_HELP_DETAIL_PARTITION, MSG_COMMAND_DETAIL_PARTITION},
53 {L"DETAIL", L"VOLUME", NULL, DetailVolume, IDS_HELP_DETAIL_VOLUME, MSG_COMMAND_DETAIL_VOLUME},
54
55 {L"DUMP", NULL, NULL, NULL, IDS_NONE, MSG_NONE},
56 {L"DUMP", L"DISK", NULL, DumpDisk, IDS_NONE, MSG_NONE},
57 {L"DUMP", L"PARTITION", NULL, DumpPartition, IDS_NONE, MSG_NONE},
58 {L"EXIT", NULL, NULL, NULL, IDS_HELP_EXIT, MSG_COMMAND_EXIT},
59
60 {L"EXPAND", NULL, NULL, expand_main, IDS_HELP_EXPAND, MSG_COMMAND_EXPAND},
61 {L"EXTEND", NULL, NULL, extend_main, IDS_HELP_EXTEND, MSG_COMMAND_EXTEND},
62 {L"FILESYSTEMS", NULL, NULL, filesystems_main, IDS_HELP_FILESYSTEMS, MSG_COMMAND_FILESYSTEMS},
63 {L"FORMAT", NULL, NULL, format_main, IDS_HELP_FORMAT, MSG_COMMAND_FORMAT},
64 {L"GPT", NULL, NULL, gpt_main, IDS_HELP_GPT, MSG_COMMAND_GPT},
65 {L"HELP", NULL, NULL, help_main, IDS_HELP_HELP, MSG_COMMAND_HELP},
66 {L"IMPORT", NULL, NULL, import_main, IDS_HELP_IMPORT, MSG_COMMAND_IMPORT},
67 {L"INACTIVE", NULL, NULL, inactive_main, IDS_HELP_INACTIVE, MSG_COMMAND_INACTIVE},
68
69 {L"LIST", NULL, NULL, NULL, IDS_HELP_LIST, MSG_NONE},
70 {L"LIST", L"DISK", NULL, ListDisk, IDS_HELP_LIST_DISK, MSG_COMMAND_LIST_DISK},
71 {L"LIST", L"PARTITION", NULL, ListPartition, IDS_HELP_LIST_PARTITION, MSG_COMMAND_LIST_PARTITION},
72 {L"LIST", L"VOLUME", NULL, ListVolume, IDS_HELP_LIST_VOLUME, MSG_COMMAND_LIST_VOLUME},
73 {L"LIST", L"VDISK", NULL, ListVirtualDisk, IDS_HELP_LIST_VDISK, MSG_COMMAND_LIST_VDISK},
74
75 {L"MERGE", NULL, NULL, merge_main, IDS_HELP_MERGE, MSG_COMMAND_MERGE},
76 {L"OFFLINE", NULL, NULL, offline_main, IDS_HELP_OFFLINE, MSG_COMMAND_OFFLINE},
77 {L"ONLINE", NULL, NULL, online_main, IDS_HELP_ONLINE, MSG_COMMAND_ONLINE},
78 {L"RECOVER", NULL, NULL, recover_main, IDS_HELP_RECOVER, MSG_COMMAND_RECOVER},
79 {L"REM", NULL, NULL, NULL, IDS_HELP_REM, MSG_COMMAND_REM},
80 {L"REMOVE", NULL, NULL, remove_main, IDS_HELP_REMOVE, MSG_COMMAND_REMOVE},
81 {L"REPAIR", NULL, NULL, repair_main, IDS_HELP_REPAIR, MSG_COMMAND_REPAIR},
82 {L"RESCAN", NULL, NULL, rescan_main, IDS_HELP_RESCAN, MSG_COMMAND_RESCAN},
83 {L"RETAIN", NULL, NULL, retain_main, IDS_HELP_RETAIN, MSG_COMMAND_RETAIN},
84 {L"SAN", NULL, NULL, san_main, IDS_HELP_SAN, MSG_COMMAND_SAN},
85
86 {L"SELECT", NULL, NULL, NULL, IDS_HELP_SELECT, MSG_NONE},
87 {L"SELECT", L"DISK", NULL, SelectDisk, IDS_HELP_SELECT_DISK, MSG_COMMAND_SELECT_DISK},
88 {L"SELECT", L"PARTITION", NULL, SelectPartition, IDS_HELP_SELECT_PARTITION, MSG_COMMAND_SELECT_PARTITION},
89 {L"SELECT", L"VOLUME", NULL, SelectVolume, IDS_HELP_SELECT_VOLUME, MSG_COMMAND_SELECT_VOLUME},
90// {L"SELECT", L"VDISK", NULL, SelectVirtualDisk, IDS_HELP_SELECT_VDISK, MSG_COMMAND_SELECT_VDISK},
91
92 {L"SET", NULL, NULL, setid_main, IDS_HELP_SETID, MSG_COMMAND_SETID},
93 {L"SETID", NULL, NULL, setid_main, IDS_HELP_SETID, MSG_COMMAND_SETID},
94 {L"SHRINK", NULL, NULL, shrink_main, IDS_HELP_SHRINK, MSG_COMMAND_SHRINK},
95
96 {L"UNIQUEID", NULL, NULL, NULL, IDS_HELP_UNIQUEID, MSG_NONE},
97 {L"UNIQUEID", L"DISK", NULL, UniqueIdDisk, IDS_HELP_UNIQUEID_DISK, MSG_COMMAND_UNIQUEID_DISK},
98
100};
101
102
103/* FUNCTIONS *****************************************************************/
104
105/*
106 * InterpretCmd(char *cmd_line, char *arg_line):
107 * compares the command name to a list of available commands, and
108 * determines which function to invoke.
109 */
110BOOL
112 int argc,
113 LPWSTR *argv)
114{
115 PCOMMAND cmdptr;
116 PCOMMAND cmdptr1 = NULL;
117 PCOMMAND cmdptr2 = NULL;
118 PCOMMAND cmdptr3 = NULL;
119
120 /* If no args provided */
121 if (argc < 1)
122 return TRUE;
123
124 /* First, determine if the user wants to exit
125 or to use a comment */
126 if (_wcsicmp(argv[0], L"exit") == 0)
127 return FALSE;
128
129 if (_wcsicmp(argv[0], L"rem") == 0)
130 return TRUE;
131
132 /* Scan internal command table */
133 for (cmdptr = cmds; cmdptr->cmd1; cmdptr++)
134 {
135 if ((cmdptr1 == NULL) &&
136 (cmdptr->cmd1 != NULL) && (_wcsicmp(argv[0], cmdptr->cmd1) == 0))
137 cmdptr1 = cmdptr;
138
139 if ((cmdptr2 == NULL) &&
140 (argc >= 2) &&
141 (cmdptr->cmd1 != NULL) && (_wcsicmp(argv[0], cmdptr->cmd1) == 0) &&
142 (cmdptr->cmd2 != NULL) && (_wcsicmp(argv[1], cmdptr->cmd2) == 0))
143 cmdptr2 = cmdptr;
144
145 if ((cmdptr3 == NULL) &&
146 (argc >= 3) &&
147 (cmdptr->cmd1 != NULL) && (_wcsicmp(argv[0], cmdptr->cmd1) == 0) &&
148 (cmdptr->cmd2 != NULL) && (_wcsicmp(argv[1], cmdptr->cmd2) == 0) &&
149 (cmdptr->cmd3 != NULL) && (_wcsicmp(argv[2], cmdptr->cmd3) == 0))
150 cmdptr3 = cmdptr;
151 }
152
153 if (cmdptr3 != NULL)
154 {
155 if (cmdptr3->func == NULL)
156 return HelpCommand(cmdptr3);
157 else
158 return cmdptr3->func(argc, argv);
159 }
160 else if (cmdptr2 != NULL)
161 {
162 if (cmdptr2->func == NULL)
163 return HelpCommand(cmdptr2);
164 else
165 return cmdptr2->func(argc, argv);
166 }
167 else if (cmdptr1 != NULL)
168 {
169 if (cmdptr1->func == NULL)
170 return HelpCommand(cmdptr1);
171 else
172 return cmdptr1->func(argc, argv);
173 }
174
176
177 return TRUE;
178}
179
180
181/*
182 * InterpretScript(char *line):
183 * The main function used for when reading commands from scripts.
184 */
185BOOL
187{
188 LPWSTR args_vector[MAX_ARGS_COUNT];
189 INT args_count = 0;
190 BOOL bWhiteSpace = TRUE;
191 BOOL bQuote = FALSE;
192 LPWSTR ptr;
193
194 memset(args_vector, 0, sizeof(args_vector));
195
196 bQuote = FALSE;
197 ptr = input_line;
198 while (*ptr != 0)
199 {
200 if (*ptr == L'"')
201 bQuote = !bQuote;
202
203 if ((iswspace(*ptr) && (bQuote == FALSE))|| *ptr == L'\n')
204 {
205 *ptr = 0;
206 bWhiteSpace = TRUE;
207 }
208 else
209 {
210 if ((bWhiteSpace != FALSE) && (bQuote == FALSE) && (args_count < MAX_ARGS_COUNT))
211 {
212 args_vector[args_count] = ptr;
213 args_count++;
214 }
215
216 bWhiteSpace = FALSE;
217 }
218
219 ptr++;
220 }
221
222 /* sends the string to find the command */
223 return InterpretCmd(args_count, args_vector);
224}
225
226
227/*
228 * InterpretMain():
229 * Contents for the main program loop as it reads each line, and then
230 * it sends the string to interpret_line, where it determines what
231 * command to use.
232 */
233VOID
235{
236 WCHAR input_line[MAX_STRING_SIZE];
237 LPWSTR args_vector[MAX_ARGS_COUNT];
238 INT args_count = 0;
239 BOOL bWhiteSpace = TRUE;
240 BOOL bQuote = FALSE;
241 BOOL bRun = TRUE;
242 LPWSTR ptr;
243
244 while (bRun != FALSE)
245 {
246 args_count = 0;
247 memset(args_vector, 0, sizeof(args_vector));
248
249 /* Shown just before the input where the user places commands */
251
252 /* Get input from the user. */
253 fgetws(input_line, MAX_STRING_SIZE, stdin);
254
255 bQuote = FALSE;
256 ptr = input_line;
257 while (*ptr != 0)
258 {
259 if (*ptr == L'"')
260 bQuote = !bQuote;
261
262 if ((iswspace(*ptr) && (bQuote == FALSE))|| *ptr == L'\n')
263 {
264 *ptr = 0;
265 bWhiteSpace = TRUE;
266 }
267 else
268 {
269 if ((bWhiteSpace != FALSE) && (bQuote == FALSE) && (args_count < MAX_ARGS_COUNT))
270 {
271 args_vector[args_count] = ptr;
272 args_count++;
273 }
274 bWhiteSpace = FALSE;
275 }
276 ptr++;
277 }
278
279 /* Send the string to find the command */
280 bRun = InterpretCmd(args_count, args_vector);
281 }
282}
static int argc
Definition: ServiceArgs.c:12
BOOL active_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: active.c:16
BOOL assign_main(INT argc, LPWSTR *argv)
Definition: assign.c:11
BOOL attach_main(INT argc, LPWSTR *argv)
Definition: attach.c:11
BOOL automount_main(INT argc, LPWSTR *argv)
Definition: automount.c:11
#define StdOut
Definition: fc.c:14
void ConResPuts(FILE *fp, UINT nID)
Definition: fc.c:27
#define IDS_NONE
Definition: resource.h:144
#define MAX_STRING_SIZE
Definition: precomp.h:40
#define MAX_ARGS_COUNT
Definition: precomp.h:41
#define IDS_APP_PROMPT
Definition: resource.h:13
BOOL add_main(INT argc, LPWSTR *argv)
Definition: add.c:11
BOOL attributes_main(INT argc, LPWSTR *argv)
Definition: attributes.c:11
BOOL CreateLogicalPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: create.c:206
BOOL CreateExtendedPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: create.c:16
BOOL CreatePrimaryPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: create.c:406
BOOL DeleteVolume(_In_ INT argc, _In_ PWSTR *argv)
Definition: delete.c:203
BOOL DeleteDisk(_In_ INT argc, _In_ PWSTR *argv)
Definition: delete.c:28
BOOL InterpretCmd(int argc, LPWSTR *argv)
Definition: interpreter.c:111
BOOL rem_main(INT argc, LPWSTR *argv)
VOID InterpretMain(VOID)
Definition: interpreter.c:234
COMMAND cmds[]
Definition: interpreter.c:17
BOOL exit_main(INT argc, LPWSTR *argv)
BOOL InterpretScript(LPWSTR input_line)
Definition: interpreter.c:186
#define IDS_HELP_SHRINK
Definition: resource.h:195
#define IDS_HELP_DETAIL_VOLUME
Definition: resource.h:159
#define IDS_HELP_MERGE
Definition: resource.h:177
#define IDS_HELP_GPT
Definition: resource.h:166
#define IDS_HELP_DELETE_VOLUME
Definition: resource.h:152
#define IDS_HELP_REM
Definition: resource.h:181
#define IDS_HELP_SETID
Definition: resource.h:194
#define IDS_HELP_EXTEND
Definition: resource.h:163
#define IDS_HELP_ACTIVE
Definition: resource.h:125
#define IDS_HELP_CLEAN
Definition: resource.h:132
#define IDS_HELP_CREATE_PARTITION_PRIMARY
Definition: resource.h:145
#define IDS_HELP_DELETE_PARTITION
Definition: resource.h:151
#define IDS_HELP_REMOVE
Definition: resource.h:182
#define IDS_HELP_CREATE_PARTITION
Definition: resource.h:140
#define IDS_HELP_CREATE_PARTITION_LOGICAL
Definition: resource.h:143
#define IDS_HELP_ONLINE
Definition: resource.h:178
#define IDS_HELP_CONVERT_GPT
Definition: resource.h:136
#define IDS_HELP_CONVERT_MBR
Definition: resource.h:137
#define IDS_HELP_LIST_VDISK
Definition: resource.h:175
#define IDS_HELP_CREATE_VDISK
Definition: resource.h:147
#define IDS_HELP_CREATE
Definition: resource.h:139
#define IDS_HELP_UNIQUEID
Definition: resource.h:197
#define IDS_HELP_SELECT_PARTITION
Definition: resource.h:190
#define IDS_HELP_OFFLINE
Definition: resource.h:179
#define IDS_HELP_UNIQUEID_DISK
Definition: resource.h:198
#define IDS_HELP_BREAK
Definition: resource.h:131
#define MSG_NONE
Definition: resource.h:12
#define IDS_HELP_DELETE
Definition: resource.h:149
#define IDS_HELP_ADD
Definition: resource.h:126
#define IDS_HELP_RESCAN
Definition: resource.h:184
#define IDS_HELP_RECOVER
Definition: resource.h:180
#define IDS_HELP_ATTACH
Definition: resource.h:129
#define IDS_HELP_CREATE_PARTITION_EXTENDED
Definition: resource.h:142
#define IDS_HELP_LIST_DISK
Definition: resource.h:172
#define IDS_HELP_LIST_VOLUME
Definition: resource.h:174
#define IDS_HELP_DETAIL_PARTITION
Definition: resource.h:158
#define IDS_HELP_DELETE_DISK
Definition: resource.h:150
#define IDS_HELP_SELECT_DISK
Definition: resource.h:189
#define IDS_HELP_ASSIGN
Definition: resource.h:127
#define IDS_HELP_HELP
Definition: resource.h:167
#define IDS_HELP_RETAIN
Definition: resource.h:185
#define IDS_HELP_DETAIL
Definition: resource.h:156
#define IDS_HELP_LIST_PARTITION
Definition: resource.h:173
#define IDS_HELP_DETACH
Definition: resource.h:154
#define IDS_HELP_EXPAND
Definition: resource.h:162
#define IDS_HELP_FILESYSTEMS
Definition: resource.h:164
#define IDS_HELP_AUTOMOUNT
Definition: resource.h:130
#define IDS_HELP_SELECT_VOLUME
Definition: resource.h:191
#define IDS_HELP_SELECT
Definition: resource.h:188
#define IDS_HELP_DETAIL_DISK
Definition: resource.h:157
#define IDS_HELP_EXIT
Definition: resource.h:161
#define IDS_HELP_FORMAT
Definition: resource.h:165
#define IDS_HELP_LIST
Definition: resource.h:171
#define IDS_HELP_SAN
Definition: resource.h:186
#define IDS_HELP_COMPACT
Definition: resource.h:133
#define IDS_HELP_IMPORT
Definition: resource.h:168
#define IDS_HELP_INACTIVE
Definition: resource.h:169
#define IDS_HELP_ATTRIBUTES
Definition: resource.h:128
#define IDS_HELP_CREATE_VOLUME
Definition: resource.h:146
#define IDS_HELP_REPAIR
Definition: resource.h:183
#define IDS_HELP_CONVERT
Definition: resource.h:135
BOOL break_main(INT argc, LPWSTR *argv)
Definition: break.c:11
BOOL clean_main(_In_ INT argc, _In_ PWSTR *argv)
Definition: clean.c:16
BOOL compact_main(INT argc, LPWSTR *argv)
Definition: compact.c:11
BOOL detach_main(INT argc, LPWSTR *argv)
Definition: detach.c:11
BOOL DetailPartition(_In_ INT argc, _In_ PWSTR *argv)
Definition: detail.c:132
BOOL DetailDisk(_In_ INT argc, _In_ PWSTR *argv)
Definition: detail.c:68
BOOL DetailVolume(_In_ INT argc, _In_ PWSTR *argv)
Definition: detail.c:205
BOOL HelpCommand(PCOMMAND pCommand)
Definition: help.c:46
BOOL retain_main(INT argc, LPWSTR *argv)
Definition: retain.c:11
BOOL ListPartition(INT argc, PWSTR *argv)
Definition: list.c:88
BOOL DumpPartition(_In_ INT argc, _In_ LPWSTR *argv)
Definition: dump.c:146
BOOL filesystems_main(INT argc, LPWSTR *argv)
BOOL SelectDisk(INT argc, PWSTR *argv)
Definition: select.c:17
BOOL online_main(INT argc, LPWSTR *argv)
Definition: online.c:11
BOOL extend_main(INT argc, LPWSTR *argv)
Definition: extend.c:11
BOOL expand_main(INT argc, LPWSTR *argv)
Definition: expand.c:11
BOOL rescan_main(INT argc, LPWSTR *argv)
Definition: rescan.c:11
BOOL merge_main(INT argc, LPWSTR *argv)
Definition: merge.c:11
BOOL UniqueIdDisk(_In_ INT argc, _In_ PWSTR *argv)
Definition: uniqueid.c:17
BOOL offline_main(INT argc, LPWSTR *argv)
Definition: offline.c:11
BOOL inactive_main(INT argc, LPWSTR *argv)
BOOL ListVolume(INT argc, PWSTR *argv)
Definition: list.c:282
BOOL shrink_main(INT argc, LPWSTR *argv)
Definition: shrink.c:11
BOOL DumpDisk(_In_ INT argc, _In_ LPWSTR *argv)
Definition: dump.c:48
BOOL SelectVolume(INT argc, PWSTR *argv)
Definition: select.c:209
BOOL import_main(INT argc, LPWSTR *argv)
Definition: import.c:11
BOOL repair_main(INT argc, LPWSTR *argv)
Definition: repair.c:11
BOOL format_main(INT argc, LPWSTR *argv)
Definition: format.c:11
BOOL ListVirtualDisk(INT argc, PWSTR *argv)
Definition: list.c:310
BOOL help_main(INT argc, LPWSTR *argv)
Definition: help.c:120
VOID HelpCommandList(VOID)
Definition: help.c:16
BOOL setid_main(INT argc, LPWSTR *argv)
BOOL remove_main(INT argc, LPWSTR *argv)
Definition: remove.c:11
BOOL san_main(INT argc, LPWSTR *argv)
Definition: san.c:11
BOOL gpt_main(INT argc, LPWSTR *argv)
Definition: gpt.c:11
BOOL ListDisk(INT argc, PWSTR *argv)
Definition: list.c:59
BOOL recover_main(INT argc, LPWSTR *argv)
Definition: recover.c:11
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
#define iswspace(_c)
Definition: ctype.h:669
#define stdin
Definition: stdio.h:98
static PVOID ptr
Definition: dispmode.c:27
#define argv
Definition: mplay32.c:18
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Definition: _wcsicmp_nt.c:13
#define memset(x, y, z)
Definition: compat.h:39
BOOLEAN NTAPI DeletePartition(_In_ PPARTLIST List, _In_ PPARTENTRY PartEntry, _Out_opt_ PPARTENTRY *FreeRegion)
Definition: partlist.c:3001
PPARTENTRY SelectPartition(_In_ PPARTLIST List, _In_ ULONG DiskNumber, _In_ ULONG PartitionNumber)
Definition: partlist.c:2268
Definition: main.c:15
INT(* func)(INT, WCHAR **)
Definition: main.c:17
PWSTR cmd3
Definition: diskpart.h:64
PWSTR cmd2
Definition: diskpart.h:63
PWSTR cmd1
Definition: diskpart.h:62
BOOL ConvertGPT(_In_ INT argc, _In_ PWSTR *argv)
Definition: convert.c:94
BOOL ConvertMBR(_In_ INT argc, _In_ PWSTR *argv)
Definition: convert.c:149
int32_t INT
Definition: typedefs.h:58
wchar_t * fgetws(wchar_t *buf, int bufsize, FILE *file)
Definition: wmain.c:22
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184