diff options
Diffstat (limited to 'src/Format/Tcformat.c')
-rw-r--r-- | src/Format/Tcformat.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 31140fd7..66ec3ac3 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -9174,82 +9174,84 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) } else { Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE", hwndDlg); exit(0); } break; case CommandResumeSysEncLogOn: // Same as csysenc but passed only by the system (from the startup sequence) // From now on, we should be the only instance of the TC wizard allowed to deal with system encryption if (CreateSysEncMutex ()) { bDirectSysEncMode = TRUE; bDirectSysEncModeCommand = SYSENC_COMMAND_STARTUP_SEQ_RESUME; ChangeWizardMode (WIZARD_MODE_SYS_DEVICE); } else { Warning ("SYSTEM_ENCRYPTION_IN_PROGRESS_ELSEWHERE", hwndDlg); exit(0); } break; case CommandEncDev: // Resume process of creation of a non-sys-device-hosted volume (passed by Wizard when the user needs to UAC-elevate) DirectDeviceEncMode = TRUE; break; case CommandInplaceDec: // Start (not resume) decrypting the specified non-system volume in place { wchar_t szTmp [TC_MAX_PATH + 8000] = {0}; - GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp)); - - if (wcslen (szTmp) < 1) + if ((HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp))) + && (wcslen (szTmp) >= 1) + ) { - // No valid volume path specified as command-line parameter - AbortProcess ("ERR_PARAMETER_INCORRECT"); - } - memset (szFileName, 0, sizeof (szFileName)); StringCbCopyW (szFileName, sizeof (szFileName), szTmp); DirectNonSysInplaceDecStartMode = TRUE; } + else + { + // No valid volume path specified as command-line parameter + AbortProcess ("ERR_PARAMETER_INCORRECT"); + } + } break; case CommandResumeInplace: // Resume interrupted process of non-system in-place encryption of a partition DirectNonSysInplaceEncResumeMode = TRUE; break; case CommandResumeInplaceDec: // Resume interrupted process of non-system in-place decryption of a partition DirectNonSysInplaceDecResumeMode = TRUE; break; case CommandResumeNonSysInplaceLogOn: // Ask the user whether to resume interrupted process of non-system in-place encryption of a partition // This switch is passed only by the system (from the startup sequence). DirectPromptNonSysInplaceEncResumeMode = TRUE; break; case OptionNoIsoCheck: bDontVerifyRescueDisk = TRUE; break; case OptionHistory: { wchar_t szTmp[8] = {0}; bHistory = bHistoryCmdLine = TRUE; if (HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp))) { if (!_wcsicmp(szTmp,L"y") || !_wcsicmp(szTmp,L"yes")) { bHistory = TRUE; } |