"Fossies" - the Fresh Open Source Software Archive

Member "src/Common/Format.h" (10 Oct 2018, 3175 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 "Format.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 #ifndef TC_HEADER_Format
   15 #define TC_HEADER_Format
   16 
   17 #include "Password.h"
   18 
   19 #ifdef __cplusplus
   20 extern "C" {
   21 #endif
   22 
   23 // FMIFS
   24 typedef BOOLEAN (__stdcall *PFMIFSCALLBACK)( int command, DWORD subCommand, PVOID parameter );
   25 typedef VOID (__stdcall *PFORMATEX)( PWCHAR DriveRoot, DWORD MediaFlag, PWCHAR Format, PWCHAR Label, BOOL QuickFormat, DWORD ClusterSize, PFMIFSCALLBACK Callback );
   26 
   27 typedef struct
   28 {
   29     BOOL bDevice;
   30     BOOL hiddenVol;
   31     wchar_t *volumePath;
   32     unsigned __int64 size;
   33     unsigned __int64 hiddenVolHostSize;
   34     int ea;
   35     int pkcs5;
   36     uint32 headerFlags;
   37     int fileSystem;
   38     unsigned int clusterSize;
   39     BOOL sparseFileSwitch;
   40     BOOL quickFormat;
   41     DWORD sectorSize;
   42     int *realClusterSize;
   43     Password *password;
   44     int pim;
   45     HWND hwndDlg;
   46     BOOL bForceOperation;
   47     BOOL bGuiMode;
   48 }
   49 FORMAT_VOL_PARAMETERS;
   50 
   51 #define FMIFS_PROGRESS 0x00
   52 #define FMIFS_DONE_WITH_STRUCTURE 0x01
   53 #define FMIFS_INCOMPATIBLE_FILE_SYSTEM 0x03
   54 #define FMIFS_ACCESS_DENIED 0x06
   55 #define FMIFS_MEDIA_WRITE_PROTECTED 0x07
   56 #define FMIFS_VOLUME_IN_USE 0x08
   57 #define FMIFS_CANT_QUICK_FORMAT 0x09
   58 #define FMIFS_DONE 0x0B
   59 #define FMIFS_BAD_LABEL 0x0C
   60 #define FMIFS_OUTPUT 0x0E
   61 #define FMIFS_STRUCTURE_PROGRESS 0x0F
   62 #define FMIFS_CLUSTER_SIZE_TOO_SMALL 0x10
   63 #define FMIFS_CLUSTER_SIZE_TOO_BIG 0x11
   64 #define FMIFS_VOLUME_TOO_SMALL 0x12
   65 #define FMIFS_VOLUME_TOO_BIG 0x13
   66 #define FMIFS_NO_MEDIA_IN_DRIVE 0x14
   67 #define FMIFS_DEVICE_NOT_READY 0x18
   68 #define FMIFS_CHECKDISK_PROGRESS 0x19
   69 #define FMIFS_READ_ONLY_MODE 0x20
   70 
   71 #define FMIFS_HARDDISK  0xC
   72 
   73 extern int FormatWriteBufferSize;
   74 
   75 int TCFormatVolume (volatile FORMAT_VOL_PARAMETERS *volParams);
   76 BOOL FormatNtfs (int driveNo, int clusterSize);
   77 BOOL FormatFs (int driveNo, int clusterSize, int fsType);
   78 uint64 GetVolumeDataAreaSize (BOOL hiddenVolume, uint64 volumeSize);
   79 int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors, void *dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat);
   80 BOOL WriteSector ( void *dev , char *sector , char *write_buf , int *write_buf_cnt , __int64 *nSecNo , PCRYPTO_INFO cryptoInfo );
   81 BOOL FlushFormatWriteBuffer (void *dev, char *write_buf, int *write_buf_cnt, __int64 *nSecNo, PCRYPTO_INFO cryptoInfo);
   82 static BOOL StartFormatWriteThread ();
   83 static void StopFormatWriteThread ();
   84 
   85 #define FILESYS_NONE    0
   86 #define FILESYS_FAT     1
   87 #define FILESYS_NTFS    2
   88 #define FILESYS_EXFAT   3
   89 #define FILESYS_REFS    4
   90 
   91 #ifdef __cplusplus
   92 }
   93 #endif
   94 
   95 #endif // TC_HEADER_Format