31#define FIRST_BIOS_DISK 0x80
96 ERR(
"DiskOpen(): DiskReadBufferSize is 0, something is wrong.\n");
110 WARN(
"MachDiskGetDriveGeometry(0x%x) failed, fall back to hardcoded values\n", DriveNumber);
125 if (DrivePartition != 0xff && DrivePartition != 0)
144 Context->DriveNumber = DriveNumber;
160 ULONG Length, TotalSectors, MaxSectors, ReadSectors;
178 ReadSectors = TotalSectors;
179 if (ReadSectors > MaxSectors)
180 ReadSectors = MaxSectors;
198 TotalSectors -= ReadSectors;
259 static const CHAR Hex[] =
"0123456789abcdef";
268 "multi(0)disk(0)rdisk(%u)",
273 &Checksum, &
Signature, &ValidPartitionTable);
302 Identifier[18] = (ValidPartitionTable ?
'A' :
'X');
310 UCHAR DiskCount, DriveNumber;
314 *BootDriveReported =
FALSE;
340 TRACE(
"BIOS reports success for disk %d (0x%02X) but data didn't change\n",
341 (
int)DiskCount, DriveNumber);
350 *BootDriveReported =
TRUE;
359 TRACE(
"BIOS reports %d harddisk%s\n",
360 (
int)DiskCount, (DiskCount == 1) ?
"" :
"s");
412 ERR(
"Failed to get boot partition entry\n");
418 "multi(0)disk(0)rdisk(%u)partition(%lu)",
460 return (DiskCount != 0);
PRTL_UNICODE_STRING_BUFFER Path
BOOLEAN DissectArcPath(IN PCSTR ArcPath, OUT PCSTR *Path OPTIONAL, OUT PUCHAR DriveNumber, OUT PULONG PartitionNumber)
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)
LONG DiskReportError(_In_ BOOLEAN bShowError)
BOOLEAN DiskGetBootPartitionEntry(_In_ UCHAR DriveNumber, _Out_opt_ PPARTITION_INFORMATION PartitionEntry, _Out_ PULONG BootPartition)
BOOLEAN DiskGetPartitionEntry(_In_ UCHAR DriveNumber, _In_opt_ ULONG SectorSize, _In_ ULONG PartitionNumber, _Out_ PPARTITION_INFORMATION PartitionEntry)
#define DBG_DEFAULT_CHANNEL(ch)
PVOID FsGetDeviceSpecific(ULONG FileId)
VOID FsSetDeviceSpecific(ULONG FileId, PVOID Specific)
#define MachDiskGetDriveGeometry(Drive, Geom)
#define MachDiskReadLogicalSectors(Drive, Start, Count, Buf)
VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
static const WCHAR Signature[]
CCHAR FrLdrBootPath[MAX_PATH]
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
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 const DEVVTBL DiskVtbl
static BOOLEAN DiskGetBootPath(_In_ BOOLEAN IsPxe, _Out_ PCONFIGURATION_TYPE DeviceType)
struct tagDISKCONTEXT DISKCONTEXT
static ARC_STATUS DiskGetFileInformation(ULONG FileId, FILEINFORMATION *Information)
static CHAR PcDiskIdentifier[32][20]
static ARC_STATUS DiskRead(ULONG FileId, VOID *Buffer, ULONG N, ULONG *Count)
BOOLEAN PcInitializeBootDevices(VOID)
static ARC_STATUS DiskOpen(CHAR *Path, OPENMODE OpenMode, ULONG *FileId)
static ARC_STATUS DiskSeek(ULONG FileId, LARGE_INTEGER *Position, SEEKMODE SeekMode)
static VOID GetHarddiskInformation(_In_ UCHAR DriveNumber)
PCHAR GetHarddiskIdentifier(UCHAR DriveNumber)
static ARC_STATUS DiskClose(ULONG FileId)
static UCHAR EnumerateHarddisks(OUT PBOOLEAN BootDriveReported)
SIZE_T DiskReadBufferSize
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
CONFIGURATION_TYPE DiskGetConfigType(_In_ UCHAR DriveNumber)
enum _CONFIGURATION_TYPE CONFIGURATION_TYPE
enum _CONFIGURATION_TYPE * PCONFIGURATION_TYPE
ULONG BytesPerSector
Number of bytes per sector.
ULONGLONG Sectors
Total number of disk sectors/LBA blocks.
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define TAG_HW_DISK_CONTEXT
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information