ReactOS 0.4.15-dev-7924-g5949c20
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 321 of file vfatlib.c.

323{
324 ULONG NewPercent;
325
326 Context->CurrentSectorCount += (ULONGLONG)Increment;
327
328 NewPercent = (Context->CurrentSectorCount * 100ULL) / Context->TotalSectorCount;
329
330 if (NewPercent > Context->Percent)
331 {
332 Context->Percent = NewPercent;
333 if (Context->Callback != NULL)
334 {
335 Context->Callback(PROGRESS, 0, &Context->Percent);
336 }
337 }
338}
#define NULL
Definition: types.h:112
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
Definition: CrNtStubs.h:46
@ PROGRESS
Definition: fmifs.h:68
if(dx< 0)
Definition: linetemp.h:194
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67

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

◆ VfatPrint()

VOID VfatPrint ( PCHAR  Format,
  ... 
)

Definition at line 362 of file vfatlib.c.

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

Referenced by rename_file(), and VfatChkdsk().

◆ VfatPrintV()

VOID VfatPrintV ( PCHAR  Format,
va_list  args 
)

Definition at line 342 of file vfatlib.c.

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

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