12#pragma message(__FILE__": Compiled as C++ for testing purpose.")
15#define WIN32_LEAN_AND_MEAN
71#define FAT_DIR_ENTRY_SIZE 32
75#define VFD_JUMP_CODE "\xeb\x3c\x90"
76#define VFD_OEM_NAME "VFD" VFD_DRIVER_VERSION_STR " "
77#define VFD_VOLUME_LABEL "NO NAME "
78#define VFD_FILESYSTEM "FAT12 "
86 static const DOS_BPB bpb_tbl[] = {
88 {
VFD_BYTES_PER_SECTOR, 2, 1, 2, 112, 320, 0xFE, 1, 8, 1, 0, 0},
89 {
VFD_BYTES_PER_SECTOR, 2, 1, 2, 112, 360, 0xFC, 1, 9, 1, 0, 0},
90 {
VFD_BYTES_PER_SECTOR, 2, 1, 2, 112, 640, 0xFF, 1, 8, 2, 0, 0},
91 {
VFD_BYTES_PER_SECTOR, 2, 1, 2, 112, 720, 0xFD, 2, 9, 2, 0, 0},
92 {
VFD_BYTES_PER_SECTOR, 2, 1, 2, 112, 1280, 0xFB, 2, 8, 2, 0, 0},
93 {
VFD_BYTES_PER_SECTOR, 2, 1, 2, 112, 1440, 0xF9, 3, 9, 2, 0, 0},
94 {
VFD_BYTES_PER_SECTOR, 2, 1, 2, 112, 1640, 0xF9, 3, 10, 2, 0, 0},
95 {
VFD_BYTES_PER_SECTOR, 1, 1, 2, 224, 2400, 0xF9, 7, 15, 2, 0, 0},
96 {
VFD_BYTES_PER_SECTOR, 1, 1, 2, 224, 2880, 0xF0, 9, 18, 2, 0, 0},
97 {
VFD_BYTES_PER_SECTOR, 1, 1, 2, 224, 3360, 0xF0, 10, 21, 2, 0, 0},
98 {
VFD_BYTES_PER_SECTOR, 1, 1, 2, 224, 3444, 0xF0, 10, 21, 2, 0, 0},
99 {
VFD_BYTES_PER_SECTOR, 2, 1, 2, 240, 5760, 0xF0, 9, 36, 2, 0, 0},
104 for (
i = 0;
i <
sizeof(bpb_tbl) /
sizeof(bpb_tbl[0]);
i++) {
105 if (nSectors == bpb_tbl[
i].SmallSectors) {
126 (
"[VFD] VfdFormatImage - IN\n"));
135 (
"[VFD] Unsupported media size %lu\n",
202 (
"[VFD] VfdFormatImage - OUT\n"));
#define ERROR_INVALID_PARAMETER
DWORD WINAPI GetTickCount(VOID)
#define FillMemory(BUF, SIZ, MASK)
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
static unsigned char * fat
UCHAR PhysicalDriveNumber
#define VFDTRACE(LEVEL, STRING)
#define FAT_DIR_ENTRY_SIZE
struct _DOS_PBR * PDOS_PBR
struct _DOS_BPB * PDOS_BPB
static const DOS_BPB * SelectDosBpb(USHORT nSectors)
DWORD FormatBufferFat(PUCHAR pBuffer, ULONG nSectors)
#define VFD_FORMAT_FILL_DATA
#define VFD_BYTES_PER_SECTOR
#define VFD_SECTOR_TO_BYTE(s)