"Fossies" - the Fresh Open Source Software Archive

Member "src/Common/Fat.h" (10 Oct 2018, 2722 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 "Fat.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 typedef struct fatparams_t
   15 {
   16     char volume_name[11];
   17     byte volume_id[4];
   18     unsigned int num_sectors;   /* total number of sectors */
   19     int cluster_count;  /* number of clusters */
   20     int size_root_dir;  /* size of the root directory in bytes */
   21     int size_fat;       /* size of FAT */
   22     int fats;
   23     int media;
   24     unsigned int cluster_size;
   25     int fat_length;
   26     uint16 dir_entries;
   27     uint16 sector_size;
   28     int hidden;
   29     __int16 reserved;
   30     uint16 sectors;
   31     unsigned int total_sect;
   32 
   33     uint16 heads;
   34     uint16 secs_track;
   35 
   36 } fatparams;
   37 
   38 
   39 struct msdos_boot_sector
   40 {
   41     unsigned char boot_jump[3]; /* Boot strap short or near jump */
   42     char system_id[8];  /* Name - can be used to special case
   43                    partition manager volumes */
   44     unsigned char sector_size[2];   /* bytes per logical sector */
   45     unsigned char cluster_size; /* sectors/cluster */
   46     unsigned short reserved;/* reserved sectors */
   47     unsigned char fats; /* number of FATs */
   48     unsigned char dir_entries[2];   /* root directory entries */
   49     unsigned char sectors[2];   /* number of sectors */
   50     unsigned char media;    /* media code  */
   51     unsigned short fat_length;  /* sectors/FAT */
   52     unsigned short secs_track;  /* sectors per track */
   53     unsigned short heads;   /* number of heads */
   54     unsigned __int32 hidden;    /* hidden sectors */
   55     unsigned __int32 total_sect;    /* number of sectors (if sectors == 0) */
   56     unsigned char drive_number; /* BIOS drive number */
   57     unsigned char RESERVED; /* Unused */
   58     unsigned char ext_boot_sign;    /* 0x29 if fields below exist (DOS 3.3+) */
   59     unsigned char volume_id[4]; /* Volume ID number */
   60     char volume_label[11];  /* Volume label */
   61     char fs_type[8];    /* Typically FAT12, FAT16, or FAT32 */
   62     unsigned char boot_code[448];   /* Boot code (or message) */
   63     unsigned short boot_sign;   /* 0xAA55 */
   64 };
   65 
   66 
   67 void GetFatParams ( fatparams *ft );
   68 void PutBoot ( fatparams *ft , unsigned char *boot );
   69 int FormatFat (void* hwndDlg, unsigned __int64 startSector, fatparams * ft, void * dev, PCRYPTO_INFO cryptoInfo, BOOL quickFormat);