- DPRINT("Got %d params\n", argc);
- for (i=0; i<argc; i++)
- DPRINT("Param %d: %s\n", i, argv[i]);
- */
-
- /* Query timeout */
- TimeOut = 3;
- QueryTimeout(&TimeOut);
+ * Parse the command-line: optional command switches,
+ * then the NT volume name (or drive letter) to be analysed.
+ * If "*" is passed this means that we check all the volumes.
+ */
+ if (argc <= 1)
+ {
+ /* Only one parameter (the program name), bail out */
+ return 1;
+ }
+ for (i = 1; i < argc; ++i)
+ {
+ if (argv[i][0] == '/' || argv[i][0] == '-')
+ {
+ DPRINT("Parameter %d: %s\n", i, argv[i]);
+ switch (toupper(argv[i][1]))
+ {
+ case 'K': /* List of drive letters to skip */
+ {
+ /* Check for the separator */
+ if (argv[i][2] != ':')
+ goto Default;
+
+ SkipDrives = &argv[i][3];
+ break;
+ }
+
+ case 'R': /* Repair the errors, implies /P */
+ case 'P': /* Check even if not dirty */
+ {
+ if (argv[i][2] != ANSI_NULL)
+ goto Default;
+
+ CheckOnlyIfDirty = FALSE;
+ break;
+ }
+
+ default: Default:
+ DPRINT1("Unknown switch %d: %s\n", i, argv[i]);
+ break;
+ }
+ }
+ else
+ {
+ DPRINT("Parameter %d - Volume specification: %s\n", i, argv[i]);
+ if (strcmp(argv[i], "*") == 0)
+ {
+ CheckAllVolumes = TRUE;
+ }
+ else
+ {
+ RtlInitEmptyUnicodeString(&VolumePathU,
+ VolumePath,
+ sizeof(VolumePath));
+ RtlInitAnsiString(&VolumePathA, argv[i]);
+ Status = RtlAnsiStringToUnicodeString(&VolumePathU,
+ &VolumePathA,
+ FALSE);
+ }
+
+ /* Stop the parsing now */
+ break;
+ }
+ }