34 if (NewBootSector ==
NULL)
173 ULONG FirstRootDirSector;
174 ULONG RootDirSectors;
188 DPRINT(
"RootDirSectors = %lu\n", RootDirSectors);
189 DPRINT(
"FirstRootDirSector = %lu\n", FirstRootDirSector);
202 for (
i = 0;
i < RootDirSectors;
i += Sectors)
207 if ((RootDirSectors -
i) <= Sectors)
209 Sectors = RootDirSectors -
i;
249 ULONG RootDirSectors;
258 if (
PartitionInfo->PartitionLength.QuadPart < 16LL * 1024LL * 1024LL)
263 else if (
PartitionInfo->PartitionLength.QuadPart < 128LL * 1024LL * 1024LL)
268 else if (
PartitionInfo->PartitionLength.QuadPart < 256LL * 1024LL * 1024LL)
313 VolumeLabel.Length < 11 ? VolumeLabel.Length : 11);
328 TmpVal3 = (TmpVal1 + (TmpVal2 - 1)) / TmpVal2;
334 1 + (
BootSector.FATSectors * 2) + RootDirSectors;
347 DPRINT(
"FatWipeSectors() failed with status 0x%.08x\n",
Status);
357 DPRINT(
"Fat16WriteBootSector() failed with status 0x%.08x\n",
Status);
368 DPRINT(
"Fat16WriteFAT() failed with status 0x%.08x\n",
Status);
379 DPRINT(
"Fat16WriteFAT() failed with status 0x%.08x.\n",
Status);
388 DPRINT(
"Fat16WriteRootDirectory() failed with status 0x%.08x\n",
Status);
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
_In_ PFCB _In_ LONGLONG FileOffset
#define NT_SUCCESS(StatCode)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
static NTSTATUS Fat16WriteBootSector(IN HANDLE FileHandle, IN PFAT16_BOOT_SECTOR BootSector, IN OUT PFORMAT_CONTEXT Context)
static NTSTATUS Fat16WriteFAT(IN HANDLE FileHandle, IN ULONG SectorOffset, IN PFAT16_BOOT_SECTOR BootSector, IN OUT PFORMAT_CONTEXT Context)
NTSTATUS Fat16Format(IN HANDLE FileHandle, IN PPARTITION_INFORMATION PartitionInfo, IN PDISK_GEOMETRY DiskGeometry, IN PUNICODE_STRING Label, IN BOOLEAN QuickFormat, IN ULONG ClusterSize, IN OUT PFORMAT_CONTEXT Context)
static NTSTATUS Fat16WriteRootDirectory(IN HANDLE FileHandle, IN PFAT16_BOOT_SECTOR BootSector, IN OUT PFORMAT_CONTEXT Context)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID NTAPI RtlFreeOemString(POEM_STRING OemString)
#define RtlFillMemory(Dest, Length, Fill)
struct _FAT16_BOOT_SECTOR * PFAT16_BOOT_SECTOR
#define memcpy(s1, s2, n)
static OUT PIO_STATUS_BLOCK IoStatusBlock
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
ULONG GetShiftCount(IN ULONG Value)
NTSTATUS FatWipeSectors(IN HANDLE FileHandle, IN ULONG TotalSectors, IN ULONG SectorsPerCluster, IN ULONG BytesPerSector, IN OUT PFORMAT_CONTEXT Context)
ULONG CalcVolumeSerialNumber(VOID)
#define FIELD_OFFSET(t, f)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INSUFFICIENT_RESOURCES
VOID UpdateProgress(PFORMAT_CONTEXT Context, ULONG Increment)
_In_ ULONG _In_ struct _SET_PARTITION_INFORMATION_EX * PartitionInfo