ReactOS 0.4.17-dev-470-gf9e3448
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
33typedef struct tagDISKCONTEXT
34{
42
43/* Data cache for BIOS disks pre-enumeration */
45static CHAR PcDiskIdentifier[32][20];
46
49
50
51/* FUNCTIONS *****************************************************************/
52
53static ARC_STATUS
55{
58 return ESUCCESS;
59}
60
61static ARC_STATUS
63{
65
67
68 /*
69 * The ARC specification mentions that for partitions, StartingAddress and
70 * EndingAddress are the start and end positions of the partition in terms
71 * of byte offsets from the start of the disk.
72 * CurrentAddress is the current offset into (i.e. relative to) the partition.
73 */
74 Information->StartingAddress.QuadPart = Context->SectorOffset * Context->SectorSize;
75 Information->EndingAddress.QuadPart = (Context->SectorOffset + Context->SectorCount) * Context->SectorSize;
76 Information->CurrentAddress.QuadPart = Context->SectorNumber * Context->SectorSize;
77
79
80 return ESUCCESS;
81}
82
83static ARC_STATUS
84DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
85{
88 UCHAR DriveNumber;
89 ULONG DrivePartition, SectorSize;
90 GEOMETRY Geometry;
93 static BOOLEAN PrintForce = FALSE;
94
95 if (DiskReadBufferSize == 0)
96 {
97 ERR("DiskOpen(): DiskReadBufferSize is 0, something is wrong.\n");
99 return ENOMEM;
100 }
101
102 if (!DissectArcPath(Path, NULL, &DriveNumber, &DrivePartition))
103 return EINVAL;
104
105 DriveType = DiskGetConfigType(DriveNumber);
106
107 if (!MachDiskGetDriveGeometry(DriveNumber, &Geometry))
108 return EIO;
109 if (Geometry.BytesPerSector == 0)
110 {
111 WARN("MachDiskGetDriveGeometry(0x%x) failed, fall back to hardcoded values\n", DriveNumber);
113 {
114 /* This is a CD-ROM device */
115 Geometry.BytesPerSector = 2048;
116 }
117 else
118 {
119 /* This is either a floppy disk or a hard disk device, but it doesn't
120 * matter which one because they both have 512 bytes per sector */
121 Geometry.BytesPerSector = 512;
122 }
123 }
124 SectorSize = Geometry.BytesPerSector;
125
126 if (DrivePartition != 0xff && DrivePartition != 0)
127 {
128 PARTITION_INFORMATION PartitionEntry;
129 if (!DiskGetPartitionEntry(DriveNumber, SectorSize, DrivePartition, &PartitionEntry))
130 return EIO;
131
134 }
135 else
136 {
137 SectorOffset = 0;
138 SectorCount = Geometry.Sectors;
139 }
140
142 if (!Context)
143 return ENOMEM;
144
145 if (DriveType == CdromController && SectorSize != 2048)
146 {
147 /* Workaround for CORE-20640 */
148 if (!PrintForce)
149 {
150 ERR("BIOS reports BytesPerSector = %d for CD-ROM, forcing 2048\n", SectorSize);
151 PrintForce = TRUE;
152 }
153 SectorSize = 2048;
154 }
155 Context->DriveNumber = DriveNumber;
156 Context->IsFloppy = (DriveType == FloppyDiskPeripheral);
157 Context->SectorSize = SectorSize;
158 Context->SectorOffset = SectorOffset;
159 Context->SectorCount = SectorCount;
160 Context->SectorNumber = 0;
162
163 return ESUCCESS;
164}
165
166static ARC_STATUS
168{
170 UCHAR* Ptr = (UCHAR*)Buffer;
171 ULONG Length, TotalSectors, MaxSectors, ReadSectors;
173 BOOLEAN ret;
174
176
177 TotalSectors = (N + Context->SectorSize - 1) / Context->SectorSize;
178 MaxSectors = DiskReadBufferSize / Context->SectorSize;
179 SectorOffset = Context->SectorOffset + Context->SectorNumber;
180
181 // If MaxSectors is 0, this will lead to infinite loop.
182 // In release builds assertions are disabled, however we also have sanity checks in DiskOpen()
183 ASSERT(MaxSectors > 0);
184
185 ret = TRUE;
186
187 while (TotalSectors)
188 {
189 ReadSectors = TotalSectors;
190 if (ReadSectors > MaxSectors)
191 ReadSectors = MaxSectors;
192
195 ReadSectors,
197 if (!ret)
198 break;
199
200 Length = ReadSectors * Context->SectorSize;
201 if (Length > N)
202 Length = N;
203
205
206 Ptr += Length;
207 N -= Length;
208 SectorOffset += ReadSectors;
209 TotalSectors -= ReadSectors;
210 }
211
213 Context->SectorNumber = SectorOffset - Context->SectorOffset;
214
215 return (ret ? ESUCCESS : EIO);
216}
217
218static ARC_STATUS
220{
222 LARGE_INTEGER NewPosition = *Position;
223
224 switch (SeekMode)
225 {
226 case SeekAbsolute:
227 break;
228 case SeekRelative:
229 NewPosition.QuadPart += (Context->SectorNumber * Context->SectorSize);
230 break;
231 default:
232 ASSERT(FALSE);
233 return EINVAL;
234 }
235
236 if (NewPosition.QuadPart & (Context->SectorSize - 1))
237 return EINVAL;
238
239 /* Convert in number of sectors */
240 NewPosition.QuadPart /= Context->SectorSize;
241
242 /* HACK: CDROMs may have a SectorCount of 0 */
243 if (Context->SectorCount != 0 && NewPosition.QuadPart >= Context->SectorCount)
244 return EINVAL;
245
246 Context->SectorNumber = NewPosition.QuadPart;
247 return ESUCCESS;
248}
249
250static const DEVVTBL DiskVtbl =
251{
252 DiskClose,
254 DiskOpen,
255 DiskRead,
256 DiskSeek,
257};
258
259
260PCHAR
262{
263 return PcDiskIdentifier[DriveNumber - FIRST_BIOS_DISK];
264}
265
266static VOID
268 _In_ UCHAR DriveNumber)
269{
270 static const CHAR Hex[] = "0123456789abcdef";
271
274 ULONG Checksum, Signature;
275 BOOLEAN ValidPartitionTable;
276 CHAR DiskName[64];
277
278 RtlStringCbPrintfA(DiskName, sizeof(DiskName),
279 "multi(0)disk(0)rdisk(%u)",
280 DriveNumber - FIRST_BIOS_DISK);
281
283 Status = DiskInitialize(DriveNumber, DiskName, DiskPeripheral, &DiskVtbl,
284 &Checksum, &Signature, &ValidPartitionTable);
286
287 if (Status != ESUCCESS)
288 {
289 /* The disk failed to be initialized, use a default identifier */
290 RtlStringCbPrintfA(Identifier, 20, "BIOSDISK%u", DriveNumber - FIRST_BIOS_DISK + 1);
291 return;
292 }
293
294 /* Convert checksum and signature to identifier string */
295 Identifier[0] = Hex[(Checksum >> 28) & 0x0F];
296 Identifier[1] = Hex[(Checksum >> 24) & 0x0F];
297 Identifier[2] = Hex[(Checksum >> 20) & 0x0F];
298 Identifier[3] = Hex[(Checksum >> 16) & 0x0F];
299 Identifier[4] = Hex[(Checksum >> 12) & 0x0F];
300 Identifier[5] = Hex[(Checksum >> 8) & 0x0F];
301 Identifier[6] = Hex[(Checksum >> 4) & 0x0F];
302 Identifier[7] = Hex[Checksum & 0x0F];
303 Identifier[8] = '-';
304 Identifier[9] = Hex[(Signature >> 28) & 0x0F];
305 Identifier[10] = Hex[(Signature >> 24) & 0x0F];
306 Identifier[11] = Hex[(Signature >> 20) & 0x0F];
307 Identifier[12] = Hex[(Signature >> 16) & 0x0F];
308 Identifier[13] = Hex[(Signature >> 12) & 0x0F];
309 Identifier[14] = Hex[(Signature >> 8) & 0x0F];
310 Identifier[15] = Hex[(Signature >> 4) & 0x0F];
311 Identifier[16] = Hex[Signature & 0x0F];
312 Identifier[17] = '-';
313 Identifier[18] = (ValidPartitionTable ? 'A' : 'X');
314 Identifier[19] = ANSI_NULL;
315 TRACE("Identifier: %s\n", Identifier);
316}
317
318static UCHAR
320{
321 UCHAR DiskCount, DriveNumber;
322 ULONG i;
323 BOOLEAN Changed;
324
325 *BootDriveReported = FALSE;
326
327 /* Count the number of visible harddisk drives */
329 DiskCount = 0;
330 DriveNumber = FIRST_BIOS_DISK;
331
333
334 /*
335 * There are some really broken BIOSes out there. There are even BIOSes
336 * that happily report success when you ask them to read from non-existent
337 * harddisks. So, we set the buffer to known contents first, then try to
338 * read. If the BIOS reports success but the buffer contents haven't
339 * changed then we fail anyway.
340 */
342 while (MachDiskReadLogicalSectors(DriveNumber, 0ULL, 1, DiskReadBuffer))
343 {
344 Changed = FALSE;
345 for (i = 0; !Changed && i < DiskReadBufferSize; i++)
346 {
347 Changed = ((PUCHAR)DiskReadBuffer)[i] != 0xcd;
348 }
349 if (!Changed)
350 {
351 TRACE("BIOS reports success for disk %d (0x%02X) but data didn't change\n",
352 (int)DiskCount, DriveNumber);
353 break;
354 }
355
356 /* Register and cache the BIOS hard disk information for later use */
357 GetHarddiskInformation(DriveNumber);
358
359 /* Check if we have seen the boot drive */
360 if (FrldrBootDrive == DriveNumber)
361 *BootDriveReported = TRUE;
362
363 DiskCount++;
364 DriveNumber++;
366 }
368
369 PcBiosDiskCount = DiskCount;
370 TRACE("BIOS reports %d harddisk%s\n",
371 (int)DiskCount, (DiskCount == 1) ? "" : "s");
372
373 return DiskCount;
374}
375
376static BOOLEAN
378 _In_ BOOLEAN IsPxe,
380{
381 // *DeviceType = DiskGetConfigType(FrldrBootDrive);
382 if (*FrLdrBootPath)
383 return TRUE;
384
385 *DeviceType = 0;
386
387 // FIXME: Do this in some drive recognition procedure!
388 if (IsPxe)
389 {
390 RtlStringCbCopyA(FrLdrBootPath, sizeof(FrLdrBootPath), "net(0)");
392 }
393 else
394 /* 0x49 is our magic ramdisk drive, so try to detect it first */
395 if (FrldrBootDrive == 0x49)
396 {
397 /* This is the ramdisk. See ArmInitializeBootDevices() too... */
398 // RtlStringCbPrintfA(FrLdrBootPath, sizeof(FrLdrBootPath), "ramdisk(%u)", 0);
399 RtlStringCbCopyA(FrLdrBootPath, sizeof(FrLdrBootPath), "ramdisk(0)");
401 }
402 else if (FrldrBootDrive < FIRST_BIOS_DISK) // (DiskGetConfigType(FrldrBootDrive) == FloppyDiskPeripheral)
403 {
404 /* This is a floppy */
406 "multi(0)disk(0)fdisk(%u)", FrldrBootDrive);
408 }
409 else if (FrldrBootPartition == 0xFF)
410 {
411 /* Boot Partition 0xFF is the magic value that indicates booting from CD-ROM (see isoboot.S) */
412 // TODO: Check if it's really a CD-ROM drive
414 "multi(0)disk(0)cdrom(%u)", FrldrBootDrive - FIRST_BIOS_DISK);
416 }
417 else
418 {
419 /* This is a hard disk, find the boot partition */
420 ULONG BootPartition;
421 if (!DiskGetBootPartitionEntry(FrldrBootDrive, NULL, &BootPartition))
422 {
423 ERR("Failed to get boot partition entry\n");
424 return FALSE;
425 }
426 FrldrBootPartition = BootPartition;
427
429 "multi(0)disk(0)rdisk(%u)partition(%lu)",
432 }
433
434 return TRUE;
435}
436
439{
440 UCHAR DiskCount;
441 BOOLEAN BootDriveReported = FALSE;
443
444 DiskCount = EnumerateHarddisks(&BootDriveReported);
445
446 /* Initialize FrLdrBootPath, the path FreeLoader starts from */
448
449 /* Add it, if it's a floppy or CD-ROM */
450 if ((FrldrBootDrive >= FIRST_BIOS_DISK && !BootDriveReported) ||
452 {
454
457 &DiskVtbl, NULL, NULL, NULL);
459
460 if (Status == ESUCCESS)
461 {
462 DiskCount++; // This is not accounted for in the number of pre-enumerated BIOS drives!
463 TRACE("Additional boot drive detected: 0x%02X\n", FrldrBootDrive);
464 }
465 else
466 {
467 ERR("Additional boot drive 0x%02X failed\n", FrldrBootDrive);
468 }
469 }
470
471 return (DiskCount != 0);
472}
#define N
Definition: crc32.c:57
UINT DriveType
PRTL_UNICODE_STRING_BUFFER Path
unsigned char BOOLEAN
Definition: actypes.h:127
@ Identifier
Definition: asmpp.cpp:95
#define WARN(fmt,...)
Definition: precomp.h:61
#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
ARC_STATUS DiskInitialize(_In_ UCHAR DriveNumber, _In_ PCSTR DeviceName, _In_ CONFIGURATION_TYPE DeviceType, _In_ const DEVVTBL *FuncTable, _Out_opt_ PULONG pChecksum, _Out_opt_ PULONG pSignature, _Out_opt_ PBOOLEAN pValidPartitionTable)
Definition: disk.c:78
LONG DiskReportError(_In_ BOOLEAN bShowError)
Definition: disk.c:38
BOOLEAN DiskGetBootPartitionEntry(_In_ UCHAR DriveNumber, _Out_opt_ PPARTITION_INFORMATION PartitionEntry, _Out_ PULONG BootPartition)
Definition: partition.c:123
BOOLEAN DiskGetPartitionEntry(_In_ UCHAR DriveNumber, _In_opt_ ULONG SectorSize, _In_ ULONG PartitionNumber, _Out_ PPARTITION_INFORMATION PartitionEntry)
Definition: partition.c:178
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:106
PVOID FsGetDeviceSpecific(ULONG FileId)
Definition: fs.c:711
VOID FsSetDeviceSpecific(ULONG FileId, PVOID Specific)
Definition: fs.c:704
#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 EINVAL
Definition: errno.h:44
#define ENOMEM
Definition: errno.h:35
#define EIO
Definition: errno.h:28
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
Status
Definition: gdiplustypes.h:24
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:250
PVOID DiskReadBuffer
Definition: hwdisk.c:47
static BOOLEAN DiskGetBootPath(_In_ BOOLEAN IsPxe, _Out_ PCONFIGURATION_TYPE DeviceType)
Definition: hwdisk.c:377
struct tagDISKCONTEXT DISKCONTEXT
static ARC_STATUS DiskGetFileInformation(ULONG FileId, FILEINFORMATION *Information)
Definition: hwdisk.c:62
static CHAR PcDiskIdentifier[32][20]
Definition: hwdisk.c:45
static ARC_STATUS DiskRead(ULONG FileId, VOID *Buffer, ULONG N, ULONG *Count)
Definition: hwdisk.c:167
BOOLEAN PcInitializeBootDevices(VOID)
Definition: hwdisk.c:438
#define FIRST_BIOS_DISK
Definition: hwdisk.c:31
static ARC_STATUS DiskOpen(CHAR *Path, OPENMODE OpenMode, ULONG *FileId)
Definition: hwdisk.c:84
static ARC_STATUS DiskSeek(ULONG FileId, LARGE_INTEGER *Position, SEEKMODE SeekMode)
Definition: hwdisk.c:219
static VOID GetHarddiskInformation(_In_ UCHAR DriveNumber)
Definition: hwdisk.c:267
PCHAR GetHarddiskIdentifier(UCHAR DriveNumber)
Definition: hwdisk.c:261
static ARC_STATUS DiskClose(ULONG FileId)
Definition: hwdisk.c:54
static UCHAR EnumerateHarddisks(OUT PBOOLEAN BootDriveReported)
Definition: hwdisk.c:319
UCHAR PcBiosDiskCount
Definition: hwdisk.c:44
SIZE_T DiskReadBufferSize
Definition: hwdisk.c:48
DeviceType
Definition: mmdrv.h:42
#define ASSERT(a)
Definition: mode.c:44
#define ULL(a, b)
Definition: format_msg.c:27
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
int Count
Definition: noreturn.cpp:7
#define ANSI_NULL
_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_brfr.c:22
CONFIGURATION_TYPE DiskGetConfigType(_In_ UCHAR DriveNumber)
Definition: pcdisk.c:381
char CHAR
Definition: pedump.c:57
static char Hex[]
Definition: pnpdump.c:50
@ ESUCCESS
Definition: arc.h:32
ULONG ARC_STATUS
Definition: arc.h:4
@ DiskPeripheral
Definition: arc.h:138
@ FloppyDiskPeripheral
Definition: arc.h:139
@ NetworkPeripheral
Definition: arc.h:149
@ 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
enum _CONFIGURATION_TYPE * PCONFIGURATION_TYPE
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PVOID Context
Definition: storport.h:2269
Definition: disk.h:24
ULONG BytesPerSector
Number of bytes per sector.
Definition: disk.h:28
ULONGLONG Sectors
Total number of disk sectors/LBA blocks.
Definition: disk.h:29
LARGE_INTEGER StartingOffset
Definition: ntdddisk.h:408
LARGE_INTEGER PartitionLength
Definition: ntdddisk.h:409
Definition: fs.h:25
ULONGLONG SectorOffset
Definition: hwdisk.c:38
BOOLEAN IsFloppy
Definition: hwdisk.c:36
UCHAR DriveNumber
Definition: hwdisk.c:35
ULONGLONG SectorCount
Definition: hwdisk.c:39
ULONGLONG SectorNumber
Definition: hwdisk.c:40
ULONG SectorSize
Definition: hwdisk.c:37
static COORD Position
Definition: mouse.c:34
unsigned char UCHAR
Definition: typedefs.h:53
unsigned char * PBOOLEAN
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint64_t ULONGLONG
Definition: typedefs.h:67
#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
#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:57
ULONG FrldrBootPartition
Definition: uefidisk.c:58
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