20#if defined(_M_IX86) || defined(_M_AMD64)
41#if defined(SARCH_XBOX)
42 UiMessageBox(
"Boot sector booting is not supported on XBOX.");
49 UCHAR BiosDriveNumber = 0;
59 if (!ArgValue || !*ArgValue ||
_stricmp(ArgValue,
"BootSector") != 0)
61 ERR(
"Unexpected boot type '%s', aborting\n", ArgValue ? ArgValue :
"n/a");
74 if (!BootPath || !*BootPath)
80 if (ArgValue && *ArgValue)
87 if (ArgValue && *ArgValue)
101 if (BootPath && *BootPath)
111 UiMessageBox(
"Currently unsupported BootPath value:\n%s", BootPath);
124 if (
strstr(BootPath,
")partition()") ||
strstr(BootPath,
")partition(0)"))
150 if (!BiosDriveNumber)
181 WhatFailed =
"boot sector file";
183 WhatFailed =
"partition's boot sector";
185 WhatFailed =
"MBR boot sector";
ULONG MachGetBootSectorLoadAddress(IN UCHAR DriveNumber)
PSTR GetArgumentValue(_In_ ULONG Argc, _In_ PCHAR Argv[], _In_ PCSTR ArgumentName)
BOOLEAN DissectArcPath(IN PCSTR ArcPath, OUT PCSTR *Path OPTIONAL, OUT PUCHAR DriveNumber, OUT PULONG PartitionNumber)
VOID ConstructArcPath(PCHAR ArcPath, PCHAR SystemFolder, UCHAR Disk, ULONG Partition)
#define DriveMapGetBiosDriveNumber(DeviceName)
#define DBG_DEFAULT_CHANNEL(ch)
ARC_STATUS ArcOpen(CHAR *Path, OPENMODE OpenMode, ULONG *FileId)
ARC_STATUS FsOpenFile(IN PCSTR FileName, IN PCSTR DefaultPath OPTIONAL, IN OPENMODE OpenMode, OUT PULONG FileId)
ARC_STATUS ArcClose(_In_ ULONG FileId)
ARC_STATUS ArcRead(ULONG FileId, VOID *Buffer, ULONG N, ULONG *Count)
VOID UiShowMessageBoxesInArgv(IN ULONG Argc, IN PCHAR Argv[])
VOID UiUnInitialize(PCSTR BootText)
VOID UiMessageBox(_In_ PCSTR Format,...)
_ACRTIMP int __cdecl atoi(const char *)
_ACRTIMP char *__cdecl strstr(const char *, const char *)
_ACRTIMP char *__cdecl strrchr(const char *, int)
struct _FileName FileName
ULONG FrldrGetBootPartition(VOID)
UCHAR FrldrGetBootDrive(VOID)
VOID __cdecl ChainLoadBiosBootSectorCode(IN UCHAR BootDrive OPTIONAL, IN ULONG BootPartition OPTIONAL)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
_In_ ULONG _In_ ULONG PartitionNumber