ReactOS 0.4.16-dev-1946-g52006dd
hwdisk.c
Go to the documentation of this file.
1/*
2 * FreeLoader
3 *
4 * Copyright (C) 2003, 2004 Eric Kohl
5 * Copyright (C) 2009 Hervé Poussineau
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22#include <freeldr.h>
23
24#include <debug.h>
26
27/*
28 * This is the common code for harddisk for both the PC and the XBOX.
29 */
30
31#define FIRST_BIOS_DISK 0x80
32#define FIRST_PARTITION 1
33
34typedef struct tagDISKCONTEXT
35{
43
44static const CHAR Hex[] = "0123456789abcdef";
45
46/* Data cache for BIOS disks pre-enumeration */
48static CHAR PcDiskIdentifier[32][20];
49
52
53
54/* FUNCTIONS *****************************************************************/
55
56static ARC_STATUS
58{
61 return ESUCCESS;
62}
63
64static ARC_STATUS
66{
68
70
71 /*
72 * The ARC specification mentions that for partitions, StartingAddress and
73 * EndingAddress are the start and end positions of the partition in terms
74 * of byte offsets from the start of the disk.
75 * CurrentAddress is the current offset into (i.e. relative to) the partition.
76 */
77 Information->StartingAddress.QuadPart = Context->SectorOffset * Context->SectorSize;
78 Information->EndingAddress.QuadPart = (Context->SectorOffset + Context->SectorCount) * Context->SectorSize;
79 Information->CurrentAddress.QuadPart = Context->SectorNumber * Context->SectorSize;
80
82
83 return ESUCCESS;
84}
85
86static ARC_STATUS
87DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
88{
91 UCHAR DriveNumber;
92 ULONG DrivePartition, SectorSize;
95 PARTITION_TABLE_ENTRY PartitionTableEntry;
96
97 if (DiskReadBufferSize == 0)
98 {
99 ERR("DiskOpen(): DiskReadBufferSize is 0, something is wrong.\n");
100 ASSERT(FALSE);
101 return ENOMEM;
102 }
103
104 if (!DissectArcPath(Path, NULL, &DriveNumber, &DrivePartition))
105 return EINVAL;
106
107 DriveType = DiskGetConfigType(DriveNumber);
109 {
110 /* This is a CD-ROM device */
111 SectorSize = 2048;
112 }
113 else
114 {
115 /* This is either a floppy disk or a hard disk device, but it doesn't
116 * matter which one because they both have 512 bytes per sector */
117 SectorSize = 512;
118 }
119
120 if (DrivePartition != 0xff && DrivePartition != 0)
121 {
122 if (!DiskGetPartitionEntry(DriveNumber, DrivePartition, &PartitionTableEntry))
123 return EINVAL;
124
125 SectorOffset = PartitionTableEntry.SectorCountBeforePartition;
126 SectorCount = PartitionTableEntry.PartitionSectorCount;
127 }
128 else
129 {
130 GEOMETRY Geometry;
131 if (!MachDiskGetDriveGeometry(DriveNumber, &Geometry))
132 return EINVAL;
133
134 if (SectorSize != Geometry.BytesPerSector)
135 {
136 ERR("SectorSize (%lu) != Geometry.BytesPerSector (%lu), expect problems!\n",
137 SectorSize, Geometry.BytesPerSector);
138 }
139
140 SectorOffset = 0;
141 SectorCount = Geometry.Sectors;
142 }
143
145 if (!Context)
146 return ENOMEM;
147
148 Context->DriveNumber = DriveNumber;
149 Context->IsFloppy = (DriveType == FloppyDiskPeripheral);
150 Context->SectorSize = SectorSize;
151 Context->SectorOffset = SectorOffset;
152 Context->SectorCount = SectorCount;
153 Context->SectorNumber = 0;
155
156 return ESUCCESS;
157}
158
159static ARC_STATUS
161{
163 UCHAR* Ptr = (UCHAR*)Buffer;
164 ULONG Length, TotalSectors, MaxSectors, ReadSectors;
166 BOOLEAN ret;
167
169
170 TotalSectors = (N + Context->SectorSize - 1) / Context->SectorSize;
171 MaxSectors = DiskReadBufferSize / Context->SectorSize;
172 SectorOffset = Context->SectorOffset + Context->SectorNumber;
173
174 // If MaxSectors is 0, this will lead to infinite loop.
175 // In release builds assertions are disabled, however we also have sanity checks in DiskOpen()
176 ASSERT(MaxSectors > 0);
177
178 ret = TRUE;
179
180 while (TotalSectors)
181 {
182 ReadSectors = TotalSectors;
183 if (ReadSectors > MaxSectors)
184 ReadSectors = MaxSectors;
185
188 ReadSectors,
190 if (!ret)
191 break;
192
193 Length = ReadSectors * Context->SectorSize;
194 if (Length > N)
195 Length = N;
196
198
199 Ptr += Length;
200 N -= Length;
201 SectorOffset += ReadSectors;
202 TotalSectors -= ReadSectors;
203 }
204
206 Context->SectorNumber = SectorOffset - Context->SectorOffset;
207
208 return (!ret) ? EIO : ESUCCESS;
209}
210
211static ARC_STATUS
213{
215 LARGE_INTEGER NewPosition = *Position;
216
217 switch (SeekMode)
218 {
219 case SeekAbsolute:
220 break;
221 case SeekRelative:
222 NewPosition.QuadPart += (Context->SectorNumber * Context->SectorSize);
223 break;
224 default:
225 ASSERT(FALSE);
226 return EINVAL;
227 }
228
229 if (NewPosition.QuadPart & (Context->SectorSize - 1))
230 return EINVAL;
231
232 /* Convert in number of sectors */
233 NewPosition.QuadPart /= Context->SectorSize;
234
235 /* HACK: CDROMs may have a SectorCount of 0 */
236 if (Context->SectorCount != 0 && NewPosition.QuadPart >= Context->SectorCount)
237 return EINVAL;
238
239 Context->SectorNumber = NewPosition.QuadPart;
240 return ESUCCESS;
241}
242
243static const DEVVTBL DiskVtbl =
244{
245 DiskClose,
247 DiskOpen,
248 DiskRead,
249 DiskSeek,
250};
251
252
253PCHAR
255{
256 return PcDiskIdentifier[DriveNumber - FIRST_BIOS_DISK];
257}
258
259static VOID
261{
264 ULONG i;
265 ULONG Checksum;
267 BOOLEAN ValidPartitionTable;
268 CHAR ArcName[MAX_PATH];
269 PARTITION_TABLE_ENTRY PartitionTableEntry;
271
272 /* Detect disk partition type */
273 DiskDetectPartitionType(DriveNumber);
274
275 /* Read the MBR */
276 if (!MachDiskReadLogicalSectors(DriveNumber, 0ULL, 1, DiskReadBuffer))
277 {
278 ERR("Reading MBR failed\n");
279 /* We failed, use a default identifier */
280 sprintf(Identifier, "BIOSDISK%d", DriveNumber - FIRST_BIOS_DISK + 1);
281 return;
282 }
283
286
287 Signature = Mbr->Signature;
288 TRACE("Signature: %x\n", Signature);
289
290 /* Calculate the MBR checksum */
291 Checksum = 0;
292 for (i = 0; i < 512 / sizeof(ULONG); i++)
293 {
294 Checksum += Buffer[i];
295 }
296 Checksum = ~Checksum + 1;
297 TRACE("Checksum: %x\n", Checksum);
298
299 ValidPartitionTable = (Mbr->MasterBootRecordMagic == 0xAA55);
300
301 /* Fill out the ARC disk block */
302 sprintf(ArcName, "multi(0)disk(0)rdisk(%u)", DriveNumber - FIRST_BIOS_DISK);
303 AddReactOSArcDiskInfo(ArcName, Signature, Checksum, ValidPartitionTable);
304
305 sprintf(ArcName, "multi(0)disk(0)rdisk(%u)partition(0)", DriveNumber - FIRST_BIOS_DISK);
306 FsRegisterDevice(ArcName, &DiskVtbl);
307
308 /* Add partitions */
311 while (DiskGetPartitionEntry(DriveNumber, i, &PartitionTableEntry))
312 {
313 if (PartitionTableEntry.SystemIndicator != PARTITION_ENTRY_UNUSED)
314 {
315 sprintf(ArcName, "multi(0)disk(0)rdisk(%u)partition(%lu)", DriveNumber - FIRST_BIOS_DISK, i);
316 FsRegisterDevice(ArcName, &DiskVtbl);
317 }
318 i++;
319 }
321
322 /* Convert checksum and signature to identifier string */
323 Identifier[0] = Hex[(Checksum >> 28) & 0x0F];
324 Identifier[1] = Hex[(Checksum >> 24) & 0x0F];
325 Identifier[2] = Hex[(Checksum >> 20) & 0x0F];
326 Identifier[3] = Hex[(Checksum >> 16) & 0x0F];
327 Identifier[4] = Hex[(Checksum >> 12) & 0x0F];
328 Identifier[5] = Hex[(Checksum >> 8) & 0x0F];
329 Identifier[6] = Hex[(Checksum >> 4) & 0x0F];
330 Identifier[7] = Hex[Checksum & 0x0F];
331 Identifier[8] = '-';
332 Identifier[9] = Hex[(Signature >> 28) & 0x0F];
333 Identifier[10] = Hex[(Signature >> 24) & 0x0F];
334 Identifier[11] = Hex[(Signature >> 20) & 0x0F];
335 Identifier[12] = Hex[(Signature >> 16) & 0x0F];
336 Identifier[13] = Hex[(Signature >> 12) & 0x0F];
337 Identifier[14] = Hex[(Signature >> 8) & 0x0F];
338 Identifier[15] = Hex[(Signature >> 4) & 0x0F];
339 Identifier[16] = Hex[Signature & 0x0F];
340 Identifier[17] = '-';
341 Identifier[18] = (ValidPartitionTable ? 'A' : 'X');
342 Identifier[19] = 0;
343 TRACE("Identifier: %s\n", Identifier);
344}
345
346static UCHAR
348{
349 UCHAR DiskCount, DriveNumber;
350 ULONG i;
351 BOOLEAN Changed;
352
353 *BootDriveReported = FALSE;
354
355 /* Count the number of visible harddisk drives */
357 DiskCount = 0;
358 DriveNumber = FIRST_BIOS_DISK;
359
361
362 /*
363 * There are some really broken BIOSes out there. There are even BIOSes
364 * that happily report success when you ask them to read from non-existent
365 * harddisks. So, we set the buffer to known contents first, then try to
366 * read. If the BIOS reports success but the buffer contents haven't
367 * changed then we fail anyway.
368 */
370 while (MachDiskReadLogicalSectors(DriveNumber, 0ULL, 1, DiskReadBuffer))
371 {
372 Changed = FALSE;
373 for (i = 0; !Changed && i < DiskReadBufferSize; i++)
374 {
375 Changed = ((PUCHAR)DiskReadBuffer)[i] != 0xcd;
376 }
377 if (!Changed)
378 {
379 TRACE("BIOS reports success for disk %d (0x%02X) but data didn't change\n",
380 (int)DiskCount, DriveNumber);
381 break;
382 }
383
384 /* Cache the BIOS hard disk information for later use */
385 GetHarddiskInformation(DriveNumber);
386
387 /* Check if we have seen the boot drive */
388 if (FrldrBootDrive == DriveNumber)
389 *BootDriveReported = TRUE;
390
391 DiskCount++;
392 DriveNumber++;
394 }
396
397 PcBiosDiskCount = DiskCount;
398 TRACE("BIOS reports %d harddisk%s\n",
399 (int)DiskCount, (DiskCount == 1) ? "" : "s");
400
401 return DiskCount;
402}
403
404static BOOLEAN
406{
407 if (*FrLdrBootPath)
408 return TRUE;
409
410 // FIXME! FIXME! Do this in some drive recognition procedure!!!!
411 if (IsPxe)
412 {
413 RtlStringCbCopyA(FrLdrBootPath, sizeof(FrLdrBootPath), "net(0)");
414 }
415 else
416 /* 0x49 is our magic ramdisk drive, so try to detect it first */
417 if (FrldrBootDrive == 0x49)
418 {
419 /* This is the ramdisk. See ArmInitializeBootDevices() too... */
420 // RtlStringCbPrintfA(FrLdrBootPath, sizeof(FrLdrBootPath), "ramdisk(%u)", 0);
421 RtlStringCbCopyA(FrLdrBootPath, sizeof(FrLdrBootPath), "ramdisk(0)");
422 }
424 {
425 /* This is a floppy */
427 "multi(0)disk(0)fdisk(%u)", FrldrBootDrive);
428 }
429 else if (FrldrBootPartition == 0xFF)
430 {
431 /* Boot Partition 0xFF is the magic value that indicates booting from CD-ROM (see isoboot.S) */
433 "multi(0)disk(0)cdrom(%u)", FrldrBootDrive - FIRST_BIOS_DISK);
434 }
435 else
436 {
437 ULONG BootPartition;
438 PARTITION_TABLE_ENTRY PartitionEntry;
439
440 /* This is a hard disk */
441 if (!DiskGetBootPartitionEntry(FrldrBootDrive, &PartitionEntry, &BootPartition))
442 {
443 ERR("Failed to get boot partition entry\n");
444 return FALSE;
445 }
446
447 FrldrBootPartition = BootPartition;
448
450 "multi(0)disk(0)rdisk(%u)partition(%lu)",
452 }
453
454 return TRUE;
455}
456
459{
460 UCHAR DiskCount;
461 BOOLEAN BootDriveReported = FALSE;
463
464 DiskCount = EnumerateHarddisks(&BootDriveReported);
465
466 /* Initialize FrLdrBootPath, the boot path we're booting from (the "SystemPartition") */
468
469 /* Add it, if it's a floppy or CD-ROM */
471 if ((FrldrBootDrive >= FIRST_BIOS_DISK && !BootDriveReported) ||
473 {
474 /* TODO: Check if it's really a CD-ROM drive */
475
478 ULONG Checksum = 0;
480 ULONG i;
481
482 /* Read the MBR */
484 {
485 ERR("Reading MBR failed\n");
486 return FALSE;
487 }
488
491
492 Signature = Mbr->Signature;
493 TRACE("Signature: %x\n", Signature);
494
495 /* Calculate the MBR checksum */
496 for (i = 0; i < 2048 / sizeof(ULONG); i++)
497 {
498 Checksum += Buffer[i];
499 }
500 Checksum = ~Checksum + 1;
501 TRACE("Checksum: %x\n", Checksum);
502
503 /* Fill out the ARC disk block */
505
507 DiskCount++; // This is not accounted for in the number of pre-enumerated BIOS drives!
508 TRACE("Additional boot drive detected: 0x%02X\n", (int)FrldrBootDrive);
509 }
510
511 return (DiskCount != 0);
512}
#define N
Definition: crc32.c:57
UINT DriveType
unsigned char BOOLEAN
PRTL_UNICODE_STRING_BUFFER Path
#define EINVAL
Definition: acclib.h:90
#define ENOMEM
Definition: acclib.h:84
#define EIO
Definition: acclib.h:81
VOID AddReactOSArcDiskInfo(IN PSTR ArcName, IN ULONG Signature, IN ULONG Checksum, IN BOOLEAN ValidPartitionTable)
Definition: archwsup.c:77
@ Identifier
Definition: asmpp.cpp:95
#define ERR(fmt,...)
Definition: precomp.h:57
BOOLEAN DissectArcPath(IN PCSTR ArcPath, OUT PCSTR *Path OPTIONAL, OUT PUCHAR DriveNumber, OUT PULONG PartitionNumber)
Definition: arcname.c:25
BOOLEAN DiskGetPartitionEntry(IN UCHAR DriveNumber, IN ULONG PartitionNumber, OUT PPARTITION_TABLE_ENTRY PartitionTableEntry)
Definition: partition.c:407
BOOLEAN DiskGetBootPartitionEntry(IN UCHAR DriveNumber, OUT PPARTITION_TABLE_ENTRY PartitionTableEntry, OUT PULONG BootPartition)
Definition: partition.c:367
VOID DiskDetectPartitionType(IN UCHAR DriveNumber)
Definition: partition.c:314
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:106
#define PARTITION_ENTRY_UNUSED
Definition: disk.h:71
struct _MASTER_BOOT_RECORD * PMASTER_BOOT_RECORD
PVOID FsGetDeviceSpecific(ULONG FileId)
Definition: fs.c:709
VOID FsSetDeviceSpecific(ULONG FileId, PVOID Specific)
Definition: fs.c:702
VOID FsRegisterDevice(_In_ PCSTR DeviceName, _In_ const DEVVTBL *FuncTable)
Definition: fs.c:673
#define MachDiskGetDriveGeometry(Drive, Geom)
Definition: machine.h:122
#define MachDiskReadLogicalSectors(Drive, Start, Count, Buf)
Definition: machine.h:120
VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: heap.c:553
PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: heap.c:545
#define SectorOffset(L)
Definition: cdprocs.h:1622
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
static const WCHAR Signature[]
Definition: parser.c:141
return ret
Definition: mutex.c:146
#define ULONG_PTR
Definition: config.h:101
CCHAR FrLdrBootPath[MAX_PATH]
Definition: freeldr.c:29
BOOLEAN PxeInit(VOID)
Definition: pxe.c:376
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
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
Definition: glfuncs.h:248
static const DEVVTBL DiskVtbl
Definition: hwdisk.c:243
static BOOLEAN DiskGetBootPath(BOOLEAN IsPxe)
Definition: hwdisk.c:405
PVOID DiskReadBuffer
Definition: hwdisk.c:50
struct tagDISKCONTEXT DISKCONTEXT
static ARC_STATUS DiskGetFileInformation(ULONG FileId, FILEINFORMATION *Information)
Definition: hwdisk.c:65
static CHAR PcDiskIdentifier[32][20]
Definition: hwdisk.c:48
static ARC_STATUS DiskRead(ULONG FileId, VOID *Buffer, ULONG N, ULONG *Count)
Definition: hwdisk.c:160
static const CHAR Hex[]
Definition: hwdisk.c:44
BOOLEAN PcInitializeBootDevices(VOID)
Definition: hwdisk.c:458
#define FIRST_BIOS_DISK
Definition: hwdisk.c:31
static ARC_STATUS DiskOpen(CHAR *Path, OPENMODE OpenMode, ULONG *FileId)
Definition: hwdisk.c:87
static ARC_STATUS DiskSeek(ULONG FileId, LARGE_INTEGER *Position, SEEKMODE SeekMode)
Definition: hwdisk.c:212
static VOID GetHarddiskInformation(UCHAR DriveNumber)
Definition: hwdisk.c:260
PCHAR GetHarddiskIdentifier(UCHAR DriveNumber)
Definition: hwdisk.c:254
static ARC_STATUS DiskClose(ULONG FileId)
Definition: hwdisk.c:57
static UCHAR EnumerateHarddisks(OUT PBOOLEAN BootDriveReported)
Definition: hwdisk.c:347
UCHAR PcBiosDiskCount
Definition: hwdisk.c:47
SIZE_T DiskReadBufferSize
Definition: hwdisk.c:51
#define FIRST_PARTITION
Definition: hwdisk.c:32
#define ASSERT(a)
Definition: mode.c:44
#define sprintf
Definition: sprintf.c:45
#define ULL(a, b)
Definition: format_msg.c:27
int Count
Definition: noreturn.cpp:7
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
Definition: ntstrsafe.h:1148
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
Definition: ntstrsafe.h:156
ULONG SectorCount
Definition: part_xbox.c:31
LONG DiskReportError(BOOLEAN bShowError)
Definition: pcdisk.c:136
CONFIGURATION_TYPE DiskGetConfigType(_In_ UCHAR DriveNumber)
Definition: pcdisk.c:402
@ ESUCCESS
Definition: arc.h:32
ULONG ARC_STATUS
Definition: arc.h:4
@ DiskPeripheral
Definition: arc.h:138
@ FloppyDiskPeripheral
Definition: arc.h:139
@ CdromController
Definition: arc.h:128
@ SeekRelative
Definition: arc.h:60
@ SeekAbsolute
Definition: arc.h:59
enum _OPENMODE OPENMODE
enum _SEEKMODE SEEKMODE
enum _CONFIGURATION_TYPE CONFIGURATION_TYPE
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: parttest.c:75
ULONG PartitionSectorCount
Definition: parttest.c:85
ULONG SectorCountBeforePartition
Definition: parttest.c:84
UCHAR SystemIndicator
Definition: parttest.c:80
Definition: disk.h:26
ULONG BytesPerSector
Number of bytes per sector.
Definition: disk.h:30
ULONGLONG Sectors
Total number of disk sectors/LBA blocks.
Definition: disk.h:31
USHORT MasterBootRecordMagic
Definition: disk.h:63
ULONG Signature
Definition: disk.h:60
Definition: fs.h:25
ULONGLONG SectorOffset
Definition: hwdisk.c:39
BOOLEAN IsFloppy
Definition: hwdisk.c:37
UCHAR DriveNumber
Definition: hwdisk.c:36
ULONGLONG SectorCount
Definition: hwdisk.c:40
ULONGLONG SectorNumber
Definition: hwdisk.c:41
ULONG SectorSize
Definition: hwdisk.c:38
static COORD Position
Definition: mouse.c:34
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
#define TAG_HW_DISK_CONTEXT
Definition: uefidisk.c:16
UCHAR FrldrBootDrive
Definition: uefidisk.c:47
ULONG FrldrBootPartition
Definition: uefidisk.c:48
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
_In_ ULONG SectorSize
Definition: halfuncs.h:291
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175