67 BootEntry->BootFilePath =
NULL;
78 BootEntry->FriendlyName =
L"\"ReactOS\"";
79 Options->OsLoadOptions =
L"/FASTDETECT";
84 BootEntry->FriendlyName =
L"\"ReactOS (Debug)\"";
85 Options->OsLoadOptions =
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS";
91 BootEntry->FriendlyName =
L"\"ReactOS (VBox Debug)\"";
92 Options->OsLoadOptions =
L"/DEBUG /DEBUGPORT=VBOX /SOS";
99 BootEntry->FriendlyName =
L"\"ReactOS (RosDbg)\"";
100 Options->OsLoadOptions =
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /KDSERIAL";
106 BootEntry->FriendlyName =
L"\"ReactOS (Screen)\"";
107 Options->OsLoadOptions =
L"/DEBUG /DEBUGPORT=SCREEN /SOS";
112 BootEntry->FriendlyName =
L"\"ReactOS (Log file)\"";
113 Options->OsLoadOptions =
L"/DEBUG /DEBUGPORT=FILE /SOS";
118 BootEntry->FriendlyName =
L"\"ReactOS (RAM Disk)\"";
119 Options->OsLoadPath =
L"ramdisk(0)\\ReactOS";
120 Options->OsLoadOptions =
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /RDPATH=reactos.img /RDIMAGEOFFSET=32256";
125 BootEntry->FriendlyName =
L"\"ReactOS (Emergency Management Services)\"";
127 Options->OsLoadOptions =
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /redirect=com2 /redirectbaudrate=115200";
133#if DBG && !defined(_WINKD_)
136 BootOptions.NextBootEntryKey =
MAKESTRKEY(
L"ReactOS_KdSerial");
142 BootOptions.NextBootEntryKey =
MAKESTRKEY(
L"ReactOS_Debug");
144 BootOptions.NextBootEntryKey =
MAKESTRKEY(
L"ReactOS");
153 BootOptions.Timeout = 0;
159 BootOptions.Timeout = 10;
173 PVOID BootStoreHandle;
199 PVOID BootStoreHandle;
214 DPRINT1(
"BootPath = '%S' points to disk #%d, partition #%d, path '%S'\n",
220 L"multi(0)disk(0)rdisk(%lu)partition(%lu)",
243 L"multi(0)disk(0)fdisk(%lu)", DiskNumber);
266 DPRINT1(
"Unhandled NT path '%S'\n", BootPath);
280 BootEntry->BootFilePath =
NULL;
287 Options->BootPath = BootPathBuffer;
339 DPRINT(
" An installation '%S' of unsupported type %lu\n",
340 BootEntry->FriendlyName, BootEntry->OsOptionsLength);
349 DPRINT1(
" A Win2k3 install '%S' without an ARC path?!\n", BootEntry->FriendlyName);
369 DPRINT(
" Found a candidate Win2k3 install '%S' with ARC path '%S'\n",
370 BootEntry->FriendlyName,
Options->OsLoadPath);
374 DPRINT(
"EnumerateReactOSEntries: OsLoadPath: '%S'\n",
Options->OsLoadPath);
387 L"ReactOS_%lu",
Data->i);
389 L"\"ReactOS %lu\"",
Data->i);
402 PVOID BootStoreHandle;
417 Data.ArcPath = ArcPath;
428 if (!
Data.UseExistingEntry)
434 BootEntry->BootFilePath =
NULL;
444 BootEntry->FriendlyName =
Data.OsName;
462 PVOID BootStoreHandle;
479 Data.ArcPath = EntryName;
490 if (!
Data.UseExistingEntry
493 BootEntry->Version =
NtLdr;
494 BootEntry->BootFilePath =
NULL;
501 Options->OsLoadPath = EntryName;
505 BootEntry->FriendlyName = EntryValue;
626 IN PFS_INSTALL_BOOTCODE InstallBootCode)
661 DPRINT1(
"Unable to lock the volume before installing boot code. Status 0x%08x. Expect problems.\n", LockStatus);
665 Status = InstallBootCode(SrcPath, PartitionHandle, PartitionHandle);
673 DPRINT1(
"Unable to dismount the volume after installing boot code. Status 0x%08x. Expect problems.\n", LockStatus);
679 DPRINT1(
"Unable to unlock the volume after installing boot code. Status 0x%08x. Expect problems.\n", LockStatus);
695 IN PFS_INSTALL_BOOTCODE InstallBootCode)
853 L"\\Device\\Harddisk%d\\Partition0",
858 SourceRootPath->Buffer,
L"\\loader\\dosmbr.bin");
864 SystemRootPath->Buffer,
L"mbr.old");
866 DPRINT1(
"Save MBR: %S ==> %S\n", DestinationDevicePathBuffer,
DstPath);
875 DPRINT1(
"Install MBR bootcode: %S ==> %S\n",
876 SourceMbrPathBuffer, DestinationDevicePathBuffer);
880 DestinationDevicePathBuffer,
891 static const ULONG ProtectAttribs =
906 DPRINT1(
"SetupCopyFile() failed (Status 0x%08lx)\n",
Status);
921 DPRINT1(
"SetupCopyFile() failed (Status 0x%08lx)\n",
Status);
945 DPRINT(
"System path: '%wZ'\n", SystemRootPath);
951 DPRINT1(
"InstallBootloaderFiles() failed (Status %lx)\n",
Status);
957 if (DoesFreeLdrExist)
960 DPRINT1(
"Update existing 'freeldr.ini'\n");
964 DPRINT1(
"UpdateFreeLoaderIni() failed (Status %lx)\n",
Status);
978 DPRINT1(
"Found Microsoft Windows NT/2000/XP boot loader\n");
981 if (DoesFreeLdrExist ==
FALSE)
984 DPRINT1(
"Create new 'freeldr.ini'\n");
988 DPRINT1(
"CreateFreeLoaderIniForReactOS() failed (Status %lx)\n",
Status);
995 if (
_wcsicmp(FileSystemName,
L"FAT32") == 0)
1000 DPRINT1(
"Install FAT32 bootcode: %S ==> %S\n", SrcPath,
DstPath);
1002 SystemRootPath->Buffer,
1006 DPRINT1(
"InstallBootCodeToFile(FAT32) failed (Status %lx)\n",
Status);
1015 DPRINT1(
"Install FAT16 bootcode: %S ==> %S\n", SrcPath,
DstPath);
1017 SystemRootPath->Buffer,
1021 DPRINT1(
"InstallBootCodeToFile(FAT16) failed (Status %lx)\n",
Status);
1030 DPRINT1(
"Update 'boot.ini'\n");
1032 L"C:\\bootsect.ros",
1052 DPRINT1(
"Found COMPAQ MS-DOS 1.x (1.11, 1.12) / MS-DOS 1.25 boot loader\n");
1054 Section =
L"CPQDOS";
1064 DPRINT1(
"Found Microsoft DOS or Windows 9x boot loader\n");
1076 DPRINT1(
"Found IBM PC-DOS or DR-DOS 5.x or IBM OS/2 1.0\n");
1078 Section =
L"IBMDOS";
1079 Description =
L"\"IBM PC-DOS or DR-DOS 5.x or IBM OS/2 1.0\"";
1087 DPRINT1(
"Found DR-DOS 3.x\n");
1098 DPRINT1(
"Found Dell Real-Mode Kernel OS\n");
1110 DPRINT1(
"Found MS OS/2 1.x\n");
1122 DPRINT1(
"Found MS/IBM OS/2\n");
1124 Section =
L"IBMOS2";
1132 DPRINT1(
"Found FreeDOS boot loader\n");
1141 DPRINT1(
"No or unknown boot loader found\n");
1143 Section =
L"Unknown";
1149 if (DoesFreeLdrExist ==
FALSE)
1152 DPRINT1(
"Create new 'freeldr.ini'\n");
1157 SystemRootPath->Buffer, DestinationArcPath->Buffer,
1162 DPRINT1(
"CreateFreeLoaderIniForReactOSAndBootSector() failed (Status %lx)\n",
Status);
1169 DPRINT1(
"Save bootsector: %S ==> %S\n", SystemRootPath->Buffer,
DstPath);
1182 DPRINT1(
"CreateFreeLoaderIniForReactOS() failed (Status %lx)\n",
Status);
1188 if (
_wcsicmp(FileSystemName,
L"FAT32") == 0)
1193 DPRINT1(
"Install FAT32 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer);
1198 DPRINT1(
"InstallBootCodeToDisk(FAT32) failed (Status %lx)\n",
Status);
1207 DPRINT1(
"Install FAT16 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer);
1211 DPRINT1(
"InstallBootCodeToDisk(FAT16) failed (Status %lx)\n",
Status);
1234 DPRINT(
"System path: '%wZ'\n", SystemRootPath);
1240 DPRINT1(
"InstallBootloaderFiles() failed (Status %lx)\n",
Status);
1245 DoesFreeLdrExist =
DoesFileExist_2(SystemRootPath->Buffer,
L"freeldr.ini");
1246 if (DoesFreeLdrExist)
1249 DPRINT1(
"Update existing 'freeldr.ini'\n");
1253 DPRINT1(
"UpdateFreeLoaderIni() failed (Status %lx)\n",
Status);
1261 if (DoesFreeLdrExist ==
FALSE)
1264 DPRINT1(
"Create new 'freeldr.ini'\n");
1267 DPRINT1(
"*nix or unknown boot loader found\n");
1274 SystemRootPath->Buffer, DestinationArcPath->Buffer,
1275 L"Linux",
L"\"Linux\"",
1279 DPRINT1(
"CreateFreeLoaderIniForReactOSAndBootSector() failed (Status %lx)\n",
Status);
1286 DPRINT1(
"Save bootsector: %S ==> %S\n", SystemRootPath->Buffer,
DstPath);
1299 DPRINT1(
"CreateFreeLoaderIniForReactOS() failed (Status %lx)\n",
Status);
1308 DPRINT1(
"Install BTRFS bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer);
1312 DPRINT1(
"InstallBootCodeToDisk(BTRFS) failed (Status %lx)\n",
Status);
1333 DPRINT(
"System path: '%wZ'\n", SystemRootPath);
1339 DPRINT1(
"InstallBootloaderFiles() failed (Status %lx)\n",
Status);
1344 DoesFreeLdrExist =
DoesFileExist_2(SystemRootPath->Buffer,
L"freeldr.ini");
1345 if (DoesFreeLdrExist)
1348 DPRINT1(
"Update existing 'freeldr.ini'\n");
1352 DPRINT1(
"UpdateFreeLoaderIni() failed (Status %lx)\n",
Status);
1361 DPRINT1(
"Create new 'freeldr.ini'\n");
1364 DPRINT1(
"*nix or unknown boot loader found\n");
1371 SystemRootPath->Buffer, DestinationArcPath->Buffer,
1372 L"Linux",
L"\"Linux\"",
1376 DPRINT1(
"CreateFreeLoaderIniForReactOSAndBootSector() failed (Status %lx)\n",
Status);
1383 DPRINT1(
"Save bootsector: %S ==> %S\n", SystemRootPath->Buffer,
DstPath);
1396 DPRINT1(
"CreateFreeLoaderIniForReactOS() failed (Status %lx)\n",
Status);
1406 DPRINT1(
"Install NTFS bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer);
1410 DPRINT1(
"InstallBootCodeToDisk(NTFS) failed (Status %lx)\n",
Status);
1425 if (
_wcsicmp(FileSystemName,
L"FAT") == 0 ||
1426 _wcsicmp(FileSystemName,
L"FAT32") == 0)
1433 else if (
_wcsicmp(FileSystemName,
L"NTFS") == 0)
1437 DestinationArcPath);
1439 else if (
_wcsicmp(FileSystemName,
L"BTRFS") == 0)
1443 DestinationArcPath);
1456 DPRINT1(
"Unknown file system '%S'\n", FileSystemName);
1514 if (InstallType <= 1)
1523 DPRINT1(
"InstallVBRToPartition() failed (Status 0x%08lx)\n",
Status);
1533 L"\\Device\\Harddisk%d\\Partition0",
1540 DPRINT1(
"InstallMbrBootCodeToDisk() failed (Status 0x%08lx)\n",
Status);
1545 else if (InstallType == 2)
1560 DPRINT1(
"InstallBootloaderFiles() failed (Status 0x%08lx)\n",
Status);
1565 DPRINT(
"Create new 'freeldr.ini'\n");
1569 DPRINT1(
"CreateFreeLoaderIniForReactOS() failed (Status 0x%08lx)\n",
Status);
1576 DPRINT1(
"Install FAT12 bootcode: %S ==> %S\n", SrcPath, SystemRootPath->Buffer);
1580 DPRINT1(
"InstallBootCodeToDisk(FAT12) failed (Status 0x%08lx)\n",
Status);
1610 DPRINT1(
"Cannot open device '%wZ' (Status 0x%08lx)\n",
1623 DPRINT1(
"FileFsDeviceInformation failed (Status 0x%08lx)\n",
Status);
1709 DPRINT1(
"Cannot open %wZ for bootloader installation (Status 0x%08lx)\n",
1719 DPRINT1(
"GetFileSystemName() failed (Status 0x%08lx)\n",
Status);
1727 DPRINT1(
"FileFsDeviceInformation failed (Status 0x%08lx)\n",
Status);
1779 DPRINT1(
"Invalid disk number reported, bail out\n");
1795 DPRINT1(
"IOCTL_DISK_GET_DRIVE_GEOMETRY_EX failed (Status 0x%08lx)\n",
Status);
1817 DPRINT1(
"IOCTL_DISK_GET_PARTITION_INFO failed (Status 0x%08lx)\n",
Status);
1822 PartitionStyle = DiskGeoEx.
Partition.PartitionStyle;
1829 ArchType, SystemRootPath,
1831 SourceRootPath, DestinationArcPath,
Options);
1865 DPRINT1(
"FileFsDeviceInformation failed (Status 0x%08lx)\n",
Status);
1887 DPRINT1(
"Device is NOT removable!\n");
1895 FileSystemName = (
IsFloppy ?
L"FAT" :
L"FAT32");
1908 DPRINT1(
"%s FS non-existent on this system!\n", FileSystemName);
1910 DPRINT1(
"FormatFileSystem(%s) failed (Status 0x%08lx)\n", FileSystemName,
Status);
1921 DPRINT1(
"InstallBootManagerAndBootEntries() failed (Status 0x%08lx)\n",
Status);
PRTL_UNICODE_STRING_BUFFER Path
#define OBJ_NAME_PATH_SEPARATOR
NTSTATUS OpenBootStore(_Out_ PVOID *Handle, _In_ PCWSTR SystemPartition, _In_ BOOT_STORE_TYPE Type, _In_ BOOT_STORE_OPENMODE OpenMode, _In_ BOOT_STORE_ACCESS Access)
NTSTATUS SetBootStoreOptions(IN PVOID Handle, IN PBOOT_STORE_OPTIONS BootOptions, IN ULONG FieldsToChange)
NTSTATUS AddBootStoreEntry(IN PVOID Handle, IN PBOOT_STORE_ENTRY BootEntry, IN ULONG_PTR BootEntryKey)
NTSTATUS CloseBootStore(_In_ PVOID Handle)
NTSTATUS EnumerateBootStoreEntries(IN PVOID Handle, IN PENUM_BOOT_ENTRIES_ROUTINE EnumBootEntriesRoutine, IN PVOID Parameter OPTIONAL)
struct _BOOTSECTOR_OPTIONS BOOTSECTOR_OPTIONS
#define BOOTSECTOR_OPTIONS_SIGNATURE
struct _NTOS_OPTIONS NTOS_OPTIONS
#define BOOT_OPTIONS_NEXT_BOOTENTRY_KEY
#define BOOT_OPTIONS_TIMEOUT
struct _NTOS_OPTIONS * PNTOS_OPTIONS
struct _BOOT_STORE_ENTRY * PBOOT_STORE_ENTRY
#define NTOS_OPTIONS_SIGNATURE
struct _BOOTSECTOR_OPTIONS * PBOOTSECTOR_OPTIONS
enum _BOOT_STORE_TYPE BOOT_STORE_TYPE
VOID FreeBootCode(IN OUT PBOOTCODE BootCodeInfo)
NTSTATUS ReadBootCodeByHandle(IN OUT PBOOTCODE BootCodeInfo, IN HANDLE FileHandle, IN ULONG Length OPTIONAL)
NTSTATUS ReadBootCodeFromFile(IN OUT PBOOTCODE BootCodeInfo, IN PUNICODE_STRING FilePath, IN ULONG Length OPTIONAL)
static NTSTATUS InstallBootloaderFiles(_In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath)
static NTSTATUS InstallMbrBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE DiskHandle)
static NTSTATUS SaveBootSector(IN PCWSTR RootPath, IN PCWSTR DstPath, IN ULONG Length)
static NTSTATUS InstallFatBootcodeToPartition(_In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath, _In_ PCWSTR FileSystemName)
static NTSTATUS UpdateBootIni(IN PCWSTR IniPath, IN PCWSTR EntryName, IN PCWSTR EntryValue)
static NTSTATUS NTAPI EnumerateReactOSEntries(IN BOOT_STORE_TYPE Type, IN PBOOT_STORE_ENTRY BootEntry, IN PVOID Parameter OPTIONAL)
static NTSTATUS InstallBtrfsBootcodeToPartition(_In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath)
static NTSTATUS InstallMbrBootCodeToDisk(_In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCWSTR DestinationDevicePathBuffer)
NTSTATUS NTAPI InstallBootcodeToRemovable(_In_ ARCHITECTURE_TYPE ArchType, _In_ PCUNICODE_STRING RemovableRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath)
static NTSTATUS CreateFreeLoaderIniForReactOS(IN PCWSTR IniPath, IN PCWSTR ArcPath)
static NTSTATUS InstallBootCodeToFile(IN PCWSTR SrcPath, IN PCWSTR DstPath, IN PCWSTR RootPath, IN PFS_INSTALL_BOOTCODE InstallBootCode)
static NTSTATUS CreateFreeLoaderIniForReactOSAndBootSector(IN PCWSTR IniPath, IN PCWSTR ArcPath, IN PCWSTR Section, IN PCWSTR Description, IN PCWSTR BootPath, IN PCWSTR BootSector)
static NTSTATUS InstallNtfsBootcodeToPartition(_In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath)
static BOOLEAN IsThereAValidBootSector(IN PCWSTR RootPath)
static NTSTATUS InstallBootManagerAndBootEntriesWorker(_In_ ARCHITECTURE_TYPE ArchType, _In_ PCUNICODE_STRING SystemRootPath, _In_ ULONG DiskNumber, _In_ PARTITION_STYLE DiskStyle, _In_ BOOLEAN IsSuperFloppy, _In_ PCWSTR FileSystem, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath, _In_ ULONG_PTR Options)
Helper for InstallBootManagerAndBootEntries().
NTSTATUS GetDeviceInfo(_In_opt_ PCWSTR DeviceName, _In_opt_ HANDLE DeviceHandle, _Out_ PFILE_FS_DEVICE_INFORMATION DeviceInfo)
NTSTATUS NTAPI InstallBootManagerAndBootEntries(_In_ ARCHITECTURE_TYPE ArchType, _In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath, _In_ ULONG_PTR Options)
Installs FreeLoader on the system and configure the boot entries.
struct _ENUM_REACTOS_ENTRIES_DATA * PENUM_REACTOS_ENTRIES_DATA
static NTSTATUS InstallVBRToPartition(_In_ PCUNICODE_STRING SystemRootPath, _In_ PCUNICODE_STRING SourceRootPath, _In_ PCUNICODE_STRING DestinationArcPath, _In_ PCWSTR FileSystemName)
static VOID TrimTrailingPathSeparators_UStr(IN OUT PUNICODE_STRING UnicodeString)
struct _ENUM_REACTOS_ENTRIES_DATA ENUM_REACTOS_ENTRIES_DATA
BOOLEAN IsUnattendedSetup
static NTSTATUS InstallBootCodeToDisk(IN PCWSTR SrcPath, IN PCWSTR RootPath, IN PFS_INSTALL_BOOTCODE InstallBootCode)
NTSTATUS GetDeviceInfo_UStr(_In_opt_ PCUNICODE_STRING DeviceName, _In_opt_ HANDLE DeviceHandle, _Out_ PFILE_FS_DEVICE_INFORMATION DeviceInfo)
static NTSTATUS UpdateFreeLoaderIni(IN PCWSTR IniPath, IN PCWSTR ArcPath)
static VOID CreateFreeLoaderReactOSEntries(IN PVOID BootStoreHandle, IN PCWSTR ArcPath)
_In_ PFCB _In_ LONGLONG FileOffset
_In_ PCHAR _In_ ULONG DeviceNumber
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define STATUS_NOT_SUPPORTED
NTSTATUS pOpenDeviceEx_UStr(_In_ PCUNICODE_STRING DevicePath, _Out_ PHANDLE DeviceHandle, _In_ ACCESS_MASK DesiredAccess, _In_ ULONG ShareAccess)
Open an existing device given by its NT-style path, which is assumed to be for a disk device or a par...
_In_ PIO_STATUS_BLOCK IoStatusBlock
#define NT_SUCCESS(StatCode)
#define RTL_CONSTANT_STRING(s)
#define FILE_ATTRIBUTE_NORMAL
_ACRTIMP __msvcrt_ulong __cdecl wcstoul(const wchar_t *, wchar_t **, int)
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
static const WCHAR Signature[]
static BOOL IsFloppy(PCWSTR pszDrive)
struct _DISK_GEOMETRY_EX_INTERNAL * PDISK_GEOMETRY_EX_INTERNAL
struct _DISK_GEOMETRY_EX_INTERNAL DISK_GEOMETRY_EX_INTERNAL
#define RtlCompareMemory(s1, s2, l)
NTSTATUS CombinePaths(OUT PWSTR PathBuffer, IN SIZE_T cchPathSize, IN ULONG NumberOfPathComponents, IN ...)
BOOLEAN DoesFileExist_2(IN PCWSTR PathName OPTIONAL, IN PCWSTR FileName)
BOOLEAN NtPathToDiskPartComponents(IN PCWSTR NtPath, OUT PULONG pDiskNumber, OUT PULONG pPartNumber, OUT PCWSTR *PathComponent OPTIONAL)
NTSTATUS SetupSetFileAttributes(_In_ PCWSTR Path, _In_ ULONG FileAttributes)
NTSTATUS SetupCopyFile(IN PCWSTR SourceFileName, IN PCWSTR DestinationFileName, IN BOOLEAN FailIfExists)
#define DoesDirExist(RootDirectory, DirName)
#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define FILE_SYNCHRONOUS_IO_NONALERT
@ FileFsDeviceInformation
#define FILE_SEQUENTIAL_ONLY
NTSTATUS GetFileSystemName_UStr(IN PUNICODE_STRING PartitionPath OPTIONAL, IN HANDLE PartitionHandle OPTIONAL, IN OUT PWSTR FileSystemName, IN SIZE_T FileSystemNameSize)
#define RTL_FIELD_SIZE(type, field)
UNICODE_STRING DeviceFloppy
enum _PARTITION_STYLE PARTITION_STYLE
#define InitializeObjectAttributes(p, n, a, r, s)
_In_ PIOMMU_DEVICE_PATH _In_ PIOMMU_SVM_CAPABILITIES _Out_ PVOID * DeviceHandle
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
#define FILE_ATTRIBUTE_READONLY
#define FSCTL_LOCK_VOLUME
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
#define FILE_READ_ATTRIBUTES
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define FSCTL_UNLOCK_VOLUME
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define FILE_FLOPPY_DISKETTE
NTSYSAPI BOOLEAN NTAPI RtlPrefixUnicodeString(IN PUNICODE_STRING String1, IN PUNICODE_STRING String2, IN BOOLEAN CaseInSensitive)
#define FSCTL_DISMOUNT_VOLUME
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
NTSYSAPI NTSTATUS NTAPI NtFsControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define FILE_REMOVABLE_MEDIA
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
#define IOCTL_DISK_GET_PARTITION_INFO
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_INVALID_PARAMETER_MIX
#define STATUS_NO_MORE_ENTRIES
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
NTSTRSAFEAPI RtlStringCchCatW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
_Must_inspect_result_ _In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ LPGUID _In_opt_ HANDLE _In_opt_ ULONG _In_opt_ ULONG _In_opt_ ULONG _In_opt_ PLARGE_INTEGER _In_opt_ PUNICODE_STRING Description
#define IOCTL_STORAGE_GET_DEVICE_NUMBER
#define OBJ_CASE_INSENSITIVE
NTSTATUS InstallFat32BootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
NTSTATUS NTAPI FormatFileSystem_UStr(_In_ PUNICODE_STRING DriveRoot, _In_ PCWSTR FileSystemName, _In_ FMIFS_MEDIA_FLAG MediaFlag, _In_opt_ PUNICODE_STRING Label, _In_ BOOLEAN QuickFormat, _In_ ULONG ClusterSize, _In_opt_ PFMIFSCALLBACK Callback)
NTSTATUS InstallBtrfsBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
NTSTATUS InstallNtfsBootCode(IN PCWSTR SrcPath, IN HANDLE DstPath, IN HANDLE RootPartition)
IN HANDLE IN HANDLE RootPartition
#define NTFS_BOOTSECTOR_SIZE
#define InstallFat16BootCode
#define InstallFat12BootCode
#define BTRFS_BOOTSECTOR_SIZE
BOOLEAN IsDiskSuperFloppy2(_In_ const DISK_PARTITION_INFO *DiskInfo, _In_opt_ const ULONGLONG *DiskSize, _In_ const PARTITION_INFORMATION *PartitionInfo)
BOOLEAN IsSuperFloppy(_In_ PDISKENTRY DiskEntry)
enum _ARCHITECTURE_TYPE ARCHITECTURE_TYPE
#define STATUS_DEVICE_NOT_READY
NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, ULONG Length, FS_INFORMATION_CLASS FsInformationClass)
PULONG MinorVersion OPTIONAL
DISK_PARTITION_INFO Partition
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_DEVICE_REQUEST
struct _BootSector BootSector
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_opt_ PCUNICODE_STRING UnicodeString
_In_ ULONG _In_ struct _SET_PARTITION_INFORMATION_EX * PartitionInfo
_In_ ULONG _In_ ULONG PartitionNumber
_Inout_opt_ PVOID Parameter