ReactOS 0.4.16-dev-252-g9ccafe8
vfatxlib.h File Reference
#include <fmifs/fmifs.h>
Include dependency graph for vfatxlib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOLEAN NTAPI VfatxChkdsk (IN PUNICODE_STRING DriveRoot, IN PFMIFSCALLBACK Callback, IN BOOLEAN FixErrors, IN BOOLEAN Verbose, IN BOOLEAN CheckOnlyIfDirty, IN BOOLEAN ScanDrive, IN PVOID pUnknown1, IN PVOID pUnknown2, IN PVOID pUnknown3, IN PVOID pUnknown4, IN PULONG ExitStatus)
 
BOOLEAN NTAPI VfatxFormat (IN PUNICODE_STRING DriveRoot, IN PFMIFSCALLBACK Callback, IN BOOLEAN QuickFormat, IN BOOLEAN BackwardCompatible, IN MEDIA_TYPE MediaType, IN PUNICODE_STRING Label, IN ULONG ClusterSize)
 

Function Documentation

◆ VfatxChkdsk()

BOOLEAN NTAPI VfatxChkdsk ( IN PUNICODE_STRING  DriveRoot,
IN PFMIFSCALLBACK  Callback,
IN BOOLEAN  FixErrors,
IN BOOLEAN  Verbose,
IN BOOLEAN  CheckOnlyIfDirty,
IN BOOLEAN  ScanDrive,
IN PVOID  pUnknown1,
IN PVOID  pUnknown2,
IN PVOID  pUnknown3,
IN PVOID  pUnknown4,
IN PULONG  ExitStatus 
)

Definition at line 162 of file vfatxlib.c.

174{
177 return TRUE;
178}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define TRUE
Definition: types.h:120
_In_ NTSTATUS ExitStatus
Definition: psfuncs.h:867
#define STATUS_SUCCESS
Definition: shellext.h:65
uint32_t ULONG
Definition: typedefs.h:59

◆ VfatxFormat()

BOOLEAN NTAPI VfatxFormat ( IN PUNICODE_STRING  DriveRoot,
IN PFMIFSCALLBACK  Callback,
IN BOOLEAN  QuickFormat,
IN BOOLEAN  BackwardCompatible,
IN MEDIA_TYPE  MediaType,
IN PUNICODE_STRING  Label,
IN ULONG  ClusterSize 
)

Definition at line 20 of file vfatxlib.c.

28{
30 DISK_GEOMETRY DiskGeometry;
36
37 DPRINT("VfatxFormat(DriveRoot '%wZ')\n", DriveRoot);
38
39 // FIXME:
40 UNREFERENCED_PARAMETER(MediaType);
41
42 if (BackwardCompatible)
43 {
44 DPRINT1("BackwardCompatible == TRUE is unsupported!\n");
45 return FALSE;
46 }
47
48 Context.TotalSectorCount = 0;
49 Context.CurrentSectorCount = 0;
50 Context.Callback = Callback;
51 Context.Success = FALSE;
52 Context.Percent = 0;
53
55 DriveRoot,
56 0,
57 NULL,
58 NULL);
59
63 &Iosb,
66 if (!NT_SUCCESS(Status))
67 {
68 DPRINT("NtOpenFile() failed with status 0x%08x\n", Status);
69 return FALSE;
70 }
71
73 NULL,
74 NULL,
75 NULL,
76 &Iosb,
78 NULL,
79 0,
80 &DiskGeometry,
81 sizeof(DISK_GEOMETRY));
82 if (!NT_SUCCESS(Status))
83 {
84 DPRINT("IOCTL_DISK_GET_DRIVE_GEOMETRY failed with status 0x%08x\n", Status);
86 return FALSE;
87 }
88
89 if (DiskGeometry.MediaType == FixedMedia)
90 {
91 DPRINT("Cylinders %I64d\n", DiskGeometry.Cylinders.QuadPart);
92 DPRINT("TracksPerCylinder %ld\n", DiskGeometry.TracksPerCylinder);
93 DPRINT("SectorsPerTrack %ld\n", DiskGeometry.SectorsPerTrack);
94 DPRINT("BytesPerSector %ld\n", DiskGeometry.BytesPerSector);
95 DPRINT("DiskSize %I64d\n",
96 DiskGeometry.Cylinders.QuadPart *
97 (ULONGLONG)DiskGeometry.TracksPerCylinder *
98 (ULONGLONG)DiskGeometry.SectorsPerTrack *
99 (ULONGLONG)DiskGeometry.BytesPerSector);
100
102 NULL,
103 NULL,
104 NULL,
105 &Iosb,
107 NULL,
108 0,
110 sizeof(PARTITION_INFORMATION));
111 if (!NT_SUCCESS(Status))
112 {
113 DPRINT("IOCTL_DISK_GET_PARTITION_INFO failed with status 0x%08x\n", Status);
115 return FALSE;
116 }
117 }
118 else
119 {
120 PartitionInfo.PartitionType = 0;
121 PartitionInfo.StartingOffset.QuadPart = 0ULL;
122 PartitionInfo.PartitionLength.QuadPart =
123 DiskGeometry.Cylinders.QuadPart *
124 (ULONGLONG)DiskGeometry.TracksPerCylinder *
125 (ULONGLONG)DiskGeometry.SectorsPerTrack *
126 (ULONGLONG)DiskGeometry.BytesPerSector;
127 PartitionInfo.HiddenSectors = 0;
128 PartitionInfo.PartitionNumber = 0;
129 PartitionInfo.BootIndicator = FALSE;
130 PartitionInfo.RewritePartition = FALSE;
131 PartitionInfo.RecognizedPartition = FALSE;
132 }
133
134 DPRINT("PartitionType 0x%x\n", PartitionInfo.PartitionType);
135 DPRINT("StartingOffset %I64d\n", PartitionInfo.StartingOffset.QuadPart);
136 DPRINT("PartitionLength %I64d\n", PartitionInfo.PartitionLength.QuadPart);
137 DPRINT("HiddenSectors %lu\n", PartitionInfo.HiddenSectors);
138 DPRINT("PartitionNumber %d\n", PartitionInfo.PartitionNumber);
139 DPRINT("BootIndicator 0x%x\n", PartitionInfo.BootIndicator);
140 DPRINT("RewritePartition %d\n", PartitionInfo.RewritePartition);
141 DPRINT("RecognizedPartition %d\n", PartitionInfo.RecognizedPartition);
142
143 if (Callback != NULL)
144 {
145 Context.Percent = 0;
146 Callback(PROGRESS, 0, (PVOID)&Context.Percent);
147 }
148
151 &DiskGeometry,
153 &Context);
155
156 DPRINT("VfatxFormat() done. Status 0x%08x\n", Status);
157 return NT_SUCCESS(Status);
158}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
BOOL QuickFormat
Definition: format.c:66
#define IOCTL_DISK_GET_DRIVE_GEOMETRY
Definition: cdrw_usr.h:169
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define FILE_SHARE_READ
Definition: compat.h:136
return Iosb
Definition: create.c:4402
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
Definition: fltkernel.h:1231
@ PROGRESS
Definition: fmifs.h:82
#define FILE_SYNCHRONOUS_IO_ALERT
Definition: from_kernel.h:30
Status
Definition: gdiplustypes.h:25
#define ULL(a, b)
Definition: format_msg.c:27
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
Definition: file.c:3952
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define FILE_GENERIC_READ
Definition: nt_native.h:653
#define FILE_GENERIC_WRITE
Definition: nt_native.h:660
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
@ FixedMedia
Definition: ntdddisk.h:383
#define IOCTL_DISK_GET_PARTITION_INFO
Definition: ntdddisk.h:106
NTSTATUS FatxFormat(IN HANDLE FileHandle, IN PPARTITION_INFORMATION PartitionInfo, IN PDISK_GEOMETRY DiskGeometry, IN BOOLEAN QuickFormat, IN OUT PFORMAT_CONTEXT Context)
Definition: fatx.c:343
#define DPRINT
Definition: sndvol32.h:73
MEDIA_TYPE MediaType
Definition: ntdddisk.h:401
LARGE_INTEGER Cylinders
Definition: ntdddisk.h:400
ULONG TracksPerCylinder
Definition: ntdddisk.h:402
ULONG SectorsPerTrack
Definition: ntdddisk.h:403
ULONG BytesPerSector
Definition: ntdddisk.h:404
uint64_t ULONGLONG
Definition: typedefs.h:67
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
_In_ ULONG _In_ struct _SET_PARTITION_INFORMATION_EX * PartitionInfo
Definition: iofuncs.h:2105