127 {
FreeLdr,
L"freeldr.sys\0",
L"freeldr.ini",
129 {
NtLdr ,
L"ntldr\0" L"osloader.exe\0",
L"boot.ini",
143 {
L"TimeOut",
L"DefaultOS"},
144 {
L"timeout",
L"default" }
168 while (*LoaderExecutable)
170 if (
DoesFileExist(PartitionDirectoryHandle, LoaderExecutable))
173 DPRINT(
"Found loader executable '%S'\n", LoaderExecutable);
178 DPRINT(
"Loader executable '%S' does not exist, continue with another one...\n", LoaderExecutable);
179 LoaderExecutable +=
wcslen(LoaderExecutable) + 1;
181 if (!*LoaderExecutable)
184 DPRINT(
"No loader executable was found\n");
232 if (
IniGetKey(OsIniSection,
L"BootPath", &KeyData) && KeyData && *KeyData)
242 OldKey =
IniGetKey(OsIniSection,
L"BootDrive", &KeyData);
245 PCWSTR OldDrive = KeyData;
246 ULONG DriveNumber = 0;
249 WCHAR BufferBootPath[80];
254 if (
p[0] >=
L'0' &&
p[0] <=
L'9')
257 if (DriveNumber >= 0x80)
273 DriveNumber =
_wtoi(&
p[2]);
277 if (
IniGetKey(OsIniSection,
L"BootPartition", &KeyData))
284 L"multi(0)disk(0)fdisk(%lu)", DriveNumber);
290 L"multi(0)disk(0)rdisk(%lu)partition(%lu)",
297 L"multi(0)disk(0)cdrom(%lu)", DriveNumber);
306 if (KeyData && *KeyData)
328 PCWSTR SectionName, KeyData;
336 OsIniSection =
IniGetSection(BootStore->IniCache, SectionName);
341 if (!
IniGetKey(OsIniSection,
L"BootType", &KeyData) || !KeyData)
344 DPRINT1(
"No BootType value present\n");
347 if ((
_wcsicmp(KeyData,
L"Drive") == 0) ||
348 (
_wcsicmp(KeyData,
L"\"Drive\"") == 0) ||
349 (
_wcsicmp(KeyData,
L"Partition") == 0) ||
350 (
_wcsicmp(KeyData,
L"\"Partition\"") == 0))
353 IniAddKey(OsIniSection,
L"BootType",
L"BootSector");
354 goto migrate_drivepart;
356 if ((
_wcsicmp(KeyData,
L"BootSector") == 0) ||
357 (
_wcsicmp(KeyData,
L"\"BootSector\"") == 0))
360 DPRINT(
"This is a '%S' boot entry\n", KeyData);
384 DPRINT1(
"CreateCommonFreeLdrSections: Failed to create 'FREELOADER' section!\n");
386 BootStore->OptionsIniSection = IniSection;
389 IniAddKey(BootStore->OptionsIniSection,
L"TimeOut",
L"0");
395 IniAddKey(IniSection,
L"TitleText",
L"ReactOS Boot Manager");
403 IniSection =
IniAddSection(BootStore->IniCache,
L"Operating Systems");
405 DPRINT1(
"CreateCommonFreeLdrSections: Failed to create 'Operating Systems' section!\n");
407 BootStore->OsIniSection = IniSection;
431 DPRINT1(
"OpenIniBootLoaderStore() unsupported for NTLDR\n");
460 PartitionDirectoryHandle,
511 DPRINT1(
"Couldn't find Loader configuration file '%S'\n",
573 DPRINT1(
"Couldn't open Loader configuration file '%S' (Status 0x%08lx)\n",
592 DPRINT1(
"IniCacheCreate() failed\n");
617 DPRINT1(
"Failed to map Loader configuration file '%S' (Status 0x%08lx)\n",
638 DPRINT1(
"IniCacheLoadFromMemory() failed (Status 0x%08lx)\n",
Status);
660 DPRINT1(
"OpenIniBootLoaderStore: Failed to retrieve 'FREELOADER' section!\n");
671 DPRINT1(
"OpenIniBootLoaderStore: Failed to retrieve 'Operating Systems' section!\n");
743 DPRINT1(
"OpenIniBootLoaderStore: Failed to retrieve 'boot loader' section!\n");
754 DPRINT1(
"OpenIniBootLoaderStore: Failed to retrieve 'operating systems' section!\n");
804 DPRINT1(
"NtQueryInformationFile() failed (Status 0x%08lx)\n",
Status);
807 OldAttributes =
FileInfo.FileAttributes;
811 FileInfo.FileAttributes = (OldAttributes & ~MaskAttributes) | (*
Attributes & MaskAttributes);
824 DPRINT1(
"NtSetInformationFile() failed (Status 0x%08lx)\n",
Status);
834 static const ULONG ProtectAttribs =
854 DPRINT1(
"Could not unprotect INI boot store (Status 0x%08lx)\n",
Status);
862 FileAttribs = ProtectAttribs;
867 FileAttribs &= ~FILE_ATTRIBUTE_READONLY;
933 PartitionDirectoryHandle,
950 HANDLE PartitionDirectoryHandle;
980 DPRINT1(
"Failed to open SystemPartition '%wZ' (Status 0x%08lx)\n",
981 SystemPartitionPath,
Status);
986 PartitionDirectoryHandle,
992 NtClose(PartitionDirectoryHandle);
1007 &SystemPartitionPath,
1051 IniAddKey(BootStore->OsIniSection, Section, BootEntry->FriendlyName);
1056 if (BootEntry->OsOptionsLength >=
sizeof(
NTOS_OPTIONS) &&
1065 IniAddKey(IniSection,
L"BootType",
L"Windows2003");
1079 IniAddKey(IniSection,
L"BootType",
L"BootSector");
1087 DPRINT1(
"Unsupported BootType %lu\n", BootEntry->OsOptionsLength);
1101 if (!BootStore || !BootEntry)
1120 if (BootEntry->Version !=
FreeLdr)
1124 BootEntryKey, BootEntry);
1132 PCWSTR InstallName, OsOptions;
1136 if (BootEntry->Version !=
NtLdr)
1139 if (BootEntry->OsOptionsLength <
sizeof(
NTOS_OPTIONS) ||
1146 DPRINT1(
"Unsupported BootType %lu\n", BootEntry->OsOptionsLength);
1150 InstallName = BootEntry->FriendlyName;
1151 OsOptions =
Options->OsLoadOptions;
1156 IsNameNotQuoted = (InstallName[0] !=
L'\"' || InstallName[
wcslen(InstallName)-1] !=
L'\"');
1186 DPRINT1(
"Loader type %d is currently unsupported!\n", BootStore->
Type);
1232 if (!BootStore || !BootEntry)
1321 DPRINT1(
"Loader type %d is currently unsupported!\n", BootStore->
Type);
1331 &TimeoutStr) && TimeoutStr)
1390 WCHAR TimeoutStr[15];
1417 PCWSTR SectionName, KeyData;
1429 ULONG InstallNameLength;
1432 if (*KeyData ==
L'"')
1440 InstallName = KeyData + 1;
1441 InstallNameLength = End - InstallName;
1446 InstallName = KeyData;
1447 InstallNameLength =
wcslen(InstallName);
1449 if (InstallNameLength == 0) InstallName =
NULL;
1454 InstallName = KeyData;
1455 InstallNameLength =
wcslen(InstallName);
1456 if (InstallNameLength == 0) InstallName =
NULL;
1461 if (InstallNameLength)
1470 DPRINT(
"Boot entry '%S' in OS section '%S'\n", InstallName, SectionName);
1479 OsIniSection =
IniGetSection(BootStore->IniCache, SectionName);
1484 if (!
IniGetKey(OsIniSection,
L"BootType", &KeyData) || !KeyData)
1487 DPRINT1(
"No BootType value present\n");
1492 if ((
_wcsicmp(KeyData,
L"Windows2003") == 0) ||
1493 (
_wcsicmp(KeyData,
L"\"Windows2003\"") == 0))
1498 DPRINT(
"This is a '%S' boot entry\n", KeyData);
1509 if (
IniGetKey(OsIniSection,
L"SystemPath", &KeyData))
1510 Options->OsLoadPath = KeyData;
1515 if (
IniGetKey(OsIniSection,
L"Options", &KeyData))
1516 Options->OsLoadOptions = KeyData;
1519 if ((
_wcsicmp(KeyData,
L"BootSector") == 0) ||
1520 (
_wcsicmp(KeyData,
L"\"BootSector\"") == 0))
1525 DPRINT(
"This is a '%S' boot entry\n", KeyData);
1536 if (
IniGetKey(OsIniSection,
L"BootPath", &KeyData))
1541 if (
IniGetKey(OsIniSection,
L"BootSectorFile", &KeyData))
1546 DPRINT1(
"Unrecognized BootType value '%S'\n", KeyData);
1577 PCWSTR SectionName, KeyData;
1589 PCWSTR InstallName, OsOptions;
1590 ULONG InstallNameLength, OsOptionsLength;
1593 if (*KeyData ==
L'"')
1596 OsOptions =
wcschr(KeyData + 1,
L'"');
1602 InstallName = KeyData + 1;
1603 InstallNameLength = OsOptions - InstallName;
1604 if (InstallNameLength == 0) InstallName =
NULL;
1610 while (
iswspace(*OsOptions)) ++OsOptions;
1612 OsOptionsLength =
wcslen(OsOptions);
1613 if (OsOptionsLength == 0) OsOptions =
NULL;
1618 InstallName = KeyData;
1619 InstallNameLength =
wcslen(InstallName);
1620 if (InstallNameLength == 0) InstallName =
NULL;
1624 OsOptionsLength = 0;
1632 InstallName = KeyData;
1633 InstallNameLength =
wcslen(InstallName);
1634 if (InstallNameLength == 0) InstallName =
NULL;
1638 OsOptionsLength = 0;
1651 if (InstallName && InstallNameLength)
1660 if (OsOptions && OsOptionsLength)
1669 DPRINT1(
"Boot entry '%S' in OS section (path) '%S'\n", InstallName, SectionName);
1672 BootEntry->Version =
NtLdr;
1673 BootEntry->BootEntryKey = 0;
1674 BootEntry->FriendlyName = InstallName;
1675 BootEntry->BootFilePath =
NULL;
1682 Options->OsLoadPath = SectionName;
1683 Options->OsLoadOptions = OsOptions;
#define FILE_DIRECTORY_FILE
#define FILE_NON_DIRECTORY_FILE
PPARTENTRY SystemPartition
static NTSTATUS NtLdrEnumerateBootEntries(IN PBOOT_STORE_INI_CONTEXT BootStore, IN PENUM_BOOT_ENTRIES_ROUTINE EnumBootEntriesRoutine, IN PVOID Parameter OPTIONAL)
struct _BOOT_STORE_BCDREG_CONTEXT * PBOOT_STORE_BCDREG_CONTEXT
static VOID CreateCommonFreeLdrSections(IN OUT PBOOT_STORE_INI_CONTEXT BootStore)
static VOID FreeLdrMigrateBootDrivePartWorker(_In_ PINI_SECTION OsIniSection)
NTSTATUS DeleteBootStoreEntry(IN PVOID Handle, IN ULONG_PTR BootEntryKey)
static NTSTATUS CloseIniBootLoaderStore(_In_ PVOID Handle)
struct _BOOT_STORE_INI_CONTEXT BOOT_STORE_INI_CONTEXT
static NTSTATUS FreeLdrEnumerateBootEntries(IN PBOOT_STORE_INI_CONTEXT BootStore, IN PENUM_BOOT_ENTRIES_ROUTINE EnumBootEntriesRoutine, IN PVOID Parameter OPTIONAL)
NTSTATUS OpenBootStoreByHandle(_Out_ PVOID *Handle, _In_ HANDLE PartitionDirectoryHandle, _In_ BOOT_STORE_TYPE Type, _In_ BOOT_STORE_OPENMODE OpenMode, _In_ BOOT_STORE_ACCESS Access)
NTSTATUS QueryBootStoreEntry(IN PVOID Handle, IN ULONG_PTR BootEntryKey, OUT PBOOT_STORE_ENTRY BootEntry)
NTSTATUS(* PCLOSE_BOOT_STORE)(_In_ PVOID Handle)
NTSTATUS OpenBootStore(_Out_ PVOID *Handle, _In_ PCWSTR SystemPartition, _In_ BOOT_STORE_TYPE Type, _In_ BOOT_STORE_OPENMODE OpenMode, _In_ BOOT_STORE_ACCESS Access)
NTSTATUS OpenBootStore_UStr(_Out_ PVOID *Handle, _In_ PUNICODE_STRING SystemPartitionPath, _In_ BOOT_STORE_TYPE Type, _In_ BOOT_STORE_OPENMODE OpenMode, _In_ BOOT_STORE_ACCESS Access)
static NTSTATUS CreateNTOSEntry(IN PBOOT_STORE_INI_CONTEXT BootStore, IN ULONG_PTR BootEntryKey, IN PBOOT_STORE_ENTRY BootEntry)
NTSTATUS SetBootStoreOptions(IN PVOID Handle, IN PBOOT_STORE_OPTIONS BootOptions, IN ULONG FieldsToChange)
static NTSTATUS ProtectFile(_In_ HANDLE FileHandle, _In_ ULONG MaskAttributes, _Inout_ PULONG Attributes)
Selectively changes the attributes of a file.
struct _BOOT_STORE_INI_CONTEXT * PBOOT_STORE_INI_CONTEXT
struct _BOOT_STORE_BCDREG_CONTEXT BOOT_STORE_BCDREG_CONTEXT
NTSTATUS AddBootStoreEntry(IN PVOID Handle, IN PBOOT_STORE_ENTRY BootEntry, IN ULONG_PTR BootEntryKey)
NTSTATUS CloseBootStore(_In_ PVOID Handle)
struct _NTOS_BOOT_LOADER_FILES * PNTOS_BOOT_LOADER_FILES
NTSTATUS ModifyBootStoreEntry(IN PVOID Handle, IN PBOOT_STORE_ENTRY BootEntry)
static VOID FreeLdrMigrateBootDrivePart(_In_ PBOOT_STORE_INI_CONTEXT BootStore)
static NTSTATUS OpenIniBootLoaderStore(_Out_ PVOID *Handle, _In_ HANDLE PartitionDirectoryHandle, _In_ BOOT_STORE_TYPE Type, _In_ BOOT_STORE_OPENMODE OpenMode, _In_ BOOT_STORE_ACCESS Access)
struct _BOOT_STORE_CONTEXT * PBOOT_STORE_CONTEXT
NTSTATUS EnumerateBootStoreEntries(IN PVOID Handle, IN PENUM_BOOT_ENTRIES_ROUTINE EnumBootEntriesRoutine, IN PVOID Parameter OPTIONAL)
struct _BOOT_STORE_CONTEXT BOOT_STORE_CONTEXT
NTSTATUS(* POPEN_BOOT_STORE)(_Out_ PVOID *Handle, _In_ HANDLE PartitionDirectoryHandle, _In_ BOOT_STORE_TYPE Type, _In_ BOOT_STORE_OPENMODE OpenMode, _In_ BOOT_STORE_ACCESS Access)
NTSTATUS QueryBootStoreOptions(IN PVOID Handle, IN OUT PBOOT_STORE_OPTIONS BootOptions)
NTOS_BOOT_LOADER_FILES NtosBootLoaders[]
NTSTATUS FindBootStore(IN HANDLE PartitionDirectoryHandle, IN BOOT_STORE_TYPE Type, OUT PULONG VersionNumber OPTIONAL)
static const PCWSTR BootOptionNames[][2]
struct _NTOS_BOOT_LOADER_FILES NTOS_BOOT_LOADER_FILES
NTSTATUS(* PENUM_BOOT_STORE_ENTRIES)(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
enum _BOOT_STORE_ACCESS BOOT_STORE_ACCESS
#define BOOT_OPTIONS_NEXT_BOOTENTRY_KEY
#define BOOT_OPTIONS_TIMEOUT
struct _NTOS_OPTIONS * PNTOS_OPTIONS
struct _BOOT_STORE_ENTRY * PBOOT_STORE_ENTRY
NTSTATUS(NTAPI * PENUM_BOOT_ENTRIES_ROUTINE)(IN BOOT_STORE_TYPE Type, IN PBOOT_STORE_ENTRY BootEntry, IN PVOID Parameter OPTIONAL)
#define NTOS_OPTIONS_SIGNATURE
enum _BOOT_STORE_OPENMODE BOOT_STORE_OPENMODE
struct _BOOTSECTOR_OPTIONS * PBOOTSECTOR_OPTIONS
enum _BOOT_STORE_TYPE BOOT_STORE_TYPE
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
#define FILE_ATTRIBUTE_NORMAL
static const WCHAR Signature[]
#define RtlCompareMemory(s1, s2, l)
NTSTATUS MapFile(_In_ HANDLE FileHandle, _Out_ PHANDLE SectionHandle, _Out_ PVOID *BaseAddress, _In_ BOOLEAN ReadWriteAccess)
Maps an opened file in memory.
NTSTATUS OpenAndMapFile(_In_opt_ HANDLE RootDirectory, _In_ PCWSTR PathNameToFile, _Out_opt_ PHANDLE FileHandle, _Out_opt_ PULONG FileSize, _Out_ PHANDLE SectionHandle, _Out_ PVOID *BaseAddress, _In_ BOOLEAN ReadWriteAccess)
Opens and maps a file in memory.
#define UnMapAndCloseFile(FileHandle, SectionHandle, BaseAddress)
#define DoesFileExist(RootDirectory, FileName)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define FILE_OVERWRITE_IF
#define FILE_SYNCHRONOUS_IO_NONALERT
#define FILE_NO_INTERMEDIATE_BUFFERING
#define FILE_SEQUENTIAL_ONLY
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Check_return_ _CRTIMP int __cdecl _wtoi(_In_z_ const wchar_t *_Str)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
VOID IniCacheDestroy(_In_ PINICACHE Cache)
NTSTATUS IniCacheLoadFromMemory(PINICACHE *Cache, PCHAR FileBuffer, ULONG FileLength, BOOLEAN String)
VOID IniRemoveKeyByName(_In_ PINI_SECTION Section, _In_ PCWSTR KeyName)
PINI_SECTION IniAddSection(_In_ PINICACHE Cache, _In_ PCWSTR Name)
NTSTATUS IniCacheSaveByHandle(PINICACHE Cache, HANDLE FileHandle)
PINICACHEITERATOR IniFindFirstValue(_In_ PINI_SECTION Section, _Out_ PCWSTR *KeyName, _Out_ PCWSTR *KeyData)
PINI_SECTION IniGetSection(_In_ PINICACHE Cache, _In_ PCWSTR Name)
PINI_KEYWORD IniGetKey(_In_ PINI_SECTION Section, _In_ PCWSTR KeyName, _Out_ PCWSTR *KeyData)
PINICACHE IniCacheCreate(VOID)
VOID IniFindClose(_In_ PINICACHEITERATOR Iterator)
NTSTATUS IniCacheLoadByHandle(PINICACHE *Cache, HANDLE FileHandle, BOOLEAN String)
BOOLEAN IniFindNextValue(_In_ PINICACHEITERATOR Iterator, _Out_ PCWSTR *KeyName, _Out_ PCWSTR *KeyData)
PINI_KEYWORD IniAddKey(_In_ PINI_SECTION Section, _In_ PCWSTR Name, _In_ PCWSTR Data)
PINI_KEYWORD IniInsertKey(_In_ PINI_SECTION Section, _In_ PINI_KEYWORD AnchorKey, _In_ INSERTION_TYPE InsertionType, _In_ PCWSTR Name, _In_ PCWSTR Data)
#define RTL_FIELD_SIZE(type, field)
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
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 FILE_LIST_DIRECTORY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
#define FILE_WRITE_ATTRIBUTES
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
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)
#define FILE_GENERIC_READ
#define FILE_GENERIC_WRITE
_NullNull_terminated_ CONST WCHAR * PCZZWSTR
#define STATUS_NOT_SUPPORTED
#define STATUS_NOT_IMPLEMENTED
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,...)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
PULONG MinorVersion OPTIONAL
BOOT_STORE_CONTEXT Header
UCHAR OsOptions[ANYSIZE_ARRAY]
BOOT_STORE_CONTEXT Header
PINI_SECTION OsIniSection
PINI_SECTION OptionsIniSection
PCLOSE_BOOT_STORE CloseBootStore
POPEN_BOOT_STORE OpenBootStore
PENUM_BOOT_STORE_ENTRIES EnumBootStoreEntries
PCZZWSTR LoaderExecutables
PCWSTR LoaderConfigurationFile
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR Iterator
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG _Out_opt_ PULONG CreateDisposition
_In_ ULONG _In_ ULONG PartitionNumber
_Inout_opt_ PVOID Parameter