ReactOS 0.4.16-dev-336-gb667d82
disk.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/hardware/disk.h
5 * PURPOSE: Generic Disk Controller (Floppy, Hard Disk, ...)
6 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
7 */
8
9#ifndef _DISK_H_
10#define _DISK_H_
11
12/* DEFINES ********************************************************************/
13
14// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363972(v=vs.85).aspx
15// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363976(v=vs.85).aspx
16// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363969(v=vs.85).aspx
17// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365231(v=vs.85).aspx
18
19typedef struct _DISK_INFO
20{
21 WORD Cylinders; // DWORD
22 BYTE Heads; // DWORD
23 BYTE Sectors; // QWORD
24 // SectorPerTrack; ??? // DWORD
27
28typedef struct _DISK_IMAGE
29{
31 BYTE DiskType; // Type to return from BIOS & CMOS
32
34 // CurrentPos;
35
38 // WCHAR ImageFile[MAX_PATH];
39
41
42typedef enum _DISK_TYPE
43{
48
49/* FUNCTIONS ******************************************************************/
50
53
54BYTE
55SeekDisk(IN PDISK_IMAGE DiskImage,
56 IN WORD Cylinder,
57 IN BYTE Head,
58 IN BYTE Sector);
59
60BYTE
61ReadDisk(IN PDISK_IMAGE DiskImage,
62 IN WORD Cylinder,
63 IN BYTE Head,
64 IN BYTE Sector,
65 IN BYTE NumSectors);
66
67BYTE
68WriteDisk(IN PDISK_IMAGE DiskImage,
69 IN WORD Cylinder,
70 IN BYTE Head,
71 IN BYTE Sector,
72 IN BYTE NumSectors);
73
76 IN ULONG DiskNumber);
77
79MountDisk(IN DISK_TYPE DiskType,
80 IN ULONG DiskNumber,
83
85UnmountDisk(IN DISK_TYPE DiskType,
86 IN ULONG DiskNumber);
87
90
91#endif /* _DISK_H_ */
unsigned char BOOLEAN
unsigned short WORD
Definition: ntddk_ex.h:93
@ ReadOnly
Definition: arc.h:80
HANDLE hDisk
Definition: disk.h:36
DISK_INFO DiskInfo
Definition: disk.h:30
BOOLEAN ReadOnly
Definition: disk.h:37
BYTE DiskType
Definition: disk.h:31
BYTE LastOperationStatus
Definition: disk.h:33
BYTE Sectors
Definition: disk.h:23
WORD SectorSize
Definition: disk.h:25
BYTE Heads
Definition: disk.h:22
WORD Cylinders
Definition: disk.h:21
BOOLEAN DiskCtrlInitialize(VOID)
Definition: disk.c:619
struct _DISK_INFO * PDISK_INFO
_DISK_TYPE
Definition: disk.h:43
@ HARD_DISK
Definition: disk.h:45
@ MAX_DISK_TYPE
Definition: disk.h:46
@ FLOPPY_DISK
Definition: disk.h:44
struct _DISK_INFO DISK_INFO
struct _DISK_IMAGE DISK_IMAGE
BYTE ReadDisk(IN PDISK_IMAGE DiskImage, IN WORD Cylinder, IN BYTE Head, IN BYTE Sector, IN BYTE NumSectors)
Definition: disk.c:359
BOOLEAN UnmountDisk(IN DISK_TYPE DiskType, IN ULONG DiskNumber)
Definition: disk.c:589
VOID DiskCtrlCleanup(VOID)
Definition: disk.c:624
BOOLEAN IsDiskPresent(IN PDISK_IMAGE DiskImage)
Definition: disk.c:321
BYTE WriteDisk(IN PDISK_IMAGE DiskImage, IN WORD Cylinder, IN BYTE Head, IN BYTE Sector, IN BYTE NumSectors)
Definition: disk.c:413
BYTE SeekDisk(IN PDISK_IMAGE DiskImage, IN WORD Cylinder, IN BYTE Head, IN BYTE Sector)
Definition: disk.c:328
enum _DISK_TYPE DISK_TYPE
BOOLEAN MountDisk(IN DISK_TYPE DiskType, IN ULONG DiskNumber, IN PCWSTR FileName, IN BOOLEAN ReadOnly)
Definition: disk.c:500
PDISK_IMAGE RetrieveDisk(IN DISK_TYPE DiskType, IN ULONG DiskNumber)
Definition: disk.c:485
struct _DISK_IMAGE * PDISK_IMAGE
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
unsigned char BYTE
Definition: xxhash.c:193