d41e706f9fa0fd10bc4fdf3ac01927878264b182
[reactos.git] / boot / environ / include / bl.h
1 /*
2 * COPYRIGHT: See COPYING.ARM in the top level directory
3 * PROJECT: ReactOS UEFI Boot Library
4 * FILE: boot/environ/include/bl.h
5 * PURPOSE: Main Boot Library Header
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 #ifndef _BL_H
10 #define _BL_H
11
12 /* INCLUDES ******************************************************************/
13
14 /* C Headers */
15 #include <stdlib.h>
16 #include <stdio.h>
17 #include <wchar.h>
18
19 /* NT Base Headers */
20 #include <ntifs.h>
21
22 /* NDK Headers */
23 #include <ntndk.h>
24
25 /* NT SafeInt Header */
26 #include <ntintsafe.h>
27
28 /* PE Headers */
29 #include <ntimage.h>
30
31 /* ACPI Headers */
32 #include <drivers/acpi/acpi.h>
33
34 /* UEFI Headers */
35 #include <Uefi.h>
36 #include <DevicePath.h>
37 #include <LoadedImage.h>
38 #include <GraphicsOutput.h>
39 #include <UgaDraw.h>
40 #include <BlockIo.h>
41 #include <Acpi.h>
42 #include <GlobalVariable.h>
43
44 /* Registry Headers */
45 #define __FREELDR_H
46 #include <cmlib.h>
47
48 /* DEFINES *******************************************************************/
49
50 DEFINE_GUID(BadMemoryGuid, 0x54B8275B, 0xD431, 0x473F, 0xAC, 0xFB, 0xE5, 0x36, 0xA0, 0x84, 0x94, 0xA3);
51
52 #define BL_APPLICATION_FLAG_CONVERTED_FROM_EFI 0x01
53
54 #define BL_APP_ENTRY_SIGNATURE "BTAPENT"
55
56 #define BOOT_APPLICATION_SIGNATURE_1 'TOOB'
57 #define BOOT_APPLICATION_SIGNATURE_2 ' PPA'
58
59 #define BOOT_MEMORY_TRANSLATION_TYPE_PHYSICAL 0
60 #define BOOT_MEMORY_TRANSLATION_TYPE_VIRTUAL 1
61
62 #define BOOT_APPLICATION_VERSION 2
63 #define BL_MEMORY_DATA_VERSION 1
64 #define BL_RETURN_ARGUMENTS_VERSION 1
65 #define BL_FIRMWARE_DESCRIPTOR_VERSION 2
66
67 #define BL_RETURN_ARGUMENTS_NO_PAE_FLAG 0x40
68
69 #define BL_APPLICATION_ENTRY_FLAG_NO_GUID 0x01
70 #define BL_APPLICATION_ENTRY_BCD_OPTIONS_INTERNAL 0x02
71 #define BL_APPLICATION_ENTRY_WINLOAD 0x04
72 #define BL_APPLICATION_ENTRY_STARTUP 0x08
73 #define BL_APPLICATION_ENTRY_REBOOT_ON_ERROR 0x20
74 #define BL_APPLICATION_ENTRY_NTLDR 0x40
75 #define BL_APPLICATION_ENTRY_BCD_OPTIONS_EXTERNAL 0x80
76 #define BL_APPLICATION_ENTRY_WINRESUME 0x100
77 #define BL_APPLICATION_ENTRY_SETUPLDR 0x200
78 #define BL_APPLICATION_ENTRY_BOOTSECTOR 0x400
79 #define BL_APPLICATION_ENTRY_BOOTMGR 0x1000
80 #define BL_APPLICATION_ENTRY_DISPLAY_ORDER 0x800000
81 #define BL_APPLICATION_ENTRY_FIXED_SEQUENCE 0x20000000
82 #define BL_APPLICATION_ENTRY_RECOVERY 0x40000000
83
84 #define BL_CONTEXT_PAGING_ON 1
85 #define BL_CONTEXT_INTERRUPTS_ON 2
86
87 #define BL_MM_FLAG_USE_FIRMWARE_FOR_MEMORY_MAP_BUFFERS 0x01
88 #define BL_MM_FLAG_REQUEST_COALESCING 0x02
89
90 #define BL_MM_ADD_DESCRIPTOR_COALESCE_FLAG 0x01
91 #define BL_MM_ADD_DESCRIPTOR_TRUNCATE_FLAG 0x02
92 #define BL_MM_ADD_DESCRIPTOR_NEVER_COALESCE_FLAG 0x10
93 #define BL_MM_ADD_DESCRIPTOR_NEVER_TRUNCATE_FLAG 0x20
94 #define BL_MM_ADD_DESCRIPTOR_ALLOCATE_FLAG 0x1000
95 #define BL_MM_ADD_DESCRIPTOR_UPDATE_LIST_POINTER_FLAG 0x2000
96
97 #define BL_MM_INCLUDE_MAPPED_ALLOCATED 0x01
98 #define BL_MM_INCLUDE_MAPPED_UNALLOCATED 0x02
99 #define BL_MM_INCLUDE_UNMAPPED_ALLOCATED 0x04
100 #define BL_MM_INCLUDE_UNMAPPED_UNALLOCATED 0x08
101 #define BL_MM_INCLUDE_RESERVED_ALLOCATED 0x10
102 #define BL_MM_INCLUDE_BAD_MEMORY 0x20
103 #define BL_MM_INCLUDE_FIRMWARE_MEMORY 0x40
104 #define BL_MM_INCLUDE_TRUNCATED_MEMORY 0x80
105 #define BL_MM_INCLUDE_PERSISTENT_MEMORY 0x100
106 #define BL_MM_INCLUDE_FIRMWARE_MEMORY_2 0x200
107
108 #define BL_MM_INCLUDE_NO_FIRMWARE_MEMORY (BL_MM_INCLUDE_PERSISTENT_MEMORY | \
109 BL_MM_INCLUDE_TRUNCATED_MEMORY | \
110 BL_MM_INCLUDE_BAD_MEMORY | \
111 BL_MM_INCLUDE_RESERVED_ALLOCATED | \
112 BL_MM_INCLUDE_UNMAPPED_UNALLOCATED | \
113 BL_MM_INCLUDE_UNMAPPED_ALLOCATED | \
114 BL_MM_INCLUDE_MAPPED_UNALLOCATED | \
115 BL_MM_INCLUDE_MAPPED_ALLOCATED)
116 C_ASSERT(BL_MM_INCLUDE_NO_FIRMWARE_MEMORY == 0x1BF);
117
118 #define BL_MM_INCLUDE_ONLY_FIRMWARE_MEMORY (BL_MM_INCLUDE_FIRMWARE_MEMORY_2 | \
119 BL_MM_INCLUDE_FIRMWARE_MEMORY)
120 C_ASSERT(BL_MM_INCLUDE_ONLY_FIRMWARE_MEMORY == 0x240);
121
122 #define BL_MM_REQUEST_DEFAULT_TYPE 1
123 #define BL_MM_REQUEST_TOP_DOWN_TYPE 2
124
125 #define BL_MM_REMOVE_PHYSICAL_REGION_FLAG 0x40000000
126 #define BL_MM_REMOVE_VIRTUAL_REGION_FLAG 0x80000000
127
128 #define BL_LIBRARY_FLAG_NO_DISPLAY 0x01
129 #define BL_LIBRARY_FLAG_REINITIALIZE 0x02
130 #define BL_LIBRARY_FLAG_REINITIALIZE_ALL 0x04
131 #define BL_LIBRARY_FLAG_ZERO_HEAP_ALLOCATIONS_ON_FREE 0x10
132 #define BL_LIBRARY_FLAG_INITIALIZATION_COMPLETED 0x20
133 #define BL_LIBRARY_FLAG_NO_GRAPHICS_CONSOLE 0x800
134
135 #define BL_DISPLAY_GRAPHICS_FORCED_VIDEO_MODE_FLAG 0x01
136 #define BL_DISPLAY_GRAPHICS_FORCED_HIGH_RES_MODE_FLAG 0x02
137
138 #define BL_HT_VALUE_IS_INLINE 0x01
139
140 #define BL_FS_REGISTER_AT_HEAD_FLAG 1
141
142 #define BL_BLOCK_DEVICE_REMOVABLE_FLAG 0x01
143 #define BL_BLOCK_DEVICE_PRESENT_FLAG 0x02
144 #define BL_BLOCK_DEVICE_VIRTUAL_FLAG 0x04
145
146 #define BL_MEMORY_CLASS_SHIFT 28
147
148 #define BL_FILE_READ_ACCESS 0x01
149 #define BL_FILE_WRITE_ACCESS 0x02
150 #define BL_DIRECTORY_ACCESS 0x04
151 #define BL_UNKNOWN_ACCESS 0x10
152
153 #define BL_DEVICE_READ_ACCESS 0x01
154 #define BL_DEVICE_WRITE_ACCESS 0x02
155
156 #define BL_DEVICE_ENTRY_OPENED 0x01
157 #define BL_DEVICE_ENTRY_READ_ACCESS 0x02
158 #define BL_DEVICE_ENTRY_WRITE_ACCESS 0x04
159
160 #define BL_FILE_ENTRY_OPENED 0x01
161 #define BL_FILE_ENTRY_READ_ACCESS 0x02
162 #define BL_FILE_ENTRY_WRITE_ACCESS 0x04
163 #define BL_FILE_ENTRY_UNKNOWN_ACCESS 0x10
164 #define BL_FILE_ENTRY_DIRECTORY 0x10000
165
166 #define BL_ETFS_FILE_ENTRY_DIRECTORY 0x01
167
168 #define BL_IMG_VALID_FILE 0x01
169 #define BL_IMG_MEMORY_FILE 0x02
170 #define BL_IMG_REMOTE_FILE 0x04
171
172 #define BL_LOAD_IMG_VIRTUAL_BUFFER 0x01
173 #define BL_LOAD_IMG_EXISTING_BUFFER 0x04
174 #define BL_LOAD_IMG_UNKNOWN_BUFFER_FLAG 0x08
175 #define BL_LOAD_IMG_COMPUTE_SIGNATURE 0x10
176 #define BL_LOAD_IMG_COMPUTE_HASH 0x40000
177
178 #define BL_LOAD_PE_IMG_VIRTUAL_BUFFER BL_LOAD_IMG_VIRTUAL_BUFFER
179 #define BL_LOAD_PE_IMG_CHECK_MACHINE 0x02
180 #define BL_LOAD_PE_IMG_EXISTING_BUFFER BL_LOAD_IMG_EXISTING_BUFFER
181 #define BL_LOAD_PE_IMG_COMPUTE_HASH 0x10
182 #define BL_LOAD_PE_IMG_CHECK_SUBSYSTEM 0x80
183 #define BL_LOAD_PE_IMG_SKIP_RELOCATIONS 0x100
184 #define BL_LOAD_PE_IMG_CHECK_FORCED_INTEGRITY 0x200
185 #define BL_LOAD_PE_IMG_IGNORE_CHECKSUM_MISMATCH 0x10000
186 #define BL_LOAD_PE_IMG_VALIDATE_ORIGINAL_FILENAME 0x400000
187
188 #define BL_UTL_CHECKSUM_COMPLEMENT 0x10000
189 #define BL_UTL_CHECKSUM_ROTATE 0x20000
190 #define BL_UTL_CHECKSUM_NEGATE 0x40000
191 #define BL_UTL_CHECKSUM_UCHAR_BUFFER 0x01
192 #define BL_UTL_CHECKSUM_USHORT_BUFFER 0x02
193
194 /* ENUMERATIONS **************************************************************/
195
196 typedef enum _BL_COLOR
197 {
198 Black,
199 Blue,
200 Green,
201 Cyan,
202 Red,
203 Magenta,
204 Brown,
205 LtGray,
206 Gray,
207 LtBlue,
208 LtGreen,
209 LtCyan,
210 LtRed,
211 LtMagenta,
212 Yellow,
213 White
214 } BL_COLOR, *PBL_COLOR;
215
216 typedef enum _BL_MENU_POLICY
217 {
218 MenuPolicyLegacy = 0,
219 MenuPolicyStandard = 1
220 } BL_MENU_POLICY;
221
222 typedef enum _BL_MEMORY_DESCRIPTOR_TYPE
223 {
224 BlMdPhysical,
225 BlMdVirtual,
226 BlMdTracker
227 } BL_MEMORY_DESCRIPTOR_TYPE;
228
229 typedef enum _BL_TRANSLATION_TYPE
230 {
231 BlNone,
232 BlVirtual,
233 BlPae,
234 BlMax
235 } BL_TRANSLATION_TYPE;
236
237 typedef enum _BL_ARCH_MODE
238 {
239 BlProtectedMode,
240 BlRealMode
241 } BL_ARCH_MODE;
242
243 //
244 // Boot Device Types
245 //
246 typedef enum _BL_DEVICE_TYPE
247 {
248 DiskDevice = 0,
249 LegacyPartitionDevice = 2,
250 SerialDevice = 3,
251 UdpDevice = 4,
252 BootDevice = 5,
253 PartitionDevice = 6,
254 LocateDevice = 8,
255 } BL_DEVICE_TYPE;
256
257 //
258 // Local Device Types
259 //
260 typedef enum _BL_LOCAL_DEVICE_TYPE
261 {
262 LocalDevice = 0,
263 FloppyDevice = 1,
264 CdRomDevice = 2,
265 RamDiskDevice = 3,
266 FileDevice = 5,
267 VirtualDiskDevice = 6
268 } BL_LOCAL_DEVICE_TYPE;
269
270 //
271 // Partition types
272 //
273 typedef enum _BL_PARTITION_TYPE
274 {
275 GptPartition,
276 MbrPartition,
277 RawPartition,
278 } BL_PARTITION_TYPE;
279
280 //
281 // File Path Types
282 //
283 typedef enum _BL_PATH_TYPE
284 {
285 InternalPath = 3,
286 EfiPath = 4
287 } BL_PATH_TYPE;
288
289 //
290 // Classes of Memory
291 //
292 typedef enum _BL_MEMORY_CLASS
293 {
294 BlLoaderClass = 0xD,
295 BlApplicationClass,
296 BlSystemClass
297 } BL_MEMORY_CLASS;
298
299 //
300 // Types of Memory
301 //
302 typedef enum _BL_MEMORY_TYPE
303 {
304 //
305 // Loader Memory
306 //
307 BlLoaderMemory = 0xD0000002,
308 BlLoaderDeviceMemory = 0xD0000004,
309 BlLoaderHeap = 0xD0000005,
310 BlLoaderPageDirectory = 0xD0000006,
311 BlLoaderReferencePage = 0xD0000007,
312 BlLoaderRamDisk = 0xD0000008,
313 BlLoaderArchData = 0xD0000009,
314 BlLoaderData = 0xD000000A,
315 BlLoaderRegistry = 0xD000000B,
316 BlLoaderBlockMemory = 0xD000000C,
317 BlLoaderSelfMap = 0xD000000F,
318
319 //
320 // Application Memory
321 //
322 BlApplicationReserved = 0xE0000001,
323 BlApplicationData = 0xE0000004,
324
325 //
326 // System Memory
327 //
328 BlConventionalMemory = 0xF0000001,
329 BlUnusableMemory = 0xF0000002,
330 BlReservedMemory = 0xF0000003,
331 BlEfiBootMemory = 0xF0000004,
332 BlConventionalZeroedMemory = 0xF000005,
333 BlEfiRuntimeCodeMemory = 0xF0000006,
334 BlAcpiReclaimMemory = 0xF0000008,
335 BlAcpiNvsMemory = 0xF0000009,
336 BlDeviceIoMemory = 0xF000000A,
337 BlDevicePortMemory = 0xF000000B,
338 BlPalMemory = 0xF000000C,
339 BlEfiRuntimeDataMemory = 0xF000000E,
340 } BL_MEMORY_TYPE;
341
342 typedef enum _BL_MEMORY_ATTR
343 {
344 //
345 // Memory Caching Attributes
346 //
347 BlMemoryUncached = 0x00000001,
348 BlMemoryWriteCombined = 0x00000002,
349 BlMemoryWriteThrough = 0x00000004,
350 BlMemoryWriteBack = 0x00000008,
351 BlMemoryUncachedExported = 0x00000010,
352 BlMemoryValidCacheAttributes = BlMemoryUncached | BlMemoryWriteCombined | BlMemoryWriteThrough | BlMemoryWriteBack | BlMemoryUncachedExported,
353 BlMemoryValidCacheAttributeMask = 0x000000FF,
354
355 //
356 // Memory Protection Attributes
357 //
358 BlMemoryWriteProtected = 0x00000100,
359 BlMemoryReadProtected = 0x00000200,
360 BlMemoryExecuteProtected = 0x00000400,
361 BlMemoryValidProtectionAttributes = BlMemoryWriteProtected | BlMemoryReadProtected | BlMemoryExecuteProtected,
362 BlMemoryValidProtectionAttributeMask = 0x0000FF00,
363
364 //
365 // Memory Allocation Attributes
366 //
367 BlMemoryLargePages = 0x00010000,
368 BlMemoryKernelRange = 0x00020000,
369 BlMemoryFixed = 0x00040000,
370 BlMemoryBelow1MB = 0x00080000,
371 BlMemoryValidAllocationAttributes = BlMemoryKernelRange | BlMemoryFixed | BlMemoryBelow1MB | BlMemoryLargePages,
372 BlMemoryValidAllocationAttributeMask = 0x00FF0000,
373
374 //
375 // Memory Type Attributes
376 //
377 BlMemoryRuntime = 0x01000000,
378 BlMemoryCoalesced = 0x02000000,
379 BlMemoryUpdate = 0x04000000,
380 BlMemoryNonFirmware = 0x08000000,
381 BlMemoryPersistent = 0x10000000,
382 BlMemorySpecial = 0x20000000,
383 BlMemoryFirmware = 0x80000000,
384 BlMemoryValidTypeAttributes = BlMemoryRuntime | BlMemoryCoalesced | BlMemoryUpdate | BlMemoryNonFirmware | BlMemoryPersistent | BlMemorySpecial | BlMemoryFirmware,
385 BlMemoryValidTypeAttributeMask = 0xFF000000,
386 } BL_MEMORY_ATTR;
387
388 /* CALLBACKS *****************************************************************/
389
390 struct _BL_FILE_ENTRY;
391 struct _BL_FILE_INFORMATION;
392 typedef
393 NTSTATUS
394 (*PBL_FILE_OPEN) (
395 _In_ struct _BL_FILE_ENTRY* Directory,
396 _In_ PWCHAR FileName,
397 _In_ ULONG Flags,
398 _Out_ struct _BL_FILE_ENTRY** FileEntry
399 );
400
401 typedef
402 NTSTATUS
403 (*PBL_FILE_CLOSE) (
404 _In_ struct _BL_FILE_ENTRY* FileEntry
405 );
406
407 typedef
408 NTSTATUS
409 (*PBL_FILE_READ) (
410 _In_ struct _BL_FILE_ENTRY* FileEntry,
411 _In_ PVOID Buffer,
412 _In_ ULONG Size,
413 _Out_opt_ PULONG BytesRead
414 );
415
416 typedef
417 NTSTATUS
418 (*PBL_FILE_WRITE) (
419 VOID
420 );
421
422 typedef
423 NTSTATUS
424 (*PBL_FILE_GET_NEXT) (
425 VOID
426 );
427
428 typedef
429 NTSTATUS
430 (*PBL_FILE_GET_INFO) (
431 _In_ struct _BL_FILE_ENTRY* FileEntry,
432 _Out_ struct _BL_FILE_INFORMATION* FileInfo
433 );
434
435 typedef
436 NTSTATUS
437 (*PBL_FILE_SET_INFO) (
438 _In_ struct _BL_FILE_ENTRY* FileEntry,
439 _In_ struct _BL_FILE_INFORMATION* FileInfo
440 );
441
442 typedef
443 NTSTATUS
444 (*PBL_FS_INIT_CALLBACK) (
445 VOID
446 );
447
448 typedef
449 NTSTATUS
450 (*PBL_FS_DESTROY_CALLBACK) (
451 VOID
452 );
453
454 typedef
455 NTSTATUS
456 (*PBL_FS_MOUNT_CALLBACK) (
457 _In_ ULONG DeviceId,
458 _In_ ULONG Unknown,
459 _Out_ struct _BL_FILE_ENTRY** FileEntry
460 );
461
462 typedef
463 NTSTATUS
464 (*PBL_FS_PURGE_CALLBACK) (
465 VOID
466 );
467
468 typedef
469 NTSTATUS
470 (*PBL_FILE_DESTROY_CALLBACK) (
471 _In_ PVOID Entry
472 );
473
474 struct _BL_TEXT_CONSOLE;
475 struct _BL_DISPLAY_STATE;
476 struct _BL_DISPLAY_MODE;
477 struct _BL_INPUT_CONSOLE;
478 struct _BL_REMOTE_CONSOLE;
479 struct _BL_GRAPHICS_CONSOLE;
480 typedef
481 VOID
482 (*PCONSOLE_DESTRUCT) (
483 _In_ struct _BL_TEXT_CONSOLE* Console
484 );
485
486 typedef
487 NTSTATUS
488 (*PCONSOLE_REINITIALIZE) (
489 _In_ struct _BL_TEXT_CONSOLE* Console
490 );
491
492 typedef
493 NTSTATUS
494 (*PCONSOLE_GET_TEXT_STATE) (
495 _In_ struct _BL_TEXT_CONSOLE* Console,
496 _Out_ struct _BL_DISPLAY_STATE* TextState
497 );
498
499 typedef
500 NTSTATUS
501 (*PCONSOLE_SET_TEXT_STATE) (
502 _In_ struct _BL_TEXT_CONSOLE* Console,
503 _In_ ULONG Flags,
504 _In_ struct _BL_DISPLAY_STATE* TextState
505 );
506
507 typedef
508 NTSTATUS
509 (*PCONSOLE_GET_TEXT_RESOLUTION) (
510 _In_ struct _BL_TEXT_CONSOLE* Console,
511 _Out_ PULONG TextResolution
512 );
513
514 typedef
515 NTSTATUS
516 (*PCONSOLE_SET_TEXT_RESOLUTION) (
517 _In_ struct _BL_TEXT_CONSOLE* Console,
518 _In_ ULONG NewTextResolution,
519 _Out_ PULONG OldTextResolution
520 );
521
522 typedef
523 NTSTATUS
524 (*PCONSOLE_CLEAR_TEXT) (
525 _In_ struct _BL_TEXT_CONSOLE* Console,
526 _In_ BOOLEAN LineOnly
527 );
528
529 typedef
530 BOOLEAN
531 (*PCONSOLE_IS_ENABLED) (
532 _In_ struct _BL_GRAPHICS_CONSOLE* Console
533 );
534
535 typedef
536 NTSTATUS
537 (*PCONSOLE_GET_GRAPHICAL_RESOLUTION) (
538 _In_ struct _BL_GRAPHICS_CONSOLE* Console,
539 _Out_ struct _BL_DISPLAY_MODE* DisplayMode
540 );
541
542 typedef
543 NTSTATUS
544 (*PCONSOLE_SET_GRAPHICAL_RESOLUTION) (
545 _In_ struct _BL_GRAPHICS_CONSOLE* Console,
546 _In_ struct _BL_DISPLAY_MODE DisplayMode
547 );
548
549 typedef
550 NTSTATUS
551 (*PCONSOLE_ENABLE) (
552 _In_ struct _BL_GRAPHICS_CONSOLE* Console,
553 _In_ BOOLEAN Enable
554 );
555
556 typedef
557 NTSTATUS
558 (*PCONSOLE_WRITE_TEXT) (
559 _In_ struct _BL_TEXT_CONSOLE* Console,
560 _In_ PCHAR Text,
561 _In_ ULONG Attribute
562 );
563
564 typedef
565 BOOLEAN
566 (*PBL_TBL_LOOKUP_ROUTINE) (
567 _In_ PVOID Entry,
568 _In_ PVOID Argument1,
569 _In_ PVOID Argument2,
570 _In_ PVOID Argument3,
571 _In_ PVOID Argument4
572 );
573
574 typedef
575 NTSTATUS
576 (*PBL_TBL_MAP_ROUTINE) (
577 _In_ PVOID Entry,
578 _In_ ULONG EntryIndex
579 );
580
581 typedef
582 NTSTATUS
583 (*PBL_TBL_SET_ROUTINE) (
584 _In_ PVOID Entry
585 );
586
587 typedef
588 NTSTATUS
589 (*PBL_IO_DESTROY_ROUTINE) (
590 VOID
591 );
592
593 struct _BL_HASH_ENTRY;
594 typedef
595 BOOLEAN
596 (*PBL_HASH_TABLE_COMPARE_FUNCTION) (
597 _In_ struct _BL_HASH_ENTRY* Entry1,
598 _In_ struct _BL_HASH_ENTRY* Entry2
599 );
600
601 typedef
602 ULONG
603 (*PBL_HASH_TABLE_HASH_FUNCTION) (
604 _In_ struct _BL_HASH_ENTRY* Entry,
605 _In_ ULONG TableSize
606 );
607
608 struct _BL_DEVICE_ENTRY;
609 struct _BL_DEVICE_DESCRIPTOR;
610 struct _BL_DEVICE_INFORMATION;
611
612 typedef
613 NTSTATUS
614 (*PBL_DEVICE_ENUMERATE_DEVICE_CLASS) (
615 VOID
616 );
617
618 typedef
619 NTSTATUS
620 (*PBL_DEVICE_OPEN) (
621 _In_ struct _BL_DEVICE_DESCRIPTOR* Device,
622 _In_ struct _BL_DEVICE_ENTRY* DeviceEntry
623 );
624
625 typedef
626 NTSTATUS
627 (*PBL_DEVICE_CLOSE) (
628 _In_ struct _BL_DEVICE_ENTRY* DeviceEntry
629 );
630
631 typedef
632 NTSTATUS
633 (*PBL_DEVICE_READ) (
634 _In_ struct _BL_DEVICE_ENTRY* DeviceEntry,
635 _In_ PVOID Buffer,
636 _In_ ULONG Size,
637 _Out_ PULONG BytesRead
638 );
639
640 typedef
641 NTSTATUS
642 (*PBL_DEVICE_WRITE) (
643 VOID
644 );
645
646 typedef
647 NTSTATUS
648 (*PBL_DEVICE_GET_INFORMATION) (
649 _In_ struct _BL_DEVICE_ENTRY* DeviceEntry,
650 _Out_ struct _BL_DEVICE_INFORMATION* DeviceInformation
651 );
652
653 typedef
654 NTSTATUS
655 (*PBL_DEVICE_SET_INFORMATION) (
656 _In_ struct _BL_DEVICE_ENTRY* DeviceEntry,
657 _In_ struct _BL_DEVICE_INFORMATION* DeviceInformation
658 );
659
660 typedef
661 NTSTATUS
662 (*PBL_DEVICE_RESET) (
663 VOID
664 );
665
666 typedef
667 NTSTATUS
668 (*PBL_DEVICE_FLUSH) (
669 VOID
670 );
671
672 typedef
673 NTSTATUS
674 (*PBL_DEVICE_CREATE) (
675 VOID
676 );
677
678 /* DATA STRUCTURES ***********************************************************/
679
680 typedef struct _BL_LIBRARY_PARAMETERS
681 {
682 ULONG LibraryFlags;
683 ULONG TranslationType;
684 ULONG MinimumAllocationCount;
685 ULONG MinimumHeapSize;
686 ULONG HeapAllocationAttributes;
687 PWCHAR ApplicationBaseDirectory;
688 ULONG DescriptorCount;
689 PWCHAR FontBaseDirectory;
690 } BL_LIBRARY_PARAMETERS, *PBL_LIBRARY_PARAMETERS;
691
692 /* This should eventually go into a more public header */
693 typedef struct _BOOT_APPLICATION_PARAMETER_BLOCK
694 {
695 /* This header tells the library what image we're dealing with */
696 ULONG Signature[2];
697 ULONG Version;
698 ULONG Size;
699 ULONG ImageType;
700 ULONG MemoryTranslationType;
701
702 /* Where is the image located */
703 ULONGLONG ImageBase;
704 ULONG ImageSize;
705
706 /* Offset to BL_MEMORY_DATA */
707 ULONG MemoryDataOffset;
708
709 /* Offset to BL_APPLICATION_ENTRY */
710 ULONG AppEntryOffset;
711
712 /* Offset to BL_DEVICE_DESCRPIPTOR */
713 ULONG BootDeviceOffset;
714
715 /* Offset to BL_FIRMWARE_PARAMETERS */
716 ULONG FirmwareParametersOffset;
717
718 /* Offset to BL_RETURN_ARGUMENTS */
719 ULONG ReturnArgumentsOffset;
720 } BOOT_APPLICATION_PARAMETER_BLOCK, *PBOOT_APPLICATION_PARAMETER_BLOCK;
721
722 typedef struct _BL_MEMORY_DATA
723 {
724 ULONG Version;
725 ULONG MdListOffset;
726 ULONG DescriptorCount;
727 ULONG DescriptorSize;
728 ULONG DescriptorOffset;
729 } BL_MEMORY_DATA, *PBL_MEMORY_DATA;
730
731 typedef struct _BL_FIRMWARE_DESCRIPTOR
732 {
733 ULONG Version;
734 ULONG Unknown;
735 EFI_HANDLE ImageHandle;
736 EFI_SYSTEM_TABLE *SystemTable;
737 } BL_FIRMWARE_DESCRIPTOR, *PBL_FIRMWARE_DESCRIPTOR;
738
739 typedef struct _BL_RETURN_ARGUMENTS
740 {
741 ULONG Version;
742 NTSTATUS Status;
743 ULONG Flags;
744 ULONGLONG DataSize;
745 ULONGLONG DataPage;
746 } BL_RETURN_ARGUMENTS, *PBL_RETURN_ARGUMENTS;
747
748 typedef struct _BL_MEMORY_DESCRIPTOR
749 {
750 LIST_ENTRY ListEntry;
751 union
752 {
753 struct
754 {
755 ULONGLONG BasePage;
756 ULONGLONG VirtualPage;
757 };
758 struct
759 {
760 ULONGLONG BaseAddress;
761 ULONGLONG VirtualAddress;
762 };
763 };
764 ULONGLONG PageCount;
765 ULONG Flags;
766 BL_MEMORY_TYPE Type;
767 } BL_MEMORY_DESCRIPTOR, *PBL_MEMORY_DESCRIPTOR;
768
769 typedef struct _BL_BCD_OPTION
770 {
771 ULONG Type;
772 ULONG DataOffset;
773 ULONG DataSize;
774 ULONG ListOffset;
775 ULONG NextEntryOffset;
776 ULONG Empty;
777 } BL_BCD_OPTION, *PBL_BCD_OPTION;
778
779 typedef struct _BL_APPLICATION_ENTRY
780 {
781 CHAR Signature[8];
782 ULONG Flags;
783 GUID Guid;
784 ULONG Unknown[4];
785 BL_BCD_OPTION BcdData;
786 } BL_APPLICATION_ENTRY, *PBL_APPLICATION_ENTRY;
787
788 typedef struct _BL_LOADED_APPLICATION_ENTRY
789 {
790 ULONG Flags;
791 GUID Guid;
792 PBL_BCD_OPTION BcdData;
793 } BL_LOADED_APPLICATION_ENTRY, *PBL_LOADED_APPLICATION_ENTRY;
794
795 typedef struct _BL_MENU_STATUS
796 {
797 union
798 {
799 struct
800 {
801 ULONG AnyKey : 1;
802 ULONG AdvancedOptions : 1;
803 ULONG BootOptions : 1;
804 ULONG OemKey : 1;
805 ULONG Exit : 1;
806 ULONG Reserved : 27;
807 };
808 ULONG AsULong;
809 };
810 ULONG BootIndex;
811 WCHAR KeyValue;
812 } BL_MENU_STATUS, *PL_MENU_STATUS;
813
814 typedef enum _BL_BOOT_ERROR_STATUS
815 {
816 Reboot = 1,
817 Recover = 2,
818 RecoverOem = 3,
819 OsSelection = 4,
820 NextOs = 5,
821 TryAgain = 6,
822 AdvancedOptions = 7,
823 BootOptions = 8
824 } BL_BOOT_ERROR_STATUS;
825
826 typedef struct _BL_HARDDISK_DEVICE
827 {
828 ULONG PartitionType;
829 union
830 {
831 struct
832 {
833 ULONG PartitionSignature;
834 } Mbr;
835
836 struct
837 {
838 GUID PartitionSignature;
839 } Gpt;
840
841 struct
842 {
843 ULONG DiskNumber;
844 } Raw;
845 };
846 } BL_HARDDISK_DEVICE;
847
848 typedef struct _BL_LOCAL_DEVICE
849 {
850 ULONG Type;
851 union
852 {
853 struct
854 {
855 ULONG DriveNumber;
856 } FloppyDisk;
857
858 BL_HARDDISK_DEVICE HardDisk;
859
860 struct
861 {
862 PHYSICAL_ADDRESS ImageBase;
863 LARGE_INTEGER ImageSize;
864 ULONG ImageOffset;
865 } RamDisk;
866
867 ULONG File; // unknown for now
868 };
869 } BL_LOCAL_DEVICE, *PBL_LOCAL_DEVICE;
870
871 typedef struct _BL_DEVICE_DESCRIPTOR
872 {
873 DEVICE_TYPE DeviceType;
874 ULONG Flags;
875 ULONG Size;
876 ULONG Unknown;
877 union
878 {
879 BL_LOCAL_DEVICE Local;
880
881 struct
882 {
883 ULONG Unknown;
884 } Remote;
885
886 struct
887 {
888 union
889 {
890 ULONG PartitionNumber;
891 } Mbr;
892
893 union
894 {
895 GUID PartitionGuid;
896 } Gpt;
897
898 BL_LOCAL_DEVICE Disk;
899 } Partition;
900 };
901 } BL_DEVICE_DESCRIPTOR, *PBL_DEVICE_DESCRIPTOR;
902
903 typedef struct _BL_FILE_PATH_DESCRIPTOR
904 {
905 ULONG Version;
906 ULONG Length;
907 ULONG PathType;
908 UCHAR Path[ANYSIZE_ARRAY];
909 } BL_FILE_PATH_DESCRIPTOR, *PBL_FILE_PATH_DESCRIPTOR;
910
911 typedef struct _BL_WINDOWS_LOAD_OPTIONS
912 {
913 CHAR Signature[8];
914 ULONG Version;
915 ULONG Length;
916 ULONG OsPathOffset;
917 WCHAR LoadOptions[ANYSIZE_ARRAY];
918 } BL_WINDOWS_LOAD_OPTIONS, *PBL_WINDOWS_LOAD_OPTIONS;
919
920 typedef struct _BL_ARCH_CONTEXT
921 {
922 BL_ARCH_MODE Mode;
923 BL_TRANSLATION_TYPE TranslationType;
924 ULONG ContextFlags;
925 } BL_ARCH_CONTEXT, *PBL_ARCH_CONTEXT;
926
927 typedef struct _BL_MEMORY_DESCRIPTOR_LIST
928 {
929 LIST_ENTRY ListHead;
930 PLIST_ENTRY First;
931 PLIST_ENTRY This;
932 ULONG Type;
933 } BL_MEMORY_DESCRIPTOR_LIST, *PBL_MEMORY_DESCRIPTOR_LIST;
934
935 typedef struct _BL_ADDRESS_RANGE
936 {
937 ULONGLONG Minimum;
938 ULONGLONG Maximum;
939 } BL_ADDRESS_RANGE, *PBL_ADDRESS_RANGE;
940
941 typedef struct _BL_FILE_INFORMATION
942 {
943 ULONGLONG Size;
944 ULONGLONG Offset;
945 PWCHAR FsName;
946 ULONG Flags;
947 } BL_FILE_INFORMATION, *PBL_FILE_INFORMATION;
948
949 typedef struct _BL_FILE_CALLBACKS
950 {
951 PBL_FILE_OPEN Open;
952 PBL_FILE_CLOSE Close;
953 PBL_FILE_READ Read;
954 PBL_FILE_WRITE Write;
955 PBL_FILE_GET_NEXT GetNext;
956 PBL_FILE_GET_INFO GetInfo;
957 PBL_FILE_SET_INFO SetInfo;
958 } BL_FILE_CALLBACKS, *PBL_FILE_CALLBACKS;
959
960 typedef struct _BL_FILE_ENTRY
961 {
962 PWCHAR FilePath;
963 ULONG DeviceId;
964 ULONG FileId;
965 ULONG Flags;
966 ULONG ReferenceCount;
967 ULONG Unknown;
968 ULONGLONG TotalBytesRead;
969 ULONGLONG Unknown2;
970 BL_FILE_CALLBACKS Callbacks;
971 PVOID FsSpecificData;
972 } BL_FILE_ENTRY, *PBL_FILE_ENTRY;
973
974 typedef struct _BL_FILE_SYSTEM_ENTRY
975 {
976 LIST_ENTRY ListEntry;
977 PBL_FS_INIT_CALLBACK InitCallback;
978 PBL_FS_DESTROY_CALLBACK DestroyCallback;
979 PBL_FS_MOUNT_CALLBACK MountCallback;
980 PBL_FS_PURGE_CALLBACK PurgeCallback;
981 } BL_FILE_SYSTEM_ENTRY, *PBL_FILE_SYSTEM_ENTRY;
982
983 typedef struct _BL_FILE_SYSTEM_REGISTRATION_TABLE
984 {
985 PBL_FS_INIT_CALLBACK Init;
986 PBL_FS_DESTROY_CALLBACK Destroy;
987 PBL_FS_MOUNT_CALLBACK Mount;
988 PBL_FS_PURGE_CALLBACK Purge;
989 } BL_FILE_SYSTEM_REGISTRATION_TABLE;
990
991 typedef struct _BL_DISPLAY_STATE
992 {
993 ULONG BgColor;
994 ULONG FgColor;
995 ULONG XPos;
996 ULONG YPos;
997 ULONG CursorVisible;
998 } BL_DISPLAY_STATE, *PBL_DISPLAY_STATE;
999
1000 typedef struct _BL_DISPLAY_MODE
1001 {
1002 ULONG HRes;
1003 ULONG VRes;
1004 ULONG HRes2;
1005 } BL_DISPLAY_MODE, *PBL_DISPLAY_MODE;
1006
1007 typedef struct _BL_TEXT_CONSOLE_VTABLE
1008 {
1009 PCONSOLE_DESTRUCT Destruct;
1010 PCONSOLE_REINITIALIZE Reinitialize;
1011 PCONSOLE_GET_TEXT_STATE GetTextState;
1012 PCONSOLE_SET_TEXT_STATE SetTextState;
1013 PCONSOLE_GET_TEXT_RESOLUTION GetTextResolution;
1014 PCONSOLE_SET_TEXT_RESOLUTION SetTextResolution;
1015 PCONSOLE_CLEAR_TEXT ClearText;
1016 PCONSOLE_WRITE_TEXT WriteText;
1017 } BL_TEXT_CONSOLE_VTABLE, *PBL_TEXT_CONSOLE_VTABLE;
1018
1019 typedef struct _BL_GRAPHICS_CONSOLE_VTABLE
1020 {
1021 BL_TEXT_CONSOLE_VTABLE Text;
1022 PCONSOLE_IS_ENABLED IsEnabled;
1023 PCONSOLE_ENABLE Enable;
1024 PVOID GetConsoleResolution;
1025 PCONSOLE_GET_GRAPHICAL_RESOLUTION GetGraphicalResolution;
1026 PCONSOLE_GET_GRAPHICAL_RESOLUTION GetOriginalResolution;
1027 PCONSOLE_SET_GRAPHICAL_RESOLUTION SetOriginalResolution;
1028 /// more for graphics ///
1029 } BL_GRAPHICS_CONSOLE_VTABLE, *PBL_GRAPHICS_CONSOLE_VTABLE;
1030
1031 typedef struct _BL_TEXT_CONSOLE
1032 {
1033 PBL_TEXT_CONSOLE_VTABLE Callbacks;
1034 BL_DISPLAY_STATE State;
1035 BL_DISPLAY_MODE DisplayMode;
1036 BOOLEAN Active;
1037 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL* Protocol;
1038 ULONG Mode;
1039 EFI_SIMPLE_TEXT_OUTPUT_MODE OldMode;
1040 } BL_TEXT_CONSOLE, *PBL_TEXT_CONSOLE;
1041
1042 typedef struct _BL_INPUT_CONSOLE_VTABLE
1043 {
1044 PCONSOLE_DESTRUCT Destruct;
1045 PCONSOLE_REINITIALIZE Reinitialize;
1046 //PCONSOLE_IS_KEY_PENDING IsKeyPending;
1047 //PCONSOLE_READ_INPUT ReadInput;
1048 //PCONSOLE_ERASE_BUFFER EraseBuffer;
1049 //PCONSOLE_FILL_BUFFER FillBuffer;
1050 } BL_INPUT_CONSOLE_VTABLE, *PBL_INPUT_CONSOLE_VTABLE;
1051
1052 typedef struct _BL_INPUT_CONSOLE
1053 {
1054 PBL_INPUT_CONSOLE_VTABLE Callbacks;
1055 PULONG Buffer;
1056 PULONG DataStart;
1057 PULONG DataEnd;
1058 PULONG EndBuffer;
1059 } BL_INPUT_CONSOLE, *PBL_INPUT_CONSOLE;
1060
1061 typedef enum _BL_GRAPHICS_CONSOLE_TYPE
1062 {
1063 BlGopConsole,
1064 BlUgaConsole
1065 } BL_GRAPHICS_CONSOLE_TYPE;
1066
1067 typedef struct _BL_GRAPHICS_CONSOLE
1068 {
1069 BL_TEXT_CONSOLE TextConsole;
1070 BL_DISPLAY_MODE DisplayMode;
1071 ULONG PixelDepth;
1072 ULONG FgColor;
1073 ULONG BgColor;
1074 BL_DISPLAY_MODE OldDisplayMode;
1075 ULONG OldPixelDepth;
1076 EFI_HANDLE Handle;
1077 BL_GRAPHICS_CONSOLE_TYPE Type;
1078 EFI_GRAPHICS_OUTPUT_PROTOCOL* Protocol;
1079 PVOID FrameBuffer;
1080 ULONG FrameBufferSize;
1081 ULONG PixelsPerScanLine;
1082 ULONG Mode;
1083 ULONG OldMode;
1084 } BL_GRAPHICS_CONSOLE, *PBL_GRAPHICS_CONSOLE;
1085
1086 typedef struct _BL_REMOTE_CONSOLE
1087 {
1088 BL_TEXT_CONSOLE TextConsole;
1089 } BL_REMOTE_CONSOLE, *PBL_REMOTE_CONSOLE;
1090
1091 typedef struct _BL_HASH_TABLE
1092 {
1093 PLIST_ENTRY HashLinks;
1094 ULONG Size;
1095 PBL_HASH_TABLE_COMPARE_FUNCTION CompareFunction;
1096 PBL_HASH_TABLE_HASH_FUNCTION HashFunction;
1097 } BL_HASH_TABLE, *PBL_HASH_TABLE;
1098
1099 typedef struct _BL_HASH_ENTRY
1100 {
1101 ULONG Size;
1102 ULONG Flags;
1103 PVOID Value;
1104 } BL_HASH_ENTRY, *PBL_HASH_ENTRY;
1105
1106 typedef struct _BL_HASH_VALUE
1107 {
1108 ULONG DataSize;
1109 PVOID Data;
1110 } BL_HASH_VALUE, *PBL_HASH_VALUE;
1111
1112 typedef struct _BL_HASH_NODE
1113 {
1114 LIST_ENTRY ListEntry;
1115 BL_HASH_ENTRY Entry;
1116 BL_HASH_VALUE Value;
1117 } BL_HASH_NODE, *PBL_HASH_NODE;
1118
1119 typedef struct _BL_BLOCK_DEVICE_INFORMATION
1120 {
1121 BL_LOCAL_DEVICE_TYPE Type;
1122 ULONG DeviceFlags;
1123 ULONG Unknown;
1124 BL_PARTITION_TYPE PartitionType;
1125 ULONG BlockSize;
1126 ULONG Alignment;
1127 ULONGLONG LastBlock;
1128 ULONGLONG Offset;
1129 ULONG Block;
1130 struct
1131 {
1132 union
1133 {
1134 struct
1135 {
1136 ULONG Signature;
1137 } Mbr;
1138 struct
1139 {
1140 GUID Signature;
1141 } Gpt;
1142 };
1143 } Disk;
1144 } BL_BLOCK_DEVICE_INFORMATION, *PBL_BLOCK_DEVICE_INFORMATION;
1145
1146 typedef struct _BL_DEVICE_INFORMATION
1147 {
1148 BL_DEVICE_TYPE DeviceType;
1149 union
1150 {
1151 BL_BLOCK_DEVICE_INFORMATION BlockDeviceInfo;
1152 };
1153 } BL_DEVICE_INFORMATION, *PBL_DEVICE_INFORMATION;
1154
1155 typedef struct _BL_BLOCK_DEVICE
1156 {
1157 BL_BLOCK_DEVICE_INFORMATION;
1158 ULONGLONG StartOffset;
1159 EFI_BLOCK_IO* Protocol;
1160 EFI_HANDLE Handle;
1161 } BL_BLOCK_DEVICE, *PBL_BLOCK_DEVICE;
1162
1163 typedef struct _BL_PROTOCOL_HANDLE
1164 {
1165 EFI_HANDLE Handle;
1166 PVOID Interface;
1167 } BL_PROTOCOL_HANDLE, *PBL_PROTOCOL_HANDLE;
1168
1169 typedef struct _BL_DEVICE_CALLBACKS
1170 {
1171 PBL_DEVICE_ENUMERATE_DEVICE_CLASS EnumerateDeviceClass;
1172 PBL_DEVICE_OPEN Open;
1173 PBL_DEVICE_CLOSE Close;
1174 PBL_DEVICE_READ Read;
1175 PBL_DEVICE_WRITE Write;
1176 PBL_DEVICE_GET_INFORMATION GetInformation;
1177 PBL_DEVICE_SET_INFORMATION SetInformation;
1178 PBL_DEVICE_RESET Reset;
1179 PBL_DEVICE_FLUSH Flush;
1180 PBL_DEVICE_CREATE Create;
1181 } BL_DEVICE_CALLBACKS, *PBL_DEVICE_CALLBACKS;
1182
1183 typedef struct _BL_DEVICE_ENTRY
1184 {
1185 ULONG DeviceId;
1186 ULONG Flags;
1187 ULONG Unknown;
1188 ULONG ReferenceCount;
1189 BL_DEVICE_CALLBACKS Callbacks;
1190 PVOID DeviceSpecificData;
1191 PBL_DEVICE_DESCRIPTOR DeviceDescriptor;
1192 } BL_DEVICE_ENTRY, *PBL_DEVICE_ENTRY;
1193
1194 typedef struct _BL_IMG_FILE
1195 {
1196 UCHAR Flags;
1197 union
1198 {
1199 PVOID BaseAddress;
1200 ULONG FileId;
1201 };
1202 ULONG FileSize;
1203 PWCHAR FileName;
1204 } BL_IMG_FILE, *PBL_IMG_FILE;
1205
1206 typedef struct _BL_IMAGE_APPLICATION_ENTRY
1207 {
1208 PBL_APPLICATION_ENTRY AppEntry;
1209 PVOID ImageBase;
1210 ULONG ImageSize;
1211 } BL_IMAGE_APPLICATION_ENTRY, *PBL_IMAGE_APPLICATION_ENTRY;
1212
1213 typedef struct _BL_IMAGE_PARAMETERS
1214 {
1215 PVOID Buffer;
1216 ULONG ActualSize;
1217 ULONG BufferSize;
1218 } BL_IMAGE_PARAMETERS, *PBL_IMAGE_PARAMETERS;
1219
1220 typedef struct _BL_DEFERRED_FONT_FILE
1221 {
1222 LIST_ENTRY ListEntry;
1223 ULONG Flags;
1224 PBL_DEVICE_DESCRIPTOR Device;
1225 PWCHAR FontPath;
1226 } BL_DEFERRED_FONT_FILE, *PBL_DEFERRED_FONT_FILE;
1227
1228 #pragma pack(push)
1229 #pragma pack(1)
1230 typedef struct _BMP_HEADER
1231 {
1232 USHORT Signature;
1233 ULONG Size;
1234 USHORT Reserved[2];
1235 ULONG Offset;
1236 } BMP_HEADER, *PBMP_HEADER;
1237
1238 typedef struct _DIB_HEADER
1239 {
1240 ULONG Size;
1241 ULONG Width;
1242 ULONG Height;
1243 USHORT Planes;
1244 USHORT BitCount;
1245 ULONG Compression;
1246 ULONG SizeImage;
1247 ULONG XPelsPerMeter;
1248 ULONG YPelsPerMEter;
1249 ULONG ClrUsed;
1250 ULONG ClrImportant;
1251 } DIB_HEADER, *PDIB_HEADER;
1252
1253 typedef struct _BITMAP
1254 {
1255 BMP_HEADER BmpHeader;
1256 DIB_HEADER DibHeader;
1257 } BITMAP, *PBITMAP;
1258 #pragma pack(pop)
1259
1260 typedef struct _COORD
1261 {
1262 ULONG X;
1263 ULONG Y;
1264 } COORD, *PCOORD;
1265
1266 typedef struct _BL_PD_DATA_BLOB
1267 {
1268 PVOID Data;
1269 ULONG DataSize;
1270 ULONG BlobSize;
1271 } BL_PD_DATA_BLOB, *PBL_PD_DATA_BLOB;
1272
1273 /* INLINE ROUTINES ***********************************************************/
1274
1275 FORCEINLINE
1276 VOID
1277 BlSetupDefaultParameters (
1278 _Out_ PBL_LIBRARY_PARAMETERS LibraryParameters
1279 )
1280 {
1281 BL_LIBRARY_PARAMETERS DefaultParameters =
1282 {
1283 0x20,
1284 BlVirtual,
1285 1024,
1286 2 * 1024 * 1024,
1287 0,
1288 NULL,
1289 0,
1290 NULL
1291 };
1292
1293 /* Copy the defaults */
1294 RtlCopyMemory(LibraryParameters, &DefaultParameters, sizeof(*LibraryParameters));
1295 }
1296
1297 FORCEINLINE
1298 VOID
1299 MmMdInitializeListHead (
1300 _In_ PBL_MEMORY_DESCRIPTOR_LIST List
1301 )
1302 {
1303 /* Initialize the list */
1304 InitializeListHead(&List->ListHead);
1305 List->First = &List->ListHead;
1306 List->This = NULL;
1307 List->Type = 0;
1308 }
1309
1310 /* INITIALIZATION ROUTINES ***************************************************/
1311
1312 NTSTATUS
1313 BlInitializeLibrary(
1314 _In_ PBOOT_APPLICATION_PARAMETER_BLOCK BootAppParameters,
1315 _In_ PBL_LIBRARY_PARAMETERS LibraryParameters
1316 );
1317
1318 NTSTATUS
1319 BlpArchInitialize (
1320 _In_ ULONG Phase
1321 );
1322
1323 NTSTATUS
1324 BlpFwInitialize (
1325 _In_ ULONG Phase,
1326 _In_ PBL_FIRMWARE_DESCRIPTOR FirmwareParameters
1327 );
1328
1329 NTSTATUS
1330 BlpMmInitialize (
1331 _In_ PBL_MEMORY_DATA MemoryData,
1332 _In_ BL_TRANSLATION_TYPE TranslationType,
1333 _In_ PBL_LIBRARY_PARAMETERS LibraryParameters
1334 );
1335
1336 NTSTATUS
1337 MmBaInitialize (
1338 VOID
1339 );
1340
1341 NTSTATUS
1342 MmPaInitialize (
1343 _In_ PBL_MEMORY_DATA MemoryData,
1344 _In_ ULONG MinimumPages
1345 );
1346
1347 NTSTATUS
1348 MmArchInitialize (
1349 _In_ ULONG Phase,
1350 _In_ PBL_MEMORY_DATA MemoryData,
1351 _In_ BL_TRANSLATION_TYPE TranslationType,
1352 _In_ BL_TRANSLATION_TYPE LibraryTranslationType
1353 );
1354
1355 NTSTATUS
1356 MmHaInitialize (
1357 _In_ ULONG HeapSize,
1358 _In_ ULONG HeapAttributes
1359 );
1360
1361 VOID
1362 MmMdInitialize (
1363 _In_ ULONG Phase,
1364 _In_ PBL_LIBRARY_PARAMETERS LibraryParameters
1365 );
1366
1367 NTSTATUS
1368 BlpDeviceInitialize (
1369 VOID
1370 );
1371
1372 NTSTATUS
1373 BlpIoInitialize (
1374 VOID
1375 );
1376
1377 NTSTATUS
1378 BlpFileInitialize (
1379 VOID
1380 );
1381
1382 NTSTATUS
1383 BlpDisplayInitialize (
1384 _In_ ULONG Flags
1385 );
1386
1387 NTSTATUS
1388 BlpDisplayReinitialize (
1389 VOID
1390 );
1391
1392 VOID
1393 BlDestroyLibrary (
1394 VOID
1395 );
1396
1397 NTSTATUS
1398 BcInitialize (
1399 VOID
1400 );
1401
1402 /* FIRMWARE ROUTINES *********************************************************/
1403
1404 VOID
1405 EfiPrintf (
1406 _In_ PWCHAR Format,
1407 ...
1408 );
1409
1410 NTSTATUS
1411 BlFwGetParameters(
1412 _In_ PBL_FIRMWARE_DESCRIPTOR Parameters
1413 );
1414
1415 NTSTATUS
1416 BlFwEnumerateDevice (
1417 _In_ PBL_DEVICE_DESCRIPTOR Device
1418 );
1419
1420 NTSTATUS
1421 EfiAllocatePages (
1422 _In_ ULONG Type,
1423 _In_ ULONG Pages,
1424 _Inout_ EFI_PHYSICAL_ADDRESS* Memory
1425 );
1426
1427 NTSTATUS
1428 EfiStall (
1429 _In_ ULONG StallTime
1430 );
1431
1432 NTSTATUS
1433 EfiConInExReset (
1434 VOID
1435 );
1436
1437 NTSTATUS
1438 EfiConInReset (
1439 VOID
1440 );
1441
1442 NTSTATUS
1443 EfiConOutOutputString (
1444 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
1445 _In_ PWCHAR String
1446 );
1447
1448 NTSTATUS
1449 EfiConOutQueryMode (
1450 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
1451 _In_ ULONG Mode,
1452 _In_ UINTN* Columns,
1453 _In_ UINTN* Rows
1454 );
1455
1456 NTSTATUS
1457 EfiConOutSetMode (
1458 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
1459 _In_ ULONG Mode
1460 );
1461
1462 VOID
1463 EfiConOutReadCurrentMode (
1464 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
1465 _Out_ EFI_SIMPLE_TEXT_OUTPUT_MODE* Mode
1466 );
1467
1468 NTSTATUS
1469 EfiConOutSetAttribute (
1470 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
1471 _In_ ULONG Attribute
1472 );
1473
1474 NTSTATUS
1475 EfiConOutSetCursorPosition (
1476 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
1477 _In_ ULONG Column,
1478 _In_ ULONG Row
1479 );
1480
1481 NTSTATUS
1482 EfiConOutEnableCursor (
1483 _In_ SIMPLE_TEXT_OUTPUT_INTERFACE *TextInterface,
1484 _In_ BOOLEAN Visible
1485 );
1486
1487 NTSTATUS
1488 EfiLocateHandleBuffer (
1489 _In_ EFI_LOCATE_SEARCH_TYPE SearchType,
1490 _In_ EFI_GUID *Protocol,
1491 _Inout_ PULONG HandleCount,
1492 _Inout_ EFI_HANDLE** Buffer
1493 );
1494
1495 NTSTATUS
1496 EfiOpenProtocol (
1497 _In_ EFI_HANDLE Handle,
1498 _In_ EFI_GUID *Protocol,
1499 _Out_ PVOID* Interface
1500 );
1501
1502 NTSTATUS
1503 EfiCloseProtocol (
1504 _In_ EFI_HANDLE Handle,
1505 _In_ EFI_GUID *Protocol
1506 );
1507
1508 NTSTATUS
1509 EfiGopGetCurrentMode (
1510 _In_ EFI_GRAPHICS_OUTPUT_PROTOCOL *GopInterface,
1511 _Out_ UINTN* Mode,
1512 _Out_ EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Information
1513 );
1514
1515 NTSTATUS
1516 EfiGopSetMode (
1517 _In_ EFI_GRAPHICS_OUTPUT_PROTOCOL *GopInterface,
1518 _In_ ULONG Mode
1519 );
1520
1521 VOID
1522 EfiGopGetFrameBuffer (
1523 _In_ EFI_GRAPHICS_OUTPUT_PROTOCOL *GopInterface,
1524 _Out_ PHYSICAL_ADDRESS* FrameBuffer,
1525 _Out_ UINTN *FrameBufferSize
1526 );
1527
1528 VOID
1529 EfiResetSystem (
1530 _In_ EFI_RESET_TYPE ResetType
1531 );
1532
1533 EFI_DEVICE_PATH*
1534 EfiGetLeafNode (
1535 _In_ EFI_DEVICE_PATH *DevicePath
1536 );
1537
1538 EFI_DEVICE_PATH *
1539 EfiIsDevicePathParent (
1540 _In_ EFI_DEVICE_PATH *DevicePath1,
1541 _In_ EFI_DEVICE_PATH *DevicePath2
1542 );
1543
1544 NTSTATUS
1545 EfipGetRsdt (
1546 _Out_ PPHYSICAL_ADDRESS FoundRsdt
1547 );
1548
1549 NTSTATUS
1550 EfiFreePages (
1551 _In_ ULONG Pages,
1552 _In_ EFI_PHYSICAL_ADDRESS PhysicalAddress
1553 );
1554
1555 /* PLATFORM TIMER ROUTINES ***************************************************/
1556
1557 NTSTATUS
1558 BlpTimeCalibratePerformanceCounter (
1559 VOID
1560 );
1561
1562 ULONGLONG
1563 BlTimeQueryPerformanceCounter (
1564 _Out_opt_ PLARGE_INTEGER Frequency
1565 );
1566
1567 ULONGLONG
1568 BlArchGetPerformanceCounter (
1569 VOID
1570 );
1571
1572 /* RESOURCE LOCALE INTERNATIONALIZATION ROUTINES *****************************/
1573
1574 NTSTATUS
1575 BlpDisplayRegisterLocale (
1576 _In_ PWCHAR Locale
1577 );
1578
1579 /* FONT ROUTINES *************************************************************/
1580
1581 VOID
1582 BfiFreeDeferredFontFile (
1583 _In_ PBL_DEFERRED_FONT_FILE DeferredFontFile
1584 );
1585
1586 NTSTATUS
1587 BfLoadFontFile (
1588 _In_ PBL_DEVICE_DESCRIPTOR Device,
1589 _In_ PWCHAR FontPath
1590 );
1591
1592 NTSTATUS
1593 BfLoadDeferredFontFiles (
1594 VOID
1595 );
1596
1597 NTSTATUS
1598 BfClearScreen (
1599 _In_ PBL_GRAPHICS_CONSOLE Console
1600 );
1601
1602 NTSTATUS
1603 BfClearToEndOfLine (
1604 _In_ PBL_GRAPHICS_CONSOLE Console
1605 );
1606
1607 /* FILESYSTEM ROUTINES *******************************************************/
1608
1609 NTSTATUS
1610 FatInitialize (
1611 VOID
1612 );
1613
1614 NTSTATUS
1615 FatMount (
1616 _In_ ULONG DeviceId,
1617 _In_ ULONG Unknown,
1618 _Out_ PBL_FILE_ENTRY* FileEntry
1619 );
1620
1621 NTSTATUS
1622 EtfsInitialize (
1623 VOID
1624 );
1625
1626 NTSTATUS
1627 EtfsMount (
1628 _In_ ULONG DeviceId,
1629 _In_ ULONG Unknown,
1630 _Out_ PBL_FILE_ENTRY* FileEntry
1631 );
1632
1633 /* DEBUG ROUTINES ************************************************************/
1634
1635
1636 BOOLEAN
1637 BlBdDebuggerEnabled (
1638 VOID
1639 );
1640
1641 NTSTATUS
1642 BlBdPullRemoteFile (
1643 _In_ PWCHAR FilePath,
1644 _Out_ PVOID BaseAddress,
1645 _Out_ PULONGLONG FileSize
1646 );
1647
1648 VOID
1649 BlStatusPrint (
1650 _In_ PCWCH Format,
1651 ...
1652 );
1653
1654 VOID
1655 BlStatusError (
1656 _In_ ULONG ErrorCode,
1657 _In_ ULONG Parameter1,
1658 _In_ ULONG_PTR Parameter2,
1659 _In_ ULONG_PTR Parameter3,
1660 _In_ ULONG_PTR Parameter4
1661 );
1662
1663 /* UTILITY ROUTINES **********************************************************/
1664
1665 VOID
1666 BlArchCpuId (
1667 _In_ ULONG Function,
1668 _In_ ULONG SubFunction,
1669 _Out_ INT* Result
1670 );
1671
1672 BOOLEAN
1673 BlArchIsCpuIdFunctionSupported (
1674 _In_ ULONG Function
1675 );
1676
1677 VOID
1678 BlUtlUpdateProgress (
1679 _In_ ULONG Percentage,
1680 _Out_opt_ PBOOLEAN Completed
1681 );
1682
1683 NTSTATUS
1684 BlUtlGetAcpiTable (
1685 _Out_ PVOID* TableAddress,
1686 _In_ ULONG Signature
1687 );
1688
1689 NTSTATUS
1690 BlUtlInitialize (
1691 VOID
1692 );
1693
1694 NTSTATUS
1695 BlUtlRegisterProgressRoutine (
1696 VOID
1697 );
1698
1699 ULONG
1700 BlUtlCheckSum (
1701 _In_ ULONG PartialSum,
1702 _In_ PUCHAR Buffer,
1703 _In_ ULONG Length,
1704 _In_ ULONG Flags
1705 );
1706
1707 NTSTATUS
1708 BlGetApplicationBaseAndSize (
1709 _Out_ PVOID* ImageBase,
1710 _Out_ PULONG ImageSize
1711 );
1712
1713 VOID
1714 BlDestroyBootEntry (
1715 _In_ PBL_LOADED_APPLICATION_ENTRY AppEntry
1716 );
1717
1718 NTSTATUS
1719 BlPdQueryData (
1720 _In_ const GUID* DataGuid,
1721 _In_ PVOID Unknown,
1722 _Inout_ PBL_PD_DATA_BLOB DataBlob
1723 );
1724
1725 /* FIRMWARE UTILITY ROUTINES *************************************************/
1726
1727 EFI_STATUS
1728 EfiGetEfiStatusCode(
1729 _In_ NTSTATUS Status
1730 );
1731
1732 NTSTATUS
1733 EfiGetNtStatusCode (
1734 _In_ EFI_STATUS EfiStatus
1735 );
1736
1737 VOID
1738 BlFwReboot (
1739 VOID
1740 );
1741
1742 NTSTATUS
1743 MmFwFreePages (
1744 _In_ ULONG BasePage,
1745 _In_ ULONG PageCount
1746 );
1747
1748 PGUID
1749 BlGetApplicationIdentifier (
1750 VOID
1751 );
1752
1753 NTSTATUS
1754 BlpSecureBootEFIIsEnabled (
1755 VOID
1756 );
1757
1758 NTSTATUS
1759 BlSecureBootIsEnabled (
1760 _Out_ PBOOLEAN SecureBootEnabled
1761 );
1762
1763 NTSTATUS
1764 BlSecureBootCheckForFactoryReset (
1765 VOID
1766 );
1767
1768 /* RESOURCE ROUTINES *********************************************************/
1769
1770 PWCHAR
1771 BlResourceFindMessage (
1772 _In_ ULONG MsgId
1773 );
1774
1775 PWCHAR
1776 BlResourceFindHtml (
1777 VOID
1778 );
1779
1780 NTSTATUS
1781 BlpResourceInitialize (
1782 VOID
1783 );
1784
1785 /* TABLE ROUTINES ************************************************************/
1786
1787 NTSTATUS
1788 BlTblMap (
1789 _In_ PVOID *Table,
1790 _In_ ULONG Count,
1791 _In_ PBL_TBL_MAP_ROUTINE MapCallback
1792 );
1793
1794 PVOID
1795 BlTblFindEntry (
1796 _In_ PVOID *Table,
1797 _In_ ULONG Count,
1798 _Out_ PULONG EntryIndex,
1799 _In_ PBL_TBL_LOOKUP_ROUTINE Callback,
1800 _In_ PVOID Argument1,
1801 _In_ PVOID Argument2,
1802 _In_ PVOID Argument3,
1803 _In_ PVOID Argument4
1804 );
1805
1806 NTSTATUS
1807 BlTblSetEntry (
1808 _Inout_ PVOID** Table,
1809 _Inout_ PULONG Count,
1810 _In_ PVOID Entry,
1811 _Out_ PULONG EntryIndex,
1812 _In_ PBL_TBL_SET_ROUTINE Callback
1813 );
1814
1815 NTSTATUS
1816 TblDoNotPurgeEntry (
1817 _In_ PVOID Entry
1818 );
1819
1820 /* HASH TABLE ROUTINES *******************************************************/
1821
1822 NTSTATUS
1823 BlHtStore (
1824 _In_ ULONG TableId,
1825 _In_ PBL_HASH_ENTRY Entry,
1826 _In_ PVOID Data,
1827 _In_ ULONG DataSize
1828 );
1829
1830 NTSTATUS
1831 BlHtDelete (
1832 _In_ ULONG TableId,
1833 _In_ PBL_HASH_ENTRY Entry
1834 );
1835
1836 NTSTATUS
1837 BlHtLookup (
1838 _In_ ULONG TableId,
1839 _In_ PBL_HASH_ENTRY Entry,
1840 _Out_ PBL_HASH_VALUE *Value
1841 );
1842
1843 NTSTATUS
1844 BlHtCreate (
1845 _In_ ULONG Size,
1846 _In_ PBL_HASH_TABLE_HASH_FUNCTION HashFunction,
1847 _In_ PBL_HASH_TABLE_COMPARE_FUNCTION CompareFunction,
1848 _Out_ PULONG Id
1849 );
1850
1851 /* BCD OPTION ROUTINES *******************************************************/
1852
1853 PBL_BCD_OPTION
1854 MiscGetBootOption (
1855 _In_ PBL_BCD_OPTION List,
1856 _In_ ULONG Type
1857 );
1858
1859 ULONG
1860 BlGetBootOptionListSize (
1861 _In_ PBL_BCD_OPTION BcdOption
1862 );
1863
1864 ULONG
1865 BlGetBootOptionSize (
1866 _In_ PBL_BCD_OPTION BcdOption
1867 );
1868
1869 NTSTATUS
1870 BlGetBootOptionString (
1871 _In_ PBL_BCD_OPTION List,
1872 _In_ ULONG Type,
1873 _Out_ PWCHAR* Value
1874 );
1875
1876 NTSTATUS
1877 BlGetBootOptionInteger (
1878 _In_ PBL_BCD_OPTION List,
1879 _In_ ULONG Type,
1880 _Out_ PULONGLONG Value
1881 );
1882
1883 NTSTATUS
1884 BlGetBootOptionBoolean (
1885 _In_ PBL_BCD_OPTION List,
1886 _In_ ULONG Type,
1887 _Out_ PBOOLEAN Value
1888 );
1889
1890 NTSTATUS
1891 BlpGetBootOptionIntegerList (
1892 _In_ PBL_BCD_OPTION List,
1893 _In_ ULONG Type,
1894 _Out_ PULONGLONG* Value,
1895 _Out_ PULONGLONG Count,
1896 _In_ BOOLEAN NoCopy
1897 );
1898
1899 NTSTATUS
1900 BlGetBootOptionDevice (
1901 _In_ PBL_BCD_OPTION List,
1902 _In_ ULONG Type,
1903 _Out_ PBL_DEVICE_DESCRIPTOR* Value,
1904 _In_opt_ PBL_BCD_OPTION* ExtraOptions
1905 );
1906
1907 NTSTATUS
1908 BlGetBootOptionGuid (
1909 _In_ PBL_BCD_OPTION List,
1910 _In_ ULONG Type,
1911 _Out_ PGUID Value
1912 );
1913
1914 NTSTATUS
1915 BlGetBootOptionGuidList (
1916 _In_ PBL_BCD_OPTION List,
1917 _In_ ULONG Type,
1918 _Out_ PGUID *Value,
1919 _In_ PULONG Count
1920 );
1921
1922 NTSTATUS
1923 BlCopyBootOptions (
1924 _In_ PBL_BCD_OPTION OptionList,
1925 _Out_ PBL_BCD_OPTION *CopiedOptions
1926 );
1927
1928 NTSTATUS
1929 BlAppendBootOptionBoolean (
1930 _In_ PBL_LOADED_APPLICATION_ENTRY AppEntry,
1931 _In_ ULONG OptionId
1932 );
1933
1934 NTSTATUS
1935 BlAppendBootOptionInteger (
1936 _In_ PBL_LOADED_APPLICATION_ENTRY AppEntry,
1937 _In_ ULONG OptionId,
1938 _In_ ULONGLONG Value
1939 );
1940
1941 NTSTATUS
1942 BlAppendBootOptionString (
1943 _In_ PBL_LOADED_APPLICATION_ENTRY AppEntry,
1944 _In_ PWCHAR OptionString
1945 );
1946
1947 NTSTATUS
1948 BlAppendBootOptions (
1949 _In_ PBL_LOADED_APPLICATION_ENTRY AppEntry,
1950 _In_ PBL_BCD_OPTION Options
1951 );
1952
1953 VOID
1954 BlRemoveBootOption (
1955 _In_ PBL_BCD_OPTION List,
1956 _In_ ULONG Type
1957 );
1958
1959 NTSTATUS
1960 BlReplaceBootOptions (
1961 _In_ PBL_LOADED_APPLICATION_ENTRY AppEntry,
1962 _In_ PBL_BCD_OPTION NewOptions
1963 );
1964
1965 /* BOOT REGISTRY ROUTINES ****************************************************/
1966
1967 VOID
1968 BiCloseKey (
1969 _In_ HANDLE KeyHandle
1970 );
1971
1972 NTSTATUS
1973 BiOpenKey(
1974 _In_ HANDLE ParentHandle,
1975 _In_ PWCHAR KeyName,
1976 _Out_ PHANDLE Handle
1977 );
1978
1979 NTSTATUS
1980 BiLoadHive (
1981 _In_ PBL_FILE_PATH_DESCRIPTOR FilePath,
1982 _Out_ PHANDLE HiveHandle
1983 );
1984
1985 NTSTATUS
1986 BiGetRegistryValue (
1987 _In_ HANDLE KeyHandle,
1988 _In_ PWCHAR ValueName,
1989 _In_ ULONG Type,
1990 _Out_ PVOID* Buffer,
1991 _Out_ PULONG ValueLength
1992 );
1993
1994 NTSTATUS
1995 BiEnumerateSubKeys (
1996 _In_ HANDLE KeyHandle,
1997 _Out_ PWCHAR** SubKeyList,
1998 _Out_ PULONG SubKeyCount
1999 );
2000
2001 NTSTATUS
2002 BiDeleteKey (
2003 _In_ HANDLE KeyHandle
2004 );
2005
2006 VOID
2007 BiDereferenceHive (
2008 _In_ HANDLE KeyHandle
2009 );
2010
2011 /* CONTEXT ROUTINES **********************************************************/
2012
2013 VOID
2014 BlpArchSwitchContext (
2015 _In_ BL_ARCH_MODE NewMode
2016 );
2017
2018 VOID
2019 BlpArchEnableTranslation (
2020 VOID
2021 );
2022
2023 VOID
2024 Archx86TransferTo32BitApplicationAsm (
2025 VOID
2026 );
2027
2028 /* MEMORY DESCRIPTOR ROUTINES ************************************************/
2029
2030 VOID
2031 MmMdDbgDumpList (
2032 _In_ PBL_MEMORY_DESCRIPTOR_LIST DescriptorList,
2033 _In_opt_ ULONG MaxCount
2034 );
2035
2036 VOID
2037 MmMdInitializeList (
2038 _In_ PBL_MEMORY_DESCRIPTOR_LIST DescriptorList,
2039 _In_ ULONG Type,
2040 _In_ PLIST_ENTRY ListHead
2041 );
2042
2043 PBL_MEMORY_DESCRIPTOR
2044 MmMdFindDescriptor (
2045 _In_ ULONG WhichList,
2046 _In_ ULONG Flags,
2047 _In_ ULONGLONG Page
2048 );
2049
2050 PBL_MEMORY_DESCRIPTOR
2051 MmMdFindDescriptorFromMdl (
2052 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
2053 _In_ ULONG Flags,
2054 _In_ ULONGLONG Page
2055 );
2056
2057 NTSTATUS
2058 MmMdCopyList (
2059 _In_ PBL_MEMORY_DESCRIPTOR_LIST DestinationList,
2060 _In_ PBL_MEMORY_DESCRIPTOR_LIST SourceList,
2061 _In_opt_ PBL_MEMORY_DESCRIPTOR ListDescriptor,
2062 _Out_ PULONG ActualCount,
2063 _In_ ULONG Count,
2064 _In_ ULONG Flags
2065 );
2066
2067 ULONG
2068 MmMdCountList (
2069 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList
2070 );
2071
2072 VOID
2073 MmMdFreeList(
2074 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList
2075 );
2076
2077 PBL_MEMORY_DESCRIPTOR
2078 MmMdInitByteGranularDescriptor (
2079 _In_ ULONG Flags,
2080 _In_ BL_MEMORY_TYPE Type,
2081 _In_ ULONGLONG BasePage,
2082 _In_ ULONGLONG VirtualPage,
2083 _In_ ULONGLONG PageCount
2084 );
2085
2086 VOID
2087 MmMdFreeGlobalDescriptors (
2088 VOID
2089 );
2090
2091 NTSTATUS
2092 MmMdAddDescriptorToList (
2093 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
2094 _In_ PBL_MEMORY_DESCRIPTOR MemoryDescriptor,
2095 _In_ ULONG Flags
2096 );
2097
2098 NTSTATUS
2099 MmMdTruncateDescriptors (
2100 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
2101 _In_ PBL_MEMORY_DESCRIPTOR_LIST NewList,
2102 _In_ ULONGLONG BasePage
2103 );
2104
2105 VOID
2106 MmMdRemoveDescriptorFromList (
2107 _In_ PBL_MEMORY_DESCRIPTOR_LIST MdList,
2108 _In_ PBL_MEMORY_DESCRIPTOR Entry
2109 );
2110
2111 BOOLEAN
2112 MmMdFindSatisfyingRegion (
2113 _In_ PBL_MEMORY_DESCRIPTOR Descriptor,
2114 _Out_ PBL_MEMORY_DESCRIPTOR NewDescriptor,
2115 _In_ ULONGLONG Pages,
2116 _In_ PBL_ADDRESS_RANGE BaseRange,
2117 _In_ PBL_ADDRESS_RANGE VirtualRange,
2118 _In_ BOOLEAN TopDown,
2119 _In_ BL_MEMORY_TYPE MemoryType,
2120 _In_ ULONG Flags,
2121 _In_ ULONG Alignment
2122 );
2123
2124 NTSTATUS
2125 MmMdRemoveRegionFromMdlEx (
2126 __in PBL_MEMORY_DESCRIPTOR_LIST MdList,
2127 __in ULONG Flags,
2128 __in ULONGLONG BasePage,
2129 __in ULONGLONG PageCount,
2130 __in PBL_MEMORY_DESCRIPTOR_LIST NewMdList
2131 );
2132
2133 NTSTATUS
2134 MmMdFreeDescriptor (
2135 _In_ PBL_MEMORY_DESCRIPTOR MemoryDescriptor
2136 );
2137
2138 /* PAGE ALLOCATOR ROUTINES ***************************************************/
2139
2140 NTSTATUS
2141 MmPaTruncateMemory (
2142 _In_ ULONGLONG BasePage
2143 );
2144
2145 NTSTATUS
2146 BlMmAllocatePhysicalPages(
2147 _Inout_ PPHYSICAL_ADDRESS Address,
2148 _In_ BL_MEMORY_TYPE MemoryType,
2149 _In_ ULONGLONG PageCount,
2150 _In_ ULONG Attributes,
2151 _In_ ULONG Alignment
2152 );
2153
2154 NTSTATUS
2155 MmPapAllocatePhysicalPagesInRange (
2156 _Inout_ PPHYSICAL_ADDRESS BaseAddress,
2157 _In_ BL_MEMORY_TYPE MemoryType,
2158 _In_ ULONGLONG Pages,
2159 _In_ ULONG Attributes,
2160 _In_ ULONG Alignment,
2161 _In_ PBL_MEMORY_DESCRIPTOR_LIST NewList,
2162 _In_opt_ PBL_ADDRESS_RANGE Range,
2163 _In_ ULONG RangeType
2164 );
2165
2166 NTSTATUS
2167 MmPaReleaseSelfMapPages (
2168 _In_ PHYSICAL_ADDRESS Address
2169 );
2170
2171 NTSTATUS
2172 MmPaReserveSelfMapPages (
2173 _Inout_ PPHYSICAL_ADDRESS PhysicalAddress,
2174 _In_ ULONG Alignment,
2175 _In_ ULONG PageCount
2176 );
2177 NTSTATUS
2178 BlMmFreePhysicalPages (
2179 _In_ PHYSICAL_ADDRESS Address
2180 );
2181
2182 NTSTATUS
2183 MmPapFreePages (
2184 _In_ PVOID Address,
2185 _In_ ULONG WhichList
2186 );
2187
2188 NTSTATUS
2189 MmPapAllocatePagesInRange (
2190 _Inout_ PVOID* PhysicalAddress,
2191 _In_ BL_MEMORY_TYPE MemoryType,
2192 _In_ ULONGLONG Pages,
2193 _In_ ULONG Attributes,
2194 _In_ ULONG Alignment,
2195 _In_opt_ PBL_ADDRESS_RANGE Range,
2196 _In_ ULONG Type
2197 );
2198
2199 NTSTATUS
2200 MmFwGetMemoryMap (
2201 _Out_ PBL_MEMORY_DESCRIPTOR_LIST MemoryMap,
2202 _In_ ULONG Flags
2203 );
2204
2205 NTSTATUS
2206 BlpMmInitializeConstraints (
2207 VOID
2208 );
2209
2210 NTSTATUS
2211 BlMmRemoveBadMemory (
2212 VOID
2213 );
2214
2215 NTSTATUS
2216 BlMmGetMemoryMap (
2217 _In_ PLIST_ENTRY MemoryMap,
2218 _In_ PBL_IMAGE_PARAMETERS MemoryParameters,
2219 _In_ ULONG WhichTypes,
2220 _In_ ULONG Flags
2221 );
2222
2223 /* VIRTUAL MEMORY ROUTINES ***************************************************/
2224
2225 NTSTATUS
2226 MmSelectMappingAddress (
2227 _Out_ PVOID* MappingAddress,
2228 _In_ PVOID PreferredAddress,
2229 _In_ ULONGLONG Size,
2230 _In_ ULONG AllocationAttributes,
2231 _In_ ULONG Flags,
2232 _In_ PHYSICAL_ADDRESS PhysicalAddress
2233 );
2234
2235 NTSTATUS
2236 MmMapPhysicalAddress (
2237 _Inout_ PPHYSICAL_ADDRESS PhysicalAddress,
2238 _Out_ PVOID* VirtualAddress,
2239 _Inout_ PULONGLONG Size,
2240 _In_ ULONG CacheAttributes
2241 );
2242
2243 NTSTATUS
2244 MmUnmapVirtualAddress (
2245 _Inout_ PVOID* VirtualAddress,
2246 _Inout_ PULONGLONG Size
2247 );
2248
2249 NTSTATUS
2250 BlMmMapPhysicalAddressEx (
2251 _In_ PVOID* VirtualAddress,
2252 _In_ ULONG Attributes,
2253 _In_ ULONGLONG Size,
2254 _In_ PHYSICAL_ADDRESS PhysicalAddress
2255 );
2256
2257 NTSTATUS
2258 BlMmUnmapVirtualAddressEx (
2259 _In_ PVOID VirtualAddress,
2260 _In_ ULONGLONG Size
2261 );
2262
2263 BOOLEAN
2264 BlMmTranslateVirtualAddress (
2265 _In_ PVOID VirtualAddress,
2266 _Out_ PPHYSICAL_ADDRESS PhysicalAddress
2267 );
2268
2269 BOOLEAN
2270 MmArchTranslateVirtualAddress (
2271 _In_ PVOID VirtualAddress,
2272 _Out_opt_ PPHYSICAL_ADDRESS PhysicalAddress,
2273 _Out_opt_ PULONG CachingFlags
2274 );
2275
2276 /* BLOCK ALLOCATOR ROUTINES **************************************************/
2277
2278 NTSTATUS
2279 BlpMmCreateBlockAllocator (
2280 VOID
2281 );
2282
2283 /* HEAP ALLOCATOR ROUTINES ***************************************************/
2284
2285 PVOID
2286 BlMmAllocateHeap (
2287 _In_ ULONG Size
2288 );
2289
2290 NTSTATUS
2291 BlMmFreeHeap (
2292 _In_ PVOID Buffer
2293 );
2294
2295 /* DISPLAY ROUTINES **********************************************************/
2296
2297 VOID
2298 BlDisplayGetTextCellResolution (
2299 _Out_ PULONG TextWidth,
2300 _Out_ PULONG TextHeight
2301 );
2302
2303 NTSTATUS
2304 BlDisplaySetScreenResolution (
2305 VOID
2306 );
2307
2308 NTSTATUS
2309 BlDisplayGetScreenResolution (
2310 _Out_ PULONG HRes,
2311 _Out_ PULONG Vres
2312 );
2313
2314 VOID
2315 BlDisplayInvalidateOemBitmap (
2316 VOID
2317 );
2318
2319 PBITMAP
2320 BlDisplayGetOemBitmap (
2321 _Out_ PCOORD Offset,
2322 _Out_opt_ PULONG Flags
2323 );
2324
2325 BOOLEAN
2326 BlDisplayValidOemBitmap (
2327 VOID
2328 );
2329
2330 NTSTATUS
2331 BlDisplayClearScreen (
2332 VOID
2333 );
2334
2335 NTSTATUS
2336 BlDisplaySetCursorType (
2337 _In_ ULONG Type
2338 );
2339
2340 /* I/O ROUTINES **************************************************************/
2341
2342 NTSTATUS
2343 BlpIoRegisterDestroyRoutine (
2344 _In_ PBL_IO_DESTROY_ROUTINE DestroyRoutine
2345 );
2346
2347 NTSTATUS
2348 BlDeviceClose (
2349 _In_ ULONG DeviceId
2350 );
2351
2352 NTSTATUS
2353 BlpDeviceOpen (
2354 _In_ PBL_DEVICE_DESCRIPTOR Device,
2355 _In_ ULONG Flags,
2356 _In_ ULONG Unknown,
2357 _Out_ PULONG DeviceId
2358 );
2359
2360 NTSTATUS
2361 BlDeviceGetInformation (
2362 _In_ ULONG DeviceId,
2363 _Out_ PBL_DEVICE_INFORMATION DeviceInformation
2364 );
2365
2366 NTSTATUS
2367 BlDeviceSetInformation (
2368 _In_ ULONG DeviceId,
2369 _In_ PBL_DEVICE_INFORMATION DeviceInformation
2370 );
2371
2372 NTSTATUS
2373 BlDeviceReadAtOffset (
2374 _In_ ULONG DeviceId,
2375 _In_ ULONG Size,
2376 _In_ ULONGLONG Offset,
2377 _In_ PVOID Buffer,
2378 _Out_ PULONG BytesRead
2379 );
2380
2381 /* IMAGE ROUTINES ************************************************************/
2382
2383 NTSTATUS
2384 BlImgLoadImageWithProgress2 (
2385 _In_ ULONG DeviceId,
2386 _In_ BL_MEMORY_TYPE MemoryType,
2387 _In_ PWCHAR FileName,
2388 _Inout_ PVOID* MappedBase,
2389 _Inout_ PULONG MappedSize,
2390 _In_ ULONG ImageFlags,
2391 _In_ BOOLEAN ShowProgress,
2392 _Out_opt_ PUCHAR* HashBuffer,
2393 _Out_opt_ PULONG HashSize
2394 );
2395
2396 PIMAGE_SECTION_HEADER
2397 BlImgFindSection (
2398 _In_ PVOID ImageBase,
2399 _In_ ULONG ImageSize
2400 );
2401
2402 NTSTATUS
2403 BlImgLoadBootApplication (
2404 _In_ PBL_LOADED_APPLICATION_ENTRY BootEntry,
2405 _Out_ PULONG AppHandle
2406 );
2407
2408 NTSTATUS
2409 BlImgStartBootApplication (
2410 _In_ ULONG AppHandle,
2411 _Inout_ PBL_RETURN_ARGUMENTS ReturnArguments
2412 );
2413
2414 NTSTATUS
2415 BlImgUnloadBootApplication (
2416 _In_ ULONG AppHandle
2417 );
2418
2419 VOID
2420 BlImgQueryCodeIntegrityBootOptions (
2421 _In_ PBL_LOADED_APPLICATION_ENTRY ApplicationEntry,
2422 _Out_ PBOOLEAN IntegrityChecksDisabled,
2423 _Out_ PBOOLEAN TestSigning
2424 );
2425
2426 /* FILE I/O ROUTINES *********************************************************/
2427
2428 NTSTATUS
2429 BlFileClose (
2430 _In_ ULONG FileId
2431 );
2432
2433 NTSTATUS
2434 BlFileReadAtOffsetEx (
2435 _In_ ULONG FileId,
2436 _In_ ULONG Size,
2437 _In_ ULONGLONG ByteOffset,
2438 _In_ PVOID Buffer,
2439 _Out_ PULONG BytesReturned,
2440 _In_ ULONG Flags
2441 );
2442
2443 NTSTATUS
2444 BlFileGetInformation (
2445 _In_ ULONG FileId,
2446 _In_ PBL_FILE_INFORMATION FileInfo
2447 );
2448
2449 NTSTATUS
2450 BlFileOpen (
2451 _In_ ULONG DeviceId,
2452 _In_ PWCHAR FileName,
2453 _In_ ULONG Flags,
2454 _Out_ PULONG FileId
2455 );
2456
2457 /* BLOCK I/O ROUTINES *******************************************************/
2458
2459 NTSTATUS
2460 BlockIoEfiCompareDevice (
2461 _In_ PBL_DEVICE_DESCRIPTOR Device,
2462 _In_ EFI_HANDLE Handle
2463 );
2464
2465 /* INPUT CONSOLE ROUTINES ****************************************************/
2466
2467 VOID
2468 ConsoleInputLocalDestruct (
2469 _In_ struct _BL_INPUT_CONSOLE* Console
2470 );
2471
2472 NTSTATUS
2473 ConsoleInputBaseReinitialize (
2474 _In_ struct _BL_INPUT_CONSOLE* Console
2475 );
2476
2477 NTSTATUS
2478 ConsoleCreateLocalInputCnsole (
2479 VOID
2480 );
2481
2482 /* TEXT CONSOLE ROUTINES *****************************************************/
2483
2484 VOID
2485 ConsoleGraphicalDestruct (
2486 _In_ struct _BL_GRAPHICS_CONSOLE* Console
2487 );
2488
2489 NTSTATUS
2490 ConsoleGraphicalClearText (
2491 _In_ PBL_GRAPHICS_CONSOLE Console,
2492 _In_ BOOLEAN LineOnly
2493 );
2494
2495 NTSTATUS
2496 ConsoleGraphicalClearPixels (
2497 _In_ PBL_GRAPHICS_CONSOLE Console,
2498 _In_ ULONG Color
2499 );
2500
2501 NTSTATUS
2502 ConsoleGraphicalReinitialize (
2503 _In_ struct _BL_GRAPHICS_CONSOLE* Console
2504 );
2505
2506 NTSTATUS
2507 ConsoleGraphicalSetTextState (
2508 _In_ PBL_GRAPHICS_CONSOLE Console,
2509 _In_ ULONG Mask,
2510 _In_ PBL_DISPLAY_STATE TextState
2511 );
2512
2513 BOOLEAN
2514 ConsoleGraphicalIsEnabled (
2515 _In_ struct _BL_GRAPHICS_CONSOLE* Console
2516 );
2517
2518 NTSTATUS
2519 ConsoleGraphicalGetGraphicalResolution (
2520 _In_ struct _BL_GRAPHICS_CONSOLE* Console,
2521 _In_ PBL_DISPLAY_MODE DisplayMode
2522 );
2523
2524 NTSTATUS
2525 ConsoleGraphicalGetOriginalResolution (
2526 _In_ struct _BL_GRAPHICS_CONSOLE* Console,
2527 _In_ PBL_DISPLAY_MODE DisplayMode
2528 );
2529
2530 NTSTATUS
2531 ConsoleGraphicalEnable (
2532 _In_ struct _BL_GRAPHICS_CONSOLE* Console,
2533 _In_ BOOLEAN Enable
2534 );
2535
2536 VOID
2537 ConsoleTextLocalDestruct (
2538 _In_ struct _BL_TEXT_CONSOLE* Console
2539 );
2540
2541 NTSTATUS
2542 ConsoleTextLocalReinitialize (
2543 _In_ struct _BL_TEXT_CONSOLE* Console
2544 );
2545
2546 NTSTATUS
2547 ConsoleTextBaseGetTextState (
2548 _In_ struct _BL_TEXT_CONSOLE* Console,
2549 _Out_ PBL_DISPLAY_STATE TextState
2550 );
2551
2552 NTSTATUS
2553 ConsoleTextLocalSetTextState (
2554 _In_ struct _BL_TEXT_CONSOLE* Console,
2555 _In_ ULONG Flags,
2556 _In_ PBL_DISPLAY_STATE TextState
2557 );
2558
2559 NTSTATUS
2560 ConsoleTextBaseGetTextResolution (
2561 _In_ struct _BL_TEXT_CONSOLE* Console,
2562 _Out_ PULONG TextResolution
2563 );
2564
2565 NTSTATUS
2566 ConsoleTextLocalSetTextResolution (
2567 _In_ struct _BL_TEXT_CONSOLE* Console,
2568 _In_ ULONG NewTextResolution,
2569 _Out_ PULONG OldTextResolution
2570 );
2571
2572 NTSTATUS
2573 ConsoleTextLocalClearText (
2574 _In_ struct _BL_TEXT_CONSOLE* Console,
2575 _In_ BOOLEAN LineOnly
2576 );
2577
2578 NTSTATUS
2579 ConsoleTextLocalWriteText (
2580 _In_ struct _BL_TEXT_CONSOLE* Console,
2581 _In_ PCHAR Text,
2582 _In_ ULONG Attribute
2583 );
2584
2585 NTSTATUS
2586 ConsoleTextLocalConstruct (
2587 _In_ PBL_TEXT_CONSOLE TextConsole,
2588 _In_ BOOLEAN Activate
2589 );
2590
2591 BOOLEAN
2592 ConsolepFindResolution (
2593 _In_ PBL_DISPLAY_MODE Mode,
2594 _In_ PBL_DISPLAY_MODE List,
2595 _In_ ULONG MaxIndex
2596 );
2597
2598 NTSTATUS
2599 ConsoleFirmwareTextClear (
2600 _In_ PBL_TEXT_CONSOLE Console,
2601 _In_ BOOLEAN LineOnly
2602 );
2603
2604 VOID
2605 ConsoleFirmwareTextClose (
2606 _In_ PBL_TEXT_CONSOLE TextConsole
2607 );
2608
2609 NTSTATUS
2610 ConsoleFirmwareTextOpen (
2611 _In_ PBL_TEXT_CONSOLE TextConsole
2612 );
2613
2614 NTSTATUS
2615 ConsoleFirmwareTextSetState (
2616 _In_ PBL_TEXT_CONSOLE TextConsole,
2617 _In_ UCHAR Mask,
2618 _In_ PBL_DISPLAY_STATE State
2619 );
2620
2621 NTSTATUS
2622 ConsoleGraphicalConstruct (
2623 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2624 );
2625
2626 NTSTATUS
2627 ConsoleCreateRemoteConsole (
2628 _In_ PBL_TEXT_CONSOLE* TextConsole
2629 );
2630
2631 NTSTATUS
2632 ConsoleEfiGraphicalOpenProtocol (
2633 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole,
2634 _In_ BL_GRAPHICS_CONSOLE_TYPE Type
2635 );
2636
2637 VOID
2638 ConsoleFirmwareGraphicalClose (
2639 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2640 );
2641
2642 VOID
2643 ConsoleFirmwareGraphicalDisable (
2644 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2645 );
2646
2647 NTSTATUS
2648 ConsoleFirmwareGraphicalClear (
2649 _In_ PBL_GRAPHICS_CONSOLE Console,
2650 _In_ ULONG Color
2651 );
2652
2653 NTSTATUS
2654 ConsoleFirmwareGraphicalEnable (
2655 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2656 );
2657
2658 NTSTATUS
2659 ConsoleEfiUgaOpen (
2660 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2661 );
2662
2663 VOID
2664 ConsoleEfiUgaClose (
2665 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2666 );
2667
2668 VOID
2669 ConsoleEfiGopClose (
2670 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2671 );
2672
2673 NTSTATUS
2674 ConsoleEfiGopOpen (
2675 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2676 );
2677
2678 NTSTATUS
2679 ConsoleEfiGopEnable (
2680 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole
2681 );
2682
2683 NTSTATUS
2684 ConsoleEfiUgaSetResolution (
2685 _In_ PBL_GRAPHICS_CONSOLE GraphicsConsole,
2686 _In_ PBL_DISPLAY_MODE DisplayMode,
2687 _In_ ULONG DisplayModeCount
2688 );
2689
2690 NTSTATUS
2691 ConsoleCreateLocalInputConsole (
2692 VOID
2693 );
2694
2695 NTSTATUS
2696 ConsoleInputLocalEraseBuffer (
2697 _In_ PBL_INPUT_CONSOLE Console,
2698 _In_opt_ PULONG ValueToFill
2699 );
2700
2701 VOID
2702 ConsolepClearBuffer (
2703 _In_ PUCHAR FrameBuffer,
2704 _In_ ULONG Width,
2705 _In_ PUCHAR FillColor,
2706 _In_ ULONG Height,
2707 _In_ ULONG ScanlineWidth,
2708 _In_ ULONG PixelDepth
2709 );
2710
2711 NTSTATUS
2712 ConsolepConvertColorToPixel (
2713 _In_ BL_COLOR Color,
2714 _Out_ PUCHAR Pixel
2715 );
2716
2717 extern ULONG MmDescriptorCallTreeCount;
2718 extern ULONG BlpApplicationFlags;
2719 extern BL_LIBRARY_PARAMETERS BlpLibraryParameters;
2720 extern BL_TRANSLATION_TYPE MmTranslationType;
2721 extern PBL_ARCH_CONTEXT CurrentExecutionContext;
2722 extern PBL_DEVICE_DESCRIPTOR BlpBootDevice;
2723 extern BL_LOADED_APPLICATION_ENTRY BlpApplicationEntry;
2724 extern EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *EfiConOut;
2725 extern EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *EfiConInEx;
2726 extern EFI_GUID EfiGraphicsOutputProtocol;
2727 extern EFI_GUID EfiUgaDrawProtocol;
2728 extern EFI_GUID EfiLoadedImageProtocol;
2729 extern EFI_GUID EfiDevicePathProtocol;
2730 extern EFI_GUID EfiBlockIoProtocol;
2731 extern EFI_GUID EfiSimpleTextInputExProtocol;
2732 extern EFI_GUID EfiRootAcpiTableGuid;
2733 extern EFI_GUID EfiRootAcpiTable10Guid;
2734 extern EFI_GUID EfiGlobalVariable;
2735 extern ULONG ConsoleGraphicalResolutionListFlags;
2736 extern BL_DISPLAY_MODE ConsoleGraphicalResolutionList[];
2737 extern BL_DISPLAY_MODE ConsoleTextResolutionList[];
2738 extern ULONG ConsoleGraphicalResolutionListSize;
2739 extern PVOID DspRemoteInputConsole;
2740 extern PVOID DspLocalInputConsole;
2741 extern WCHAR BlScratchBuffer[8192];
2742 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlMappedAllocated;
2743 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlMappedUnallocated;
2744 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlFwAllocationTracker;
2745 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlUnmappedAllocated;
2746 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlUnmappedUnallocated;
2747 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlReservedAllocated;
2748 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlBadMemory;
2749 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlTruncatedMemory;
2750 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlPersistentMemory;
2751 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlCompleteBadMemory;
2752 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlFreeVirtual;
2753 extern BL_MEMORY_DESCRIPTOR_LIST MmMdlMappingTrackers;
2754 extern ULONGLONG BlpTimePerformanceFrequency;
2755 extern LIST_ENTRY RegisteredFileSystems;
2756 extern BL_ADDRESS_RANGE MmArchKsegAddressRange;
2757 extern ULONG_PTR MmArchTopOfApplicationAddressSpace;
2758
2759 #endif