ReactOS  0.4.13-dev-656-g74bcf30
vfatlib.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <windef.h>
#include <winbase.h>
#include <ndk/iofuncs.h>
#include <ndk/kefuncs.h>
#include <ndk/obfuncs.h>
#include <ndk/rtlfuncs.h>
#include <fmifs/fmifs.h>
#include "check/dosfsck.h"
#include <pshpack1.h>
#include <poppack.h>
#include "common.h"
Include dependency graph for vfatlib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _FAT16_BOOT_SECTOR
 
struct  _FAT32_BOOT_SECTOR
 
struct  _FAT32_FSINFO
 
struct  _FORMAT_CONTEXT
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define NTOS_MODE_USER
 
#define FSINFO_SECTOR_BEGIN_SIGNATURE   0x41615252
 
#define FSINFO_SECTOR_END_SIGNATURE   0xAA550000
 
#define FSINFO_SIGNATURE   0x61417272
 

Typedefs

typedef struct _FAT16_BOOT_SECTOR FAT16_BOOT_SECTOR
 
typedef struct _FAT16_BOOT_SECTORPFAT16_BOOT_SECTOR
 
typedef struct _FAT32_BOOT_SECTOR FAT32_BOOT_SECTOR
 
typedef struct _FAT32_BOOT_SECTORPFAT32_BOOT_SECTOR
 
typedef struct _FAT32_FSINFO FAT32_FSINFO
 
typedef struct _FAT32_FSINFOPFAT32_FSINFO
 
typedef struct _FORMAT_CONTEXT FORMAT_CONTEXT
 
typedef struct _FORMAT_CONTEXTPFORMAT_CONTEXT
 

Functions

NTSTATUS Fat12Format (HANDLE FileHandle, PPARTITION_INFORMATION PartitionInfo, PDISK_GEOMETRY DiskGeometry, PUNICODE_STRING Label, BOOLEAN QuickFormat, ULONG ClusterSize, PFORMAT_CONTEXT Context)
 
NTSTATUS Fat16Format (HANDLE FileHandle, PPARTITION_INFORMATION PartitionInfo, PDISK_GEOMETRY DiskGeometry, PUNICODE_STRING Label, BOOLEAN QuickFormat, ULONG ClusterSize, PFORMAT_CONTEXT Context)
 
NTSTATUS Fat32Format (HANDLE FileHandle, PPARTITION_INFORMATION PartitionInfo, PDISK_GEOMETRY DiskGeometry, PUNICODE_STRING Label, BOOLEAN QuickFormat, ULONG ClusterSize, PFORMAT_CONTEXT Context)
 
VOID UpdateProgress (PFORMAT_CONTEXT Context, ULONG Increment)
 
VOID VfatPrintV (PCHAR Format, va_list args)
 
VOID VfatPrint (PCHAR Format,...)
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 14 of file vfatlib.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 15 of file vfatlib.h.

◆ FSINFO_SECTOR_BEGIN_SIGNATURE

#define FSINFO_SECTOR_BEGIN_SIGNATURE   0x41615252

Definition at line 99 of file vfatlib.h.

◆ FSINFO_SECTOR_END_SIGNATURE

#define FSINFO_SECTOR_END_SIGNATURE   0xAA550000

Definition at line 100 of file vfatlib.h.

◆ FSINFO_SIGNATURE

#define FSINFO_SIGNATURE   0x61417272

Definition at line 101 of file vfatlib.h.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 18 of file vfatlib.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 13 of file vfatlib.h.

Typedef Documentation

◆ FAT16_BOOT_SECTOR

◆ FAT32_BOOT_SECTOR

◆ FAT32_FSINFO

◆ FORMAT_CONTEXT

◆ PFAT16_BOOT_SECTOR

◆ PFAT32_BOOT_SECTOR

◆ PFAT32_FSINFO

◆ PFORMAT_CONTEXT

Function Documentation

◆ Fat12Format()

NTSTATUS Fat12Format ( HANDLE  FileHandle,
PPARTITION_INFORMATION  PartitionInfo,
PDISK_GEOMETRY  DiskGeometry,
PUNICODE_STRING  Label,
BOOLEAN  QuickFormat,
ULONG  ClusterSize,
PFORMAT_CONTEXT  Context 
)

◆ Fat16Format()

NTSTATUS Fat16Format ( HANDLE  FileHandle,
PPARTITION_INFORMATION  PartitionInfo,
PDISK_GEOMETRY  DiskGeometry,
PUNICODE_STRING  Label,
BOOLEAN  QuickFormat,
ULONG  ClusterSize,
PFORMAT_CONTEXT  Context 
)

◆ Fat32Format()

NTSTATUS Fat32Format ( HANDLE  FileHandle,
PPARTITION_INFORMATION  PartitionInfo,
PDISK_GEOMETRY  DiskGeometry,
PUNICODE_STRING  Label,
BOOLEAN  QuickFormat,
ULONG  ClusterSize,
PFORMAT_CONTEXT  Context 
)

◆ UpdateProgress()

VOID UpdateProgress ( PFORMAT_CONTEXT  Context,
ULONG  Increment 
)

Definition at line 322 of file vfatlib.c.

324 {
325  ULONG NewPercent;
326 
327  Context->CurrentSectorCount += (ULONGLONG)Increment;
328 
329  NewPercent = (Context->CurrentSectorCount * 100ULL) / Context->TotalSectorCount;
330 
331  if (NewPercent > Context->Percent)
332  {
333  Context->Percent = NewPercent;
334  if (Context->Callback != NULL)
335  {
336  Context->Callback(PROGRESS, 0, &Context->Percent);
337  }
338  }
339 }
Definition: fmifs.h:68
smooth NULL
Definition: ftsmooth.c:416
#define ULL(a, b)
Definition: format_msg.c:27
if(!(yy_init))
Definition: macro.lex.yy.c:714
uint64_t ULONGLONG
Definition: typedefs.h:65
unsigned int ULONG
Definition: retypes.h:1
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
Definition: CrNtStubs.h:42

Referenced by Fat12WriteBootSector(), Fat12WriteFAT(), Fat12WriteRootDirectory(), Fat16WriteBootSector(), Fat16WriteFAT(), Fat16WriteRootDirectory(), Fat32WriteBootSector(), Fat32WriteFAT(), Fat32WriteFsInfo(), Fat32WriteRootDirectory(), and FatWipeSectors().

◆ VfatPrint()

VOID VfatPrint ( PCHAR  Format,
  ... 
)

Definition at line 363 of file vfatlib.c.

364 {
365  va_list args;
366 
367  va_start(args, Format);
369  va_end(args);
370 }
VOID VfatPrintV(PCHAR Format, va_list args)
Definition: vfatlib.c:343
Definition: match.c:390
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define args
Definition: format.c:66

Referenced by rename_file(), and VfatChkdsk().

◆ VfatPrintV()

VOID VfatPrintV ( PCHAR  Format,
va_list  args 
)

Definition at line 343 of file vfatlib.c.

344 {
346  CHAR TextBuf[512];
347 
348  _vsnprintf(TextBuf, sizeof(TextBuf), Format, args);
349 
350  /* Prepare parameters */
351  TextOut.Lines = 1;
352  TextOut.Output = TextBuf;
353 
354  DPRINT1("VfatPrint -- %s", TextBuf);
355 
356  /* Do the callback */
357  if (ChkdskCallback)
359 }
char CHAR
Definition: xmlstorage.h:175
Definition: match.c:390
PFMIFSCALLBACK ChkdskCallback
Definition: vfatlib.c:43
#define _vsnprintf
Definition: xmlstorage.h:202
#define DPRINT1
Definition: precomp.h:8
#define TextOut
Definition: wingdi.h:4461
Definition: fmifs.h:82

Referenced by die(), pdie(), and VfatPrint().