"Fossies" - the Fresh Open Source Software Archive

Member "src/Common/Common.h" (10 Oct 2018, 2466 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 "Common.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.21_Source_vs_1.22_Source.

    1 /*
    2  Derived from source code of TrueCrypt 7.1a, which is
    3  Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4  by the TrueCrypt License 3.0.
    5 
    6  Modifications and additions to the original source code (contained in this file)
    7  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8  and are governed by the Apache License 2.0 the full text of which is
    9  contained in the file License.txt included in VeraCrypt binary and source
   10  code distribution packages.
   11 */
   12 
   13 #ifndef COMMON_H
   14 #define COMMON_H
   15 
   16 #include "Crypto.h"
   17 
   18 #define MIN_MOUNTED_VOLUME_DRIVE_NUMBER ('A' - 'A')
   19 #define MAX_MOUNTED_VOLUME_DRIVE_NUMBER ('Z' - 'A')
   20 
   21 #define MAX_HOST_DRIVE_NUMBER 64
   22 #define MAX_HOST_PARTITION_NUMBER 32
   23 
   24 #define VOLUME_ID_SIZE  SHA256_DIGESTSIZE
   25 
   26 #define ALIGN_VALUE(value, alignment) (((alignment) == 0)? (value) : (((value) + ((alignment) - 1)) & ~((alignment) - 1)))
   27 
   28 typedef enum
   29 {
   30     // IMPORTANT: If you add a new item here, update IsOSVersionAtLeast().
   31 
   32     WIN_UNKNOWN = 0,
   33     WIN_31,
   34     WIN_95,
   35     WIN_98,
   36     WIN_ME,
   37     WIN_NT3,
   38     WIN_NT4,
   39     WIN_2000,
   40     WIN_XP,
   41     WIN_XP64,
   42     WIN_SERVER_2003,
   43     WIN_VISTA,
   44     WIN_SERVER_2008,
   45     WIN_7,
   46     WIN_SERVER_2008_R2,
   47     WIN_8,
   48     WIN_SERVER_2012,
   49     WIN_8_1,
   50     WIN_SERVER_2012_R2,
   51     WIN_10,
   52     WIN_SERVER_2016
   53 } OSVersionEnum;
   54 
   55 /* Volume types */
   56 enum
   57 {
   58     TC_VOLUME_TYPE_NORMAL = 0,
   59     TC_VOLUME_TYPE_HIDDEN,
   60     TC_VOLUME_TYPE_COUNT
   61 };
   62 
   63 /* Prop volume types */
   64 enum
   65 {
   66     PROP_VOL_TYPE_NORMAL = 0,
   67     PROP_VOL_TYPE_HIDDEN,
   68     PROP_VOL_TYPE_OUTER,                        /* Outer/normal (hidden volume protected) */
   69     PROP_VOL_TYPE_OUTER_VOL_WRITE_PREVENTED,    /* Outer/normal (hidden volume protected AND write already prevented) */
   70     PROP_VOL_TYPE_SYSTEM,
   71     PROP_NBR_VOLUME_TYPES
   72 };
   73 
   74 /* Hidden volume protection status */
   75 enum
   76 {
   77     HIDVOL_PROT_STATUS_NONE = 0,
   78     HIDVOL_PROT_STATUS_ACTIVE,
   79     HIDVOL_PROT_STATUS_ACTION_TAKEN         /* Active + action taken (write operation has already been denied) */
   80 };
   81 
   82 typedef struct
   83 {
   84     BOOL ReadOnly;
   85     BOOL Removable;
   86     BOOL ProtectHiddenVolume;
   87     BOOL PreserveTimestamp;
   88     BOOL PartitionInInactiveSysEncScope;    /* If TRUE, we are to attempt to mount a partition located on an encrypted system drive without pre-boot authentication. */
   89     Password ProtectedHidVolPassword;   /* Password of hidden volume to protect against overwriting */
   90     BOOL UseBackupHeader;
   91     BOOL RecoveryMode;
   92     int ProtectedHidVolPkcs5Prf;
   93     int ProtectedHidVolPim;
   94     wchar_t Label[33]; /* maximum label length is 32 for NTFS and 11 for FAT32 */
   95 } MountOptions;
   96 
   97 #endif