ReactOS  0.4.13-dev-982-g9853eab
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 
19 typedef struct _DISK_INFO
20 {
21  WORD Cylinders; // DWORD
22  BYTE Heads; // DWORD
23  BYTE Sectors; // QWORD
24  // SectorPerTrack; ??? // DWORD
27 
28 typedef struct _DISK_IMAGE
29 {
31  BYTE DiskType; // Type to return from BIOS & CMOS
32 
34  // CurrentPos;
35 
38  // WCHAR ImageFile[MAX_PATH];
39 
41 
42 typedef enum _DISK_TYPE
43 {
47 } DISK_TYPE;
48 
49 /* FUNCTIONS ******************************************************************/
50 
51 BOOLEAN
52 IsDiskPresent(IN PDISK_IMAGE DiskImage);
53 
54 BYTE
55 SeekDisk(IN PDISK_IMAGE DiskImage,
56  IN WORD Cylinder,
57  IN BYTE Head,
58  IN BYTE Sector);
59 
60 BYTE
61 ReadDisk(IN PDISK_IMAGE DiskImage,
62  IN WORD Cylinder,
63  IN BYTE Head,
64  IN BYTE Sector,
65  IN BYTE NumSectors);
66 
67 BYTE
68 WriteDisk(IN PDISK_IMAGE DiskImage,
69  IN WORD Cylinder,
70  IN BYTE Head,
71  IN BYTE Sector,
72  IN BYTE NumSectors);
73 
75 RetrieveDisk(IN DISK_TYPE DiskType,
76  IN ULONG DiskNumber);
77 
78 BOOLEAN
79 MountDisk(IN DISK_TYPE DiskType,
80  IN ULONG DiskNumber,
83 
84 BOOLEAN
85 UnmountDisk(IN DISK_TYPE DiskType,
86  IN ULONG DiskNumber);
87 
90 
91 #endif /* _DISK_H_ */
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
struct _DISK_IMAGE DISK_IMAGE
WORD Cylinders
Definition: disk.h:21
Definition: arc.h:80
BYTE LastOperationStatus
Definition: disk.h:33
BYTE SeekDisk(IN PDISK_IMAGE DiskImage, IN WORD Cylinder, IN BYTE Head, IN BYTE Sector)
Definition: disk.c:328
WORD SectorSize
Definition: disk.h:25
BYTE Sectors
Definition: disk.h:23
BOOLEAN MountDisk(IN DISK_TYPE DiskType, IN ULONG DiskNumber, IN PCWSTR FileName, IN BOOLEAN ReadOnly)
Definition: disk.c:500
struct _DISK_INFO * PDISK_INFO
BOOLEAN UnmountDisk(IN DISK_TYPE DiskType, IN ULONG DiskNumber)
Definition: disk.c:602
unsigned char BOOLEAN
struct _DISK_INFO DISK_INFO
BOOLEAN ReadOnly
Definition: disk.h:37
BYTE ReadDisk(IN PDISK_IMAGE DiskImage, IN WORD Cylinder, IN BYTE Head, IN BYTE Sector, IN BYTE NumSectors)
Definition: disk.c:359
enum _DISK_TYPE DISK_TYPE
struct _DISK_IMAGE * PDISK_IMAGE
unsigned short WORD
Definition: ntddk_ex.h:93
PDISK_IMAGE RetrieveDisk(IN DISK_TYPE DiskType, IN ULONG DiskNumber)
Definition: disk.c:485
BYTE WriteDisk(IN PDISK_IMAGE DiskImage, IN WORD Cylinder, IN BYTE Head, IN BYTE Sector, IN BYTE NumSectors)
Definition: disk.c:413
BOOLEAN IsDiskPresent(IN PDISK_IMAGE DiskImage)
Definition: disk.c:321
BOOLEAN DiskCtrlInitialize(VOID)
Definition: disk.c:632
unsigned char BYTE
Definition: mem.h:68
BYTE DiskType
Definition: disk.h:31
VOID DiskCtrlCleanup(VOID)
Definition: disk.c:637
HANDLE hDisk
Definition: disk.h:36
unsigned int ULONG
Definition: retypes.h:1
_DISK_TYPE
Definition: disk.h:42
BYTE Heads
Definition: disk.h:22
Definition: disk.h:45
DISK_INFO DiskInfo
Definition: disk.h:30