"Fossies" - the Fresh Open Source Software Archive

Member "src/Main/Forms/WaitDialog.cpp" (10 Oct 2018, 4258 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "WaitDialog.cpp" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Copyright (c) 2013-2017 IDRIX. All rights reserved.
    3 
    4  Governed by the Apache License 2.0 the full text of which is
    5  contained in the file License.txt included in VeraCrypt binary and source
    6  code distribution packages.
    7 */
    8 
    9 #include "System.h"
   10 #include "Volume/EncryptionModeXTS.h"
   11 #include "Main/GraphicUserInterface.h"
   12 #include "Common/SecurityToken.h"
   13 #include "WaitDialog.h"
   14 
   15 namespace VeraCrypt
   16 {
   17     DEFINE_EVENT_TYPE(wxEVT_COMMAND_WAITDIALOGTHREAD_COMPLETED)
   18     DEFINE_EVENT_TYPE(wxEVT_COMMAND_WAITDIALOG_ADMIN_PASSWORD)
   19     DEFINE_EVENT_TYPE(wxEVT_COMMAND_WAITDIALOG_PIN)
   20     DEFINE_EVENT_TYPE(wxEVT_COMMAND_WAITDIALOG_SHOW_MSG)
   21 
   22     wxThread::ExitCode WaitThread::Entry()
   23     {
   24         m_pRoutine->Execute();
   25         wxQueueEvent (m_pHandler, new wxCommandEvent( wxEVT_COMMAND_WAITDIALOGTHREAD_COMPLETED,0));
   26         return (wxThread::ExitCode)0; // success
   27     }
   28 
   29     void WaitDialog::ThrowException(Exception* ex)
   30     {
   31     #define VC_CONVERT_EXCEPTION(NAME) if (dynamic_cast<NAME*> (ex)) throw (NAME&) *ex;
   32         VC_CONVERT_EXCEPTION (PasswordIncorrect);
   33         VC_CONVERT_EXCEPTION (PasswordKeyfilesIncorrect);
   34         VC_CONVERT_EXCEPTION (PasswordOrKeyboardLayoutIncorrect);
   35         VC_CONVERT_EXCEPTION (PasswordOrMountOptionsIncorrect);
   36         VC_CONVERT_EXCEPTION (ProtectionPasswordIncorrect);
   37         VC_CONVERT_EXCEPTION (ProtectionPasswordKeyfilesIncorrect);
   38         VC_CONVERT_EXCEPTION (PasswordEmpty);
   39         VC_CONVERT_EXCEPTION (PasswordTooLong);
   40         VC_CONVERT_EXCEPTION (PasswordUTF8TooLong);
   41         VC_CONVERT_EXCEPTION (PasswordUTF8Invalid);
   42         VC_CONVERT_EXCEPTION (UnportablePassword);
   43         VC_CONVERT_EXCEPTION (ElevationFailed);
   44         VC_CONVERT_EXCEPTION (RootDeviceUnavailable);
   45         VC_CONVERT_EXCEPTION (DriveLetterUnavailable);
   46         VC_CONVERT_EXCEPTION (DriverError);
   47         VC_CONVERT_EXCEPTION (EncryptedSystemRequired);
   48         VC_CONVERT_EXCEPTION (HigherFuseVersionRequired);
   49         VC_CONVERT_EXCEPTION (KernelCryptoServiceTestFailed);
   50         VC_CONVERT_EXCEPTION (LoopDeviceSetupFailed);
   51         VC_CONVERT_EXCEPTION (MountPointRequired);
   52         VC_CONVERT_EXCEPTION (MountPointUnavailable);
   53         VC_CONVERT_EXCEPTION (NoDriveLetterAvailable);
   54         VC_CONVERT_EXCEPTION (TemporaryDirectoryFailure);
   55         VC_CONVERT_EXCEPTION (UnsupportedSectorSizeHiddenVolumeProtection);
   56         VC_CONVERT_EXCEPTION (UnsupportedSectorSizeNoKernelCrypto);
   57         VC_CONVERT_EXCEPTION (VolumeAlreadyMounted);
   58         VC_CONVERT_EXCEPTION (VolumeSlotUnavailable);
   59         VC_CONVERT_EXCEPTION (UserInterfaceException);
   60         VC_CONVERT_EXCEPTION (MissingArgument);
   61         VC_CONVERT_EXCEPTION (NoItemSelected);
   62         VC_CONVERT_EXCEPTION (StringFormatterException);
   63         VC_CONVERT_EXCEPTION (ExecutedProcessFailed);
   64         VC_CONVERT_EXCEPTION (AlreadyInitialized);
   65         VC_CONVERT_EXCEPTION (AssertionFailed);
   66         VC_CONVERT_EXCEPTION (ExternalException);
   67         VC_CONVERT_EXCEPTION (InsufficientData);
   68         VC_CONVERT_EXCEPTION (NotApplicable);
   69         VC_CONVERT_EXCEPTION (NotImplemented);
   70         VC_CONVERT_EXCEPTION (NotInitialized);
   71         VC_CONVERT_EXCEPTION (ParameterIncorrect);
   72         VC_CONVERT_EXCEPTION (ParameterTooLarge);
   73         VC_CONVERT_EXCEPTION (PartitionDeviceRequired);
   74         VC_CONVERT_EXCEPTION (StringConversionFailed);
   75         VC_CONVERT_EXCEPTION (TestFailed);
   76         VC_CONVERT_EXCEPTION (TimeOut);
   77         VC_CONVERT_EXCEPTION (UnknownException);
   78         VC_CONVERT_EXCEPTION (UserAbort)
   79         VC_CONVERT_EXCEPTION (CipherInitError);
   80         VC_CONVERT_EXCEPTION (WeakKeyDetected);
   81         VC_CONVERT_EXCEPTION (HigherVersionRequired);
   82         VC_CONVERT_EXCEPTION (KeyfilePathEmpty);
   83         VC_CONVERT_EXCEPTION (MissingVolumeData);
   84         VC_CONVERT_EXCEPTION (MountedVolumeInUse);
   85         VC_CONVERT_EXCEPTION (UnsupportedSectorSize);
   86         VC_CONVERT_EXCEPTION (VolumeEncryptionNotCompleted);
   87         VC_CONVERT_EXCEPTION (VolumeHostInUse);
   88         VC_CONVERT_EXCEPTION (VolumeProtected);
   89         VC_CONVERT_EXCEPTION (VolumeReadOnly);
   90         VC_CONVERT_EXCEPTION (Pkcs11Exception);
   91         VC_CONVERT_EXCEPTION (InvalidSecurityTokenKeyfilePath);
   92         VC_CONVERT_EXCEPTION (SecurityTokenLibraryNotInitialized);
   93         VC_CONVERT_EXCEPTION (SecurityTokenKeyfileAlreadyExists);
   94         VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound);
   95         VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode);
   96         VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat);
   97         VC_CONVERT_EXCEPTION (SystemException);
   98         VC_CONVERT_EXCEPTION (CipherException);
   99         VC_CONVERT_EXCEPTION (VolumeException);
  100         VC_CONVERT_EXCEPTION (PasswordException);
  101         throw *ex;
  102     }
  103 }