"Fossies" - the Fresh Open Source Software Archive

Member "src/Mount/Mount.h" (10 Oct 2018, 5261 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 "Mount.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Legal Notice: Some portions of the source code contained in this file were
    3  derived from the source code of TrueCrypt 7.1a, which is 
    4  Copyright (c) 2003-2012 TrueCrypt Developers Association and which is 
    5  governed by the TrueCrypt License 3.0, also from the source code of
    6  Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux
    7  and which is governed by the 'License Agreement for Encryption for the Masses' 
    8  Modifications and additions to the original source code (contained in this file) 
    9  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
   10  and are governed by the Apache License 2.0 the full text of which is
   11  contained in the file License.txt included in VeraCrypt binary and source
   12  code distribution packages. */
   13 
   14 #ifdef __cplusplus
   15 
   16 #include "Favorites.h"
   17 
   18 extern "C" {
   19 #endif
   20 
   21 enum mount_list_item_types
   22 {
   23     TC_MLIST_ITEM_FREE = 0,
   24     TC_MLIST_ITEM_NONSYS_VOL,
   25     TC_MLIST_ITEM_SYS_PARTITION,
   26     TC_MLIST_ITEM_SYS_DRIVE
   27 };
   28 
   29 #define TC_MAIN_WINDOW_FLAG_ADMIN_PRIVILEGES    0x1
   30 
   31 #define TRAYICON_MENU_DRIVE_OFFSET  9000
   32 #define TC_FAVORITE_MENU_CMD_ID_OFFSET 10000
   33 #define TC_FAVORITE_MENU_CMD_ID_OFFSET_END (TC_FAVORITE_MENU_CMD_ID_OFFSET + 1000)
   34 
   35 #define WM_COPY_SET_VOLUME_NAME     "VNAM"
   36 
   37 #define ENC_SYSDRIVE_PSEUDO_DRIVE_LETTER    ('A' - 1)
   38 
   39 /* Password Change dialog modes */
   40 enum
   41 {
   42     PCDM_CHANGE_PASSWORD = 0,
   43     PCDM_CHANGE_PKCS5_PRF,
   44     PCDM_ADD_REMOVE_VOL_KEYFILES,
   45     PCDM_REMOVE_ALL_KEYFILES_FROM_VOL
   46 };
   47 
   48 typedef struct
   49 {
   50     BOOL bHidVolDamagePrevReported[26];
   51 } VOLUME_NOTIFICATIONS_LIST;
   52 
   53 typedef struct
   54 {
   55     Password *password;
   56     int* pkcs5;
   57     int* pim;
   58     BOOL* truecryptMode;
   59 } PasswordDlgParam;
   60 
   61 extern VOLUME_NOTIFICATIONS_LIST VolumeNotificationsList;
   62 
   63 extern BOOL bEnableBkgTask;
   64 extern BOOL bCloseBkgTaskWhenNoVolumes;
   65 extern BOOL bPlaySoundOnSuccessfulHkDismount;
   66 extern BOOL bDisplayBalloonOnSuccessfulHkDismount;
   67 extern BOOL bExplore;
   68 extern BOOL bTryEmptyPasswordWhenKeyfileUsed;
   69 
   70 static void localcleanup ( void );
   71 void EndMainDlg ( HWND hwndDlg );
   72 void EnableDisableButtons ( HWND hwndDlg );
   73 BOOL VolumeSelected (HWND hwndDlg );
   74 void LoadSettings ( HWND hwndDlg );
   75 void SaveSettings ( HWND hwndDlg );
   76 BOOL SelectItem ( HWND hTree , wchar_t nLetter );
   77 void LoadDriveLetters ( HWND hwndDlg, HWND hTree, int drive );
   78 BOOL CALLBACK PasswordChangeDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
   79 BOOL CALLBACK PasswordDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
   80 BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
   81 void BuildTree ( HWND hwndDlg, HWND hTree );
   82 LPARAM GetSelectedLong ( HWND hTree );
   83 LPARAM GetItemLong ( HWND hTree, int itemNo );
   84 BOOL CALLBACK CommandHelpDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
   85 BOOL CALLBACK MainDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
   86 void ExtractCommandLine ( HWND hwndDlg , wchar_t *lpszCommandLine );
   87 static void WipeCache (HWND hwndDlg, BOOL silent);
   88 void OpenVolumeExplorerWindow (int driveNo);
   89 BOOL TaskBarIconAdd (HWND hwnd);
   90 BOOL TaskBarIconRemove (HWND hwnd);
   91 BOOL TaskBarIconChange (HWND hwnd, int iconId);
   92 void DismountIdleVolumes ();
   93 static void SaveDefaultKeyFilesParam (HWND hwnd);
   94 static BOOL Dismount (HWND hwndDlg, int nDosDriveNo);
   95 static BOOL DismountAll (HWND hwndDlg, BOOL forceUnmount, BOOL interact, int dismountMaxRetries, int dismountAutoRetryDelay);
   96 static void KeyfileDefaultsDlg (HWND hwndDlg);
   97 static void HandleHotKey (HWND hwndDlg, WPARAM wParam);
   98 static BOOL CheckMountList (HWND hwndDlg, BOOL bForceTaskBarUpdate);
   99 int GetCipherBlockSizeByDriveNo (int nDosDriveNo);
  100 int GetModeOfOperationByDriveNo (int nDosDriveNo);
  101 void ChangeMainWindowVisibility ();
  102 BOOL WholeSysDriveEncryption (BOOL bSilent);
  103 BOOL CheckSysEncMountWithoutPBA (HWND hwndDlg, const wchar_t *devicePath, BOOL quiet);
  104 BOOL TCBootLoaderOnInactiveSysEncDrive (wchar_t *szDevicePath);
  105 void CreateRescueDisk (HWND hwndDlg);
  106 int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, const wchar_t *lpszVolume);
  107 int RestoreVolumeHeader (HWND hwndDlg, const wchar_t *lpszVolume);
  108 void SecurityTokenPreferencesDialog (HWND hwndDlg);
  109 static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  110 static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  111 void MountSelectedVolume (HWND hwndDlg, BOOL mountWithOptions);
  112 uint32 ReadDriverConfigurationFlags ();
  113 void HookMouseWheel (HWND hwndDlg, UINT ctrlId);
  114 static BOOL HandleDriveListMouseWheelEvent (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL bListMustBePointed);
  115 static BOOL CALLBACK DefaultMountParametersDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
  116 
  117 #ifdef __cplusplus
  118 }
  119 
  120 typedef struct
  121 {
  122     BOOL systemFavorites;
  123     BOOL logOnMount;
  124     BOOL hotKeyMount;
  125     VeraCrypt::FavoriteVolume* favoriteVolumeToMount;
  126 } mountFavoriteVolumeThreadParam;
  127 
  128 void SetDriverConfigurationFlag (uint32 flag, BOOL state);
  129 BOOL MountFavoriteVolumes (HWND hwnd, BOOL systemFavorites = FALSE, BOOL logOnMount = FALSE, BOOL hotKeyMount = FALSE, const VeraCrypt::FavoriteVolume &favoriteVolumeToMount = VeraCrypt::FavoriteVolume());
  130 void __cdecl mountFavoriteVolumeThreadFunction (void *pArg);
  131 
  132 #endif