ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

vfatlib.h
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS VFAT filesystem library
00004  * FILE:        vfatlib.h
00005  */
00006 
00007 #include <stdio.h>
00008 
00009 #define WIN32_NO_STATUS
00010 #include <windows.h>
00011 #define NTOS_MODE_USER
00012 #include <ndk/iofuncs.h>
00013 #include <ndk/kefuncs.h>
00014 #include <ndk/obfuncs.h>
00015 #include <ndk/rtlfuncs.h>
00016 #include <fmifs/fmifs.h>
00017 
00018 #include <time.h>
00019 #include <limits.h> // for INT_MAX definition
00020 
00021 #include "check/dosfsck.h"
00022 #include "check/common.h"
00023 #include "check/io.h"
00024 #include "check/lfn.h"
00025 #include "check/boot.h"
00026 #include "check/fat.h"
00027 #include "check/file.h"
00028 #include "check/check.h"
00029 
00030 #include <pshpack1.h>
00031 typedef struct _FAT16_BOOT_SECTOR
00032 {
00033     unsigned char  magic0;                      // 0
00034     unsigned char  res0;                        // 1
00035     unsigned char  magic1;                      // 2
00036     unsigned char  OEMName[8];                  // 3
00037     unsigned short BytesPerSector;              // 11
00038     unsigned char  SectorsPerCluster;           // 13
00039     unsigned short ReservedSectors;             // 14
00040     unsigned char  FATCount;                    // 16
00041     unsigned short RootEntries;                 // 17
00042     unsigned short Sectors;                     // 19
00043     unsigned char  Media;                       // 21
00044     unsigned short FATSectors;                  // 22
00045     unsigned short SectorsPerTrack;             // 24
00046     unsigned short Heads;                       // 26
00047     unsigned long  HiddenSectors;               // 28
00048     unsigned long  SectorsHuge;                 // 32
00049     unsigned char  Drive;                       // 36
00050     unsigned char  Res1;                        // 37
00051     unsigned char  ExtBootSignature;            // 38
00052     unsigned long  VolumeID;                    // 39
00053     unsigned char  VolumeLabel[11];             // 43
00054     unsigned char  SysType[8];                  // 54
00055     unsigned char  Res2[446];                   // 62
00056     unsigned long  Signature1;                  // 508
00057 } FAT16_BOOT_SECTOR, *PFAT16_BOOT_SECTOR;
00058 
00059 
00060 typedef struct _FAT32_BOOT_SECTOR
00061 {
00062     unsigned char  magic0;                      // 0
00063     unsigned char  res0;                        // 1
00064     unsigned char  magic1;                      // 2
00065     unsigned char  OEMName[8];                  // 3
00066     unsigned short BytesPerSector;              // 11
00067     unsigned char  SectorsPerCluster;           // 13
00068     unsigned short ReservedSectors;             // 14
00069     unsigned char  FATCount;                    // 16
00070     unsigned short RootEntries;                 // 17
00071     unsigned short Sectors;                     // 19
00072     unsigned char  Media;                       // 21
00073     unsigned short FATSectors;                  // 22
00074     unsigned short SectorsPerTrack;             // 24
00075     unsigned short Heads;                       // 26
00076     unsigned long  HiddenSectors;               // 28
00077     unsigned long  SectorsHuge;                 // 32
00078     unsigned long  FATSectors32;                // 36
00079     unsigned short ExtFlag;                     // 40
00080     unsigned short FSVersion;                   // 42
00081     unsigned long  RootCluster;                 // 44
00082     unsigned short FSInfoSector;                // 48
00083     unsigned short BootBackup;                  // 50
00084     unsigned char  Res3[12];                    // 52
00085     unsigned char  Drive;                       // 64
00086     unsigned char  Res4;                        // 65
00087     unsigned char  ExtBootSignature;            // 66
00088     unsigned long  VolumeID;                    // 67
00089     unsigned char  VolumeLabel[11];             // 71
00090     unsigned char  SysType[8];                  // 82
00091     unsigned char  Res2[418];                   // 90
00092     unsigned long  Signature1;                  // 508
00093 } FAT32_BOOT_SECTOR, *PFAT32_BOOT_SECTOR;
00094 
00095 typedef struct _FAT32_FSINFO
00096 {
00097     unsigned long  LeadSig;          // 0
00098     unsigned char  Res1[480];        // 4
00099     unsigned long  StrucSig;         // 484
00100     unsigned long  FreeCount;        // 488
00101     unsigned long  NextFree;         // 492
00102     unsigned long  Res2[3];          // 496
00103     unsigned long  TrailSig;         // 508
00104 } FAT32_FSINFO, *PFAT32_FSINFO;
00105 #include <poppack.h>
00106 
00107 typedef struct _FORMAT_CONTEXT
00108 {
00109     PFMIFSCALLBACK Callback;
00110     ULONG TotalSectorCount;
00111     ULONG CurrentSectorCount;
00112     BOOLEAN Success;
00113     ULONG Percent;
00114 } FORMAT_CONTEXT, *PFORMAT_CONTEXT;
00115 
00116 
00117 NTSTATUS
00118 Fat12Format(HANDLE FileHandle,
00119             PPARTITION_INFORMATION PartitionInfo,
00120             PDISK_GEOMETRY DiskGeometry,
00121             PUNICODE_STRING Label,
00122             BOOLEAN QuickFormat,
00123             ULONG ClusterSize,
00124             PFORMAT_CONTEXT Context);
00125 
00126 NTSTATUS
00127 Fat16Format(HANDLE FileHandle,
00128             PPARTITION_INFORMATION PartitionInfo,
00129             PDISK_GEOMETRY DiskGeometry,
00130             PUNICODE_STRING Label,
00131             BOOLEAN QuickFormat,
00132             ULONG ClusterSize,
00133             PFORMAT_CONTEXT Context);
00134 
00135 NTSTATUS
00136 Fat32Format(HANDLE FileHandle,
00137             PPARTITION_INFORMATION PartitionInfo,
00138             PDISK_GEOMETRY DiskGeometry,
00139             PUNICODE_STRING Label,
00140             BOOLEAN QuickFormat,
00141             ULONG ClusterSize,
00142             PFORMAT_CONTEXT Context);
00143 
00144 VOID
00145 UpdateProgress(PFORMAT_CONTEXT Context,
00146                ULONG Increment);
00147 
00148 VOID
00149 VfatPrint(PCHAR Format, ...);
00150 
00151 /* EOF */

Generated on Fri May 25 2012 04:31:38 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.