ReactOS 0.4.16-dev-329-g9223134
vfatlib.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS VFAT filesystem library
4 * FILE: vfatlib.h
5 */
6
7#ifndef _VFATLIB_H_
8#define _VFATLIB_H_
9
10#include <stdio.h>
11#include <stdlib.h>
12
13#define WIN32_NO_STATUS
14#define _INC_WINDOWS
15#define COM_NO_WINDOWS_H
16#include <windef.h>
17#include <winbase.h>
18#define NTOS_MODE_USER
19#include <ndk/iofuncs.h>
20#include <ndk/kefuncs.h>
21#include <ndk/obfuncs.h>
22#include <ndk/rtlfuncs.h>
23#include <fmifs/fmifs.h>
24
25#include "check/dosfsck.h"
26
27#include <pshpack1.h>
28typedef struct _FAT16_BOOT_SECTOR
29{
30 unsigned char Jump[3]; // 0
31 unsigned char OEMName[8]; // 3
32 unsigned short BytesPerSector; // 11
33 unsigned char SectorsPerCluster; // 13
34 unsigned short ReservedSectors; // 14
35 unsigned char FATCount; // 16
36 unsigned short RootEntries; // 17
37 unsigned short Sectors; // 19
38 unsigned char Media; // 21
39 unsigned short FATSectors; // 22
40 unsigned short SectorsPerTrack; // 24
41 unsigned short Heads; // 26
42 unsigned long HiddenSectors; // 28
43 unsigned long SectorsHuge; // 32
44 unsigned char Drive; // 36
45 unsigned char Res1; // 37
46 unsigned char ExtBootSignature; // 38
47 unsigned long VolumeID; // 39
48 unsigned char VolumeLabel[11]; // 43
49 unsigned char SysType[8]; // 54
50 unsigned char Res2[446]; // 62
51 unsigned long Signature1; // 508
53
54typedef struct _FAT32_BOOT_SECTOR
55{
56 unsigned char Jump[3]; // 0
57 unsigned char OEMName[8]; // 3
58 unsigned short BytesPerSector; // 11
59 unsigned char SectorsPerCluster; // 13
60 unsigned short ReservedSectors; // 14
61 unsigned char FATCount; // 16
62 unsigned short RootEntries; // 17
63 unsigned short Sectors; // 19
64 unsigned char Media; // 21
65 unsigned short FATSectors; // 22
66 unsigned short SectorsPerTrack; // 24
67 unsigned short Heads; // 26
68 unsigned long HiddenSectors; // 28
69 unsigned long SectorsHuge; // 32
70 unsigned long FATSectors32; // 36
71 unsigned short ExtFlag; // 40
72 unsigned short FSVersion; // 42
73 unsigned long RootCluster; // 44
74 unsigned short FSInfoSector; // 48
75 unsigned short BootBackup; // 50
76 unsigned char Res3[12]; // 52
77 unsigned char Drive; // 64
78 unsigned char Res4; // 65
79 unsigned char ExtBootSignature; // 66
80 unsigned long VolumeID; // 67
81 unsigned char VolumeLabel[11]; // 71
82 unsigned char SysType[8]; // 82
83 unsigned char Res2[418]; // 90
84 unsigned long Signature1; // 508
86
87typedef struct _FAT32_FSINFO
88{
89 unsigned long LeadSig; // 0
90 unsigned char Res1[480]; // 4
91 unsigned long StrucSig; // 484
92 unsigned long FreeCount; // 488
93 unsigned long NextFree; // 492
94 unsigned long Res2[3]; // 496
95 unsigned long TrailSig; // 508
97#include <poppack.h>
98
99#define FSINFO_SECTOR_BEGIN_SIGNATURE 0x41615252 // 'RRaA'
100#define FSINFO_SECTOR_END_SIGNATURE 0xAA550000
101#define FSINFO_SIGNATURE 0x61417272 // 'rrAa'
102
103typedef struct _FORMAT_CONTEXT
104{
111
112#include "common.h"
113
114
118 PDISK_GEOMETRY DiskGeometry,
123
127 PDISK_GEOMETRY DiskGeometry,
132
136 PDISK_GEOMETRY DiskGeometry,
141
142VOID
145
146VOID
148
149VOID
151
152#endif /* _VFATLIB_H_ */
153
154/* EOF */
unsigned char BOOLEAN
char * va_list
Definition: acmsvcex.h:78
LONG NTSTATUS
Definition: precomp.h:26
BOOL QuickFormat
Definition: format.c:66
PWCHAR Label
Definition: format.c:70
DWORD ClusterSize
Definition: format.c:67
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
Definition: CrNtStubs.h:46
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
BOOLEAN(NTAPI * PFMIFSCALLBACK)(IN CALLBACKCOMMAND Command, IN ULONG SubAction, IN PVOID ActionInfo)
Definition: fmifs.h:103
struct _FAT32_BOOT_SECTOR * PFAT32_BOOT_SECTOR
struct _FAT32_BOOT_SECTOR FAT32_BOOT_SECTOR
VOID VfatPrint(PCHAR Format,...)
Definition: vfatlib.c:362
struct _FAT32_FSINFO * PFAT32_FSINFO
struct _FAT16_BOOT_SECTOR * PFAT16_BOOT_SECTOR
struct _FAT32_FSINFO FAT32_FSINFO
NTSTATUS Fat16Format(HANDLE FileHandle, PPARTITION_INFORMATION PartitionInfo, PDISK_GEOMETRY DiskGeometry, PUNICODE_STRING Label, BOOLEAN QuickFormat, ULONG ClusterSize, PFORMAT_CONTEXT Context)
NTSTATUS Fat12Format(HANDLE FileHandle, PPARTITION_INFORMATION PartitionInfo, PDISK_GEOMETRY DiskGeometry, PUNICODE_STRING Label, BOOLEAN QuickFormat, ULONG ClusterSize, PFORMAT_CONTEXT Context)
struct _FORMAT_CONTEXT FORMAT_CONTEXT
VOID UpdateProgress(PFORMAT_CONTEXT Context, ULONG Increment)
Definition: vfatlib.c:321
struct _FAT16_BOOT_SECTOR FAT16_BOOT_SECTOR
NTSTATUS Fat32Format(HANDLE FileHandle, PPARTITION_INFORMATION PartitionInfo, PDISK_GEOMETRY DiskGeometry, PUNICODE_STRING Label, BOOLEAN QuickFormat, ULONG ClusterSize, PFORMAT_CONTEXT Context)
struct _FORMAT_CONTEXT * PFORMAT_CONTEXT
VOID VfatPrintV(PCHAR Format, va_list args)
Definition: vfatlib.c:342
unsigned char SysType[8]
Definition: vfatlib.h:49
unsigned char ExtBootSignature
Definition: vfatlib.h:46
unsigned char VolumeLabel[11]
Definition: vfatlib.h:48
unsigned char Media
Definition: vfatlib.h:38
unsigned char FATCount
Definition: vfatlib.h:35
unsigned char Jump[3]
Definition: vfatlib.h:30
unsigned short FATSectors
Definition: vfatlib.h:39
unsigned short RootEntries
Definition: vfatlib.h:36
unsigned short BytesPerSector
Definition: vfatlib.h:32
unsigned long VolumeID
Definition: vfatlib.h:47
unsigned char Res2[446]
Definition: vfatlib.h:50
unsigned long SectorsHuge
Definition: vfatlib.h:43
unsigned short Heads
Definition: vfatlib.h:41
unsigned long HiddenSectors
Definition: vfatlib.h:42
unsigned char SectorsPerCluster
Definition: vfatlib.h:33
unsigned char OEMName[8]
Definition: vfatlib.h:31
unsigned short ReservedSectors
Definition: vfatlib.h:34
unsigned char Drive
Definition: vfatlib.h:44
unsigned short SectorsPerTrack
Definition: vfatlib.h:40
unsigned char Res1
Definition: vfatlib.h:45
unsigned long Signature1
Definition: vfatlib.h:51
unsigned short Sectors
Definition: vfatlib.h:37
unsigned char FATCount
Definition: vfatlib.h:61
unsigned short Sectors
Definition: vfatlib.h:63
unsigned short ReservedSectors
Definition: vfatlib.h:60
unsigned char Res4
Definition: vfatlib.h:78
unsigned short ExtFlag
Definition: vfatlib.h:71
unsigned short Heads
Definition: vfatlib.h:67
unsigned char Jump[3]
Definition: vfatlib.h:56
unsigned short BytesPerSector
Definition: vfatlib.h:58
unsigned long FATSectors32
Definition: vfatlib.h:70
unsigned long VolumeID
Definition: vfatlib.h:80
unsigned short SectorsPerTrack
Definition: vfatlib.h:66
unsigned char Res3[12]
Definition: vfatlib.h:76
unsigned long RootCluster
Definition: vfatlib.h:73
unsigned short RootEntries
Definition: vfatlib.h:62
unsigned char SysType[8]
Definition: vfatlib.h:82
unsigned long HiddenSectors
Definition: vfatlib.h:68
unsigned char Media
Definition: vfatlib.h:64
unsigned short FSVersion
Definition: vfatlib.h:72
unsigned char Res2[418]
Definition: vfatlib.h:83
unsigned char Drive
Definition: vfatlib.h:77
unsigned char VolumeLabel[11]
Definition: vfatlib.h:81
unsigned char ExtBootSignature
Definition: vfatlib.h:79
unsigned char OEMName[8]
Definition: vfatlib.h:57
unsigned short FATSectors
Definition: vfatlib.h:65
unsigned short BootBackup
Definition: vfatlib.h:75
unsigned char SectorsPerCluster
Definition: vfatlib.h:59
unsigned short FSInfoSector
Definition: vfatlib.h:74
unsigned long SectorsHuge
Definition: vfatlib.h:69
unsigned long Signature1
Definition: vfatlib.h:84
unsigned long StrucSig
Definition: vfatlib.h:91
unsigned long FreeCount
Definition: vfatlib.h:92
unsigned long LeadSig
Definition: vfatlib.h:89
unsigned long NextFree
Definition: vfatlib.h:93
unsigned char Res1[480]
Definition: vfatlib.h:90
unsigned long TrailSig
Definition: vfatlib.h:95
unsigned long Res2[3]
Definition: vfatlib.h:94
ULONG Percent
Definition: vfatlib.h:109
ULONG CurrentSectorCount
Definition: vfatlib.h:107
BOOLEAN Success
Definition: vfatlib.h:108
ULONG TotalSectorCount
Definition: vfatlib.h:106
PFMIFSCALLBACK Callback
Definition: vfatlib.h:105
Definition: match.c:390
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
_In_ ULONG _In_ struct _SET_PARTITION_INFORMATION_EX * PartitionInfo
Definition: iofuncs.h:2105