-
Notifications
You must be signed in to change notification settings - Fork 2
/
ntbcd.h
2298 lines (2206 loc) · 97.9 KB
/
ntbcd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Boot Configuration Data (BCD) support functions
*
* This file is part of System Informer.
*/
#ifndef _NTBCD_H
#define _NTBCD_H
#ifndef PHNT_INLINE_BCD_GUIDS
// 5189B25C-5558-4BF2-BCA4-289B11BD29E2 // {badmemory}
DEFINE_GUID(GUID_BAD_MEMORY_GROUP, 0x5189B25C, 0x5558, 0x4BF2, 0xBC, 0xA4, 0x28, 0x9B, 0x11, 0xBD, 0x29, 0xE2);
// 6EFB52BF-1766-41DB-A6B3-0EE5EFF72BD7 // {bootloadersettings}
DEFINE_GUID(GUID_BOOT_LOADER_SETTINGS_GROUP, 0x6EFB52BF, 0x1766, 0x41DB, 0xA6, 0xB3, 0x0E, 0xE5, 0xEF, 0xF7, 0x2B, 0xD7);
// FA926493-6F1C-4193-A414-58F0B2456D1E // {current}
DEFINE_GUID(GUID_CURRENT_BOOT_ENTRY, 0xFA926493, 0x6F1C, 0x4193, 0xA4, 0x14, 0x58, 0xF0, 0xB2, 0x45, 0x6D, 0x1E);
// 4636856E-540F-4170-A130-A84776F4C654 // {eventsettings} {dbgsettings}
DEFINE_GUID(GUID_DEBUGGER_SETTINGS_GROUP, 0x4636856E, 0x540F, 0x4170, 0xA1, 0x30, 0xA8, 0x47, 0x76, 0xF4, 0xC6, 0x54);
// 1CAE1EB7-A0DF-4D4D-9851-4860E34EF535 // {default}
DEFINE_GUID(GUID_DEFAULT_BOOT_ENTRY, 0x1CAE1EB7, 0xA0DF, 0x4D4D, 0x98, 0x51, 0x48, 0x60, 0xE3, 0x4E, 0xF5, 0x35);
// 0CE4991B-E6B3-4B16-B23C-5E0D9250E5D9 // {emssettings}
DEFINE_GUID(GUID_EMS_SETTINGS_GROUP, 0x0CE4991B, 0xE6B3, 0x4B16, 0xB2, 0x3C, 0x5E, 0x0D, 0x92, 0x50, 0xE5, 0xD9);
// A5A30FA2-3D06-4E9F-B5F4-A01DF9D1FCBA // {fwbootmgr}
DEFINE_GUID(GUID_FIRMWARE_BOOTMGR, 0xA5A30FA2, 0x3D06, 0x4E9F, 0xB5, 0xF4, 0xA0, 0x1D, 0xF9, 0xD1, 0xFC, 0xBA);
// 7EA2E1AC-2E61-4728-AAA3-896D9D0A9F0E // {globalsettings}
DEFINE_GUID(GUID_GLOBAL_SETTINGS_GROUP, 0x7EA2E1AC, 0x2E61, 0x4728, 0xAA, 0xA3, 0x89, 0x6D, 0x9D, 0x0A, 0x9F, 0x0E);
// 7FF607E0-4395-11DB-B0DE-0800200C9A66 // {hypervisorsettings}
DEFINE_GUID(GUID_HYPERVISOR_SETTINGS_GROUP, 0x7FF607E0, 0x4395, 0x11DB, 0xB0, 0xDE, 0x08, 0x00, 0x20, 0x0C, 0x9A, 0x66);
// 313E8EED-7098-4586-A9BF-309C61F8D449 // {kerneldbgsettings}
DEFINE_GUID(GUID_KERNEL_DEBUGGER_SETTINGS_GROUP, 0x313E8EED, 0x7098, 0x4586, 0xA9, 0xBF, 0x30, 0x9C, 0x61, 0xF8, 0xD4, 0x49);
// 1AFA9C49-16AB-4A5C-4A90-212802DA9460 // {resumeloadersettings}
DEFINE_GUID(GUID_RESUME_LOADER_SETTINGS_GROUP, 0x1AFA9C49, 0x16AB, 0x4A5C, 0x4A, 0x90, 0x21, 0x28, 0x02, 0xDA, 0x94, 0x60);
// 9DEA862C-5CDD-4E70-ACC1-F32B344D4795 // {bootmgr}
DEFINE_GUID(GUID_WINDOWS_BOOTMGR, 0x9DEA862C, 0x5CDD, 0x4E70, 0xAC, 0xC1, 0xF3, 0x2B, 0x34, 0x4D, 0x47, 0x95);
// 466F5A88-0AF2-4F76-9038-095B170DC21C // {ntldr} {legacy}
DEFINE_GUID(GUID_WINDOWS_LEGACY_NTLDR, 0x466F5A88, 0x0AF2, 0x4F76, 0x90, 0x38, 0x09, 0x5B, 0x17, 0x0D, 0xC2, 0x1C);
// B2721D73-1DB4-4C62-BF78-C548A880142D // {memdiag}
DEFINE_GUID(GUID_WINDOWS_MEMORY_TESTER, 0xB2721D73, 0x1DB4, 0x4C62, 0xBF, 0x78, 0xC5, 0x48, 0xA8, 0x80, 0x14, 0x2D);
// B012B84D-C47C-4ED5-B722-C0C42163E569
DEFINE_GUID(GUID_WINDOWS_OS_TARGET_TEMPLATE_EFI, 0xB012B84D, 0xC47C, 0x4ED5, 0xB7, 0x22, 0xC0, 0xC4, 0x21, 0x63, 0xE5, 0x69);
// A1943BBC-EA85-487C-97C7-C9EDE908A38A
DEFINE_GUID(GUID_WINDOWS_OS_TARGET_TEMPLATE_PCAT, 0xA1943BBC, 0xEA85, 0x487C, 0x97, 0xC7, 0xC9, 0xED, 0xE9, 0x08, 0xA3, 0x8A);
// {0C334284-9A41-4DE1-99B3-A7E87E8FF07E}
DEFINE_GUID(GUID_WINDOWS_RESUME_TARGET_TEMPLATE_EFI, 0x0C334284, 0x9A41, 0x4DE1, 0x99, 0xB3, 0xA7, 0xE8, 0x7E, 0x8F, 0xF0, 0x7E);
// {98B02A23-0674-4CE7-BDAD-E0A15A8FF97B}
DEFINE_GUID(GUID_WINDOWS_RESUME_TARGET_TEMPLATE_PCAT, 0x98B02A23, 0x0674, 0x4CE7, 0xBD, 0xAD, 0xE0, 0xA1, 0x5A, 0x8F, 0xF9, 0x7B);
// 7254a080-1510-4e85-ac0f-e7fb3d444736
DEFINE_GUID(GUID_WINDOWS_SETUP_EFI, 0x7254A080, 0x1510, 0x4E85, 0xAC, 0x0F, 0xE7, 0xFB, 0x3D, 0x44, 0x47, 0x36);
// CBD971BF-B7B8-4885-951A-FA03044F5D71
DEFINE_GUID(GUID_WINDOWS_SETUP_PCAT, 0xCBD971BF, 0xB7B8, 0x4885, 0x95, 0x1A, 0xFA, 0x03, 0x04, 0x4F, 0x5D, 0x71);
// AE5534E0-A924-466C-B836-758539A3EE3A // {ramdiskoptions}
DEFINE_GUID(GUID_WINDOWS_SETUP_RAMDISK_OPTIONS, 0xAE5534E0, 0xA924, 0x466C, 0xB8, 0x36, 0x75, 0x85, 0x39, 0xA3, 0xEE, 0x3A);
// {7619dcc9-fafe-11d9-b411-000476eba25f}
DEFINE_GUID(GUID_WINDOWS_SETUP_BOOT_ENTRY, 0x7619dcc9, 0xfafe, 0x11d9, 0xb4, 0x11, 0x00, 0x04, 0x76, 0xeb, 0xa2, 0x5f);
// {a62c8016-ca4e-4687-8032-d666c51a280c}
DEFINE_GUID(GUID_VHD_BOOT_OPTIONS, 0xa62c8016, 0xca4e, 0x4687, 0x80, 0x32, 0xd6, 0x66, 0xc5, 0x1a, 0x28, 0x0c);
// ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
DEFINE_GUID(PARTITION_BASIC_DATA_GUID, 0xebd0a0a2, 0xb9e5, 0x4433, 0x87, 0xc0, 0x68, 0xb6, 0xb7, 0x26, 0x99, 0xc7);
// db97dba9-0840-4bae-97f0-ffb9a327c7e1
DEFINE_GUID(PARTITION_CLUSTER_GUID, 0xdb97dba9, 0x0840, 0x4bae, 0x97, 0xf0, 0xff, 0xb9, 0xa3, 0x27, 0xc7, 0xe1);
// 00000000-0000-0000-0000-000000000000
DEFINE_GUID(PARTITION_ENTRY_UNUSED_GUID, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
// af9b60a0-1431-4f62-bc68-3311714a69ad
DEFINE_GUID(PARTITION_LDM_DATA_GUID, 0xaf9b60a0, 0x1431, 0x4f62, 0xbc, 0x68, 0x33, 0x11, 0x71, 0x4a, 0x69, 0xad);
// 5808c8aa-7e8f-42e0-85d2-e1e90434cfb3
DEFINE_GUID(PARTITION_LDM_METADATA_GUID, 0x5808c8aa, 0x7e8f, 0x42e0, 0x85, 0xd2, 0xe1, 0xe9, 0x04, 0x34, 0xcf, 0xb3);
// de94bba4-06d1-4d40-a16a-bfd50179d6ac
DEFINE_GUID(PARTITION_MSFT_RECOVERY_GUID, 0xde94bba4, 0x06d1, 0x4d40, 0xa1, 0x6a, 0xbf, 0xd5, 0x01, 0x79, 0xd6, 0xac);
// e3c9e316-0b5c-4db8-817d-f92df00215ae
DEFINE_GUID(PARTITION_MSFT_RESERVED_GUID, 0xe3c9e316, 0x0b5c, 0x4db8, 0x81, 0x7d, 0xf9, 0x2d, 0xf0, 0x02, 0x15, 0xae);
// caddebf1-4400-4de8-b103-12117dcf3cc
DEFINE_GUID(PARTITION_MSFT_SNAPSHOT_GUID, 0xcaddebf1, 0x4400, 0x4de8, 0xb1, 0x03, 0x12, 0x11, 0x7d, 0xcf, 0x3c, 0xcf);
// e75caf8f-f680-4cee-afa3-b001e56efc2d
DEFINE_GUID(PARTITION_SPACES_GUID, 0xe75caf8f, 0xf680, 0x4cee, 0xaf, 0xa3, 0xb0, 0x01, 0xe5, 0x6e, 0xfc, 0x2d);
// c12a7328-f81f-11d2-ba4b-00a0c93ec93b
DEFINE_GUID(PARTITION_SYSTEM_GUID, 0xc12a7328, 0xf81f, 0x11d2, 0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b);
#else
NTSYSAPI GUID GUID_BAD_MEMORY_GROUP; // {badmemory}
NTSYSAPI GUID GUID_BOOT_LOADER_SETTINGS_GROUP; // {bootloadersettings}
NTSYSAPI GUID GUID_CURRENT_BOOT_ENTRY; // {current}
NTSYSAPI GUID GUID_DEBUGGER_SETTINGS_GROUP; // {eventsettings} {dbgsettings}
NTSYSAPI GUID GUID_DEFAULT_BOOT_ENTRY; // {default}
NTSYSAPI GUID GUID_EMS_SETTINGS_GROUP; // {emssettings}
NTSYSAPI GUID GUID_FIRMWARE_BOOTMGR; // {fwbootmgr}
NTSYSAPI GUID GUID_GLOBAL_SETTINGS_GROUP; // {globalsettings}
NTSYSAPI GUID GUID_HYPERVISOR_SETTINGS_GROUP; // {hypervisorsettings}
NTSYSAPI GUID GUID_KERNEL_DEBUGGER_SETTINGS_GROUP; // {kerneldbgsettings}
NTSYSAPI GUID GUID_RESUME_LOADER_SETTINGS_GROUP; // {resumeloadersettings}
NTSYSAPI GUID GUID_WINDOWS_BOOTMGR; // {bootmgr}
NTSYSAPI GUID GUID_WINDOWS_LEGACY_NTLDR; // {ntldr} {legacy}
NTSYSAPI GUID GUID_WINDOWS_MEMORY_TESTER; // {memdiag}
NTSYSAPI GUID GUID_WINDOWS_OS_TARGET_TEMPLATE_EFI;
NTSYSAPI GUID GUID_WINDOWS_OS_TARGET_TEMPLATE_PCAT;
NTSYSAPI GUID GUID_WINDOWS_RESUME_TARGET_TEMPLATE_EFI;
NTSYSAPI GUID GUID_WINDOWS_RESUME_TARGET_TEMPLATE_PCAT;
NTSYSAPI GUID GUID_WINDOWS_SETUP_EFI;
NTSYSAPI GUID GUID_WINDOWS_SETUP_PCAT;
NTSYSAPI GUID GUID_WINDOWS_SETUP_RAMDISK_OPTIONS; // {ramdiskoptions}
NTSYSAPI GUID GUID_VHD_BOOT_OPTIONS;
NTSYSAPI GUID PARTITION_BASIC_DATA_GUID;
NTSYSAPI GUID PARTITION_CLUSTER_GUID;
NTSYSAPI GUID PARTITION_ENTRY_UNUSED_GUID;
NTSYSAPI GUID PARTITION_LDM_DATA_GUID;
NTSYSAPI GUID PARTITION_LDM_METADATA_GUID;
NTSYSAPI GUID PARTITION_MSFT_RECOVERY_GUID;
NTSYSAPI GUID PARTITION_MSFT_RESERVED_GUID;
NTSYSAPI GUID PARTITION_MSFT_SNAPSHOT_GUID;
NTSYSAPI GUID PARTITION_SPACES_GUID;
NTSYSAPI GUID PARTITION_SYSTEM_GUID;
#endif
typedef enum _BCD_MESSAGE_TYPE
{
BCD_MESSAGE_TYPE_NONE,
BCD_MESSAGE_TYPE_TRACE,
BCD_MESSAGE_TYPE_INFORMATION,
BCD_MESSAGE_TYPE_WARNING,
BCD_MESSAGE_TYPE_ERROR,
BCD_MESSAGE_TYPE_MAXIMUM
} BCD_MESSAGE_TYPE;
typedef VOID (NTAPI* BCD_MESSAGE_CALLBACK)(
_In_ BCD_MESSAGE_TYPE type,
_In_ PCWSTR Message
);
/**
* Sets the logging level and callback routine for BCD messages.
*
* @param BcdLoggingLevel The logging level to set.
* @param BcdMessageCallbackRoutine The callback routine for BCD messages.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdSetLogging(
_In_ BCD_MESSAGE_TYPE BcdLoggingLevel,
_In_ BCD_MESSAGE_CALLBACK BcdMessageCallbackRoutine
);
/**
* Initializes the BCD synchronization mutant.
*/
NTSYSAPI
VOID
NTAPI
BcdInitializeBcdSyncMutant(
VOID
);
/**
* Retrieves the file name for the BCD.
*
* @param BcdSystemStorePath The pointer to receive the system store path.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdGetSystemStorePath(
_Out_ PWSTR* BcdSystemStorePath // RtlFreeHeap(RtlProcessHeap(), 0, BcdSystemStorePath);
);
/**
* Sets the device for the system BCD store.
*
* @param SystemPartition The system partition to set.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdSetSystemStoreDevice(
_In_ UNICODE_STRING SystemPartition
);
/**
* Opens the BCD system store.
*
* @param BcdStoreHandle The handle to receive the system store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdOpenSystemStore(
_Out_ PHANDLE BcdStoreHandle
);
/**
* Opens a BCD store from a file.
*
* @param BcdFilePath The file path of the BCD store.
* @param BcdStoreHandle The handle to receive the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdOpenStoreFromFile(
_In_ UNICODE_STRING BcdFilePath,
_Out_ PHANDLE BcdStoreHandle
);
/**
* Creates a BCD store.
*
* @param BcdFilePath The file path to create the BCD store.
* @param BcdStoreHandle The handle to receive the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdCreateStore(
_In_ UNICODE_STRING BcdFilePath,
_Out_ PHANDLE BcdStoreHandle
);
/**
* Exports the BCD store to a file.
*
* @param BcdFilePath The file path to export the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdExportStore(
_In_ UNICODE_STRING BcdFilePath
);
#if (PHNT_VERSION > PHNT_WIN11)
/**
* Exports the BCD store to a file with additional flags.
*
* @param BcdStoreHandle The handle to the BCD store.
* @param Flags The flags for exporting the store.
* @param BcdFilePath The file path to export the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdExportStoreEx(
_In_ HANDLE BcdStoreHandle,
_In_ ULONG Flags,
_In_ UNICODE_STRING BcdFilePath
);
#endif
/**
* Imports a BCD store from a file.
*
* @param BcdFilePath The file path to import the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdImportStore(
_In_ UNICODE_STRING BcdFilePath
);
typedef enum _BCD_IMPORT_FLAGS
{
BCD_IMPORT_NONE,
BCD_IMPORT_DELETE_FIRMWARE_OBJECTS
} BCD_IMPORT_FLAGS;
/**
* Imports a BCD store from a file with additional flags.
*
* @param BcdFilePath The file path to import the BCD store.
* @param BcdImportFlags The flags for importing the store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdImportStoreWithFlags(
_In_ UNICODE_STRING BcdFilePath,
_In_ BCD_IMPORT_FLAGS BcdImportFlags
);
/**
* Deletes object references in the BCD store.
*
* @param BcdStoreHandle The handle to the BCD store.
* @param Identifier The identifier of the object to delete references for.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdDeleteObjectReferences(
_In_ HANDLE BcdStoreHandle,
_In_ PGUID Identifier
);
/**
* Deletes the system store for BCD.
*
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdDeleteSystemStore(
VOID
);
typedef enum _BCD_OPEN_FLAGS
{
BCD_OPEN_NONE,
BCD_OPEN_OPEN_STORE_OFFLINE,
BCD_OPEN_SYNC_FIRMWARE_ENTRIES
} BCD_OPEN_FLAGS;
/**
* Opens a BCD store with additional flags.
*
* @param BcdFilePath The file path of the BCD store.
* @param BcdOpenFlags The flags for opening the store.
* @param BcdStoreHandle The handle to receive the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdOpenStore(
_In_ UNICODE_STRING BcdFilePath,
_In_ BCD_OPEN_FLAGS BcdOpenFlags,
_Out_ PHANDLE BcdStoreHandle
);
/**
* Closes a BCD store.
*
* @param BcdStoreHandle The handle to the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdCloseStore(
_In_ HANDLE BcdStoreHandle
);
/**
* Flushes a BCD store.
*
* @param BcdStoreHandle The handle to the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdFlushStore(
_In_ HANDLE BcdStoreHandle
);
/**
* Forcibly unloads a BCD store.
*
* @param BcdStoreHandle The handle to the BCD store.
* @return NTSTATUS Successful or errant status.
*/
NTSYSAPI
NTSTATUS
NTAPI
BcdForciblyUnloadStore(
_In_ HANDLE BcdStoreHandle
);
NTSYSAPI
NTSTATUS
NTAPI
BcdMarkAsSystemStore(
_In_ HANDLE BcdStoreHandle
);
typedef enum _BCD_OBJECT_TYPE
{
BCD_OBJECT_TYPE_NONE,
BCD_OBJECT_TYPE_APPLICATION, // 0x10000000
BCD_OBJECT_TYPE_INHERITED, // 0x20000000
BCD_OBJECT_TYPE_DEVICE, // 0x30000000
} BCD_OBJECT_TYPE;
typedef enum _BCD_APPLICATION_OBJECT_TYPE
{
BCD_APPLICATION_OBJECT_NONE = 0,
BCD_APPLICATION_OBJECT_FIRMWARE_BOOT_MANAGER = 1, // 0x00000001
BCD_APPLICATION_OBJECT_WINDOWS_BOOT_MANAGER = 2, // 0x00000002
BCD_APPLICATION_OBJECT_WINDOWS_BOOT_LOADER = 3, // 0x00000003
BCD_APPLICATION_OBJECT_WINDOWS_RESUME_APPLICATION = 4, // 0x00000004
BCD_APPLICATION_OBJECT_MEMORY_TESTER = 5, // 0x00000005
BCD_APPLICATION_OBJECT_LEGACY_NTLDR = 6, // 0x00000006
BCD_APPLICATION_OBJECT_LEGACY_SETUPLDR = 7, // 0x00000007
BCD_APPLICATION_OBJECT_BOOT_SECTOR = 8, // 0x00000008
BCD_APPLICATION_OBJECT_STARTUP_MODULE = 9, // 0x00000009
BCD_APPLICATION_OBJECT_GENERIC_APPLICATION = 10, // 0x0000000a
BCD_APPLICATION_OBJECT_RESERVED = 0xFFFFF // 0x000fffff
} BCD_APPLICATION_OBJECT_TYPE;
typedef enum _BCD_APPLICATION_IMAGE_TYPE
{
BCD_APPLICATION_IMAGE_NONE,
BCD_APPLICATION_IMAGE_FIRMWARE_APPLICATION, // 0x00100000
BCD_APPLICATION_IMAGE_BOOT_APPLICATION, // 0x00200000
BCD_APPLICATION_IMAGE_LEGACY_LOADER, // 0x00300000
BCD_APPLICATION_IMAGE_REALMODE_CODE, // 0x00400000
} BCD_APPLICATION_IMAGE_TYPE;
typedef enum _BCD_INHERITED_CLASS_TYPE
{
BCD_INHERITED_CLASS_NONE,
BCD_INHERITED_CLASS_LIBRARY,
BCD_INHERITED_CLASS_APPLICATION,
BCD_INHERITED_CLASS_DEVICE
} BCD_INHERITED_CLASS_TYPE;
#define MAKE_BCD_OBJECT(ObjectType, ImageType, ApplicationType) \
(((ULONG)(ObjectType) << 28) | \
(((ULONG)(ImageType) & 0xF) << 20) | \
((ULONG)(ApplicationType) & 0xFFFFF))
#define MAKE_BCD_APPLICATION_OBJECT(ImageType, ApplicationType) \
MAKE_BCD_OBJECT(BCD_OBJECT_TYPE_APPLICATION, (ULONG)(ImageType), (ULONG)(ApplicationType))
#define GET_BCD_OBJECT_TYPE(DataType) \
((BCD_OBJECT_TYPE)(((((ULONG)DataType)) >> 28) & 0xF))
#define GET_BCD_APPLICATION_IMAGE(DataType) \
((BCD_APPLICATION_IMAGE_TYPE)(((((ULONG)DataType)) >> 20) & 0xF))
#define GET_BCD_APPLICATION_OBJECT(DataType) \
((BCD_APPLICATION_OBJECT_TYPE)((((ULONG)DataType)) & 0xFFFFF))
#define BCD_OBJECT_OSLOADER_TYPE \
MAKE_BCD_APPLICATION_OBJECT(BCD_APPLICATION_IMAGE_BOOT_APPLICATION, BCD_APPLICATION_OBJECT_WINDOWS_BOOT_LOADER)
typedef union _BCD_OBJECT_DATATYPE
{
ULONG PackedValue;
union
{
struct
{
ULONG Reserved : 28;
BCD_OBJECT_TYPE ObjectType : 4;
};
struct
{
BCD_APPLICATION_OBJECT_TYPE ApplicationType : 20;
BCD_APPLICATION_IMAGE_TYPE ImageType : 4;
ULONG Reserved : 4;
BCD_OBJECT_TYPE ObjectType : 4;
} Application;
struct
{
ULONG Value : 20;
BCD_INHERITED_CLASS_TYPE Class : 4;
ULONG Reserved : 4;
BCD_OBJECT_TYPE ObjectType : 4;
} Inherit;
struct
{
ULONG Reserved : 28;
BCD_OBJECT_TYPE ObjectType : 4;
} Device;
};
} BCD_OBJECT_DATATYPE, *PBCD_OBJECT_DATATYPE;
static_assert(sizeof(BCD_OBJECT_DATATYPE) == sizeof(ULONG), "sizeof(BCD_OBJECT_DATATYPE) is invalid.");
#define BCD_OBJECT_DESCRIPTION_VERSION 0x1
typedef struct _BCD_OBJECT_DESCRIPTION
{
ULONG Version; // BCD_OBJECT_DESCRIPTION_VERSION
ULONG Type; // BCD_OBJECT_DATATYPE
} BCD_OBJECT_DESCRIPTION, *PBCD_OBJECT_DESCRIPTION;
typedef struct _BCD_OBJECT
{
GUID Identifer;
PBCD_OBJECT_DESCRIPTION Description;
} BCD_OBJECT, *PBCD_OBJECT;
NTSYSAPI
NTSTATUS
NTAPI
BcdEnumerateObjects(
_In_ HANDLE BcdStoreHandle,
_In_ PBCD_OBJECT_DESCRIPTION BcdEnumDescriptor,
_Out_writes_bytes_opt_(*BufferSize) PVOID Buffer, // BCD_OBJECT[]
_Inout_ PULONG BufferSize,
_Out_ PULONG ObjectCount
);
NTSYSAPI
NTSTATUS
NTAPI
BcdOpenObject(
_In_ HANDLE BcdStoreHandle,
_In_ const GUID* Identifier,
_Out_ PHANDLE BcdObjectHandle
);
NTSYSAPI
NTSTATUS
NTAPI
BcdCreateObject(
_In_ HANDLE BcdStoreHandle,
_In_ PGUID Identifier,
_In_ PBCD_OBJECT_DESCRIPTION Description,
_Out_ PHANDLE BcdObjectHandle
);
NTSYSAPI
NTSTATUS
NTAPI
BcdDeleteObject(
_In_ HANDLE BcdObjectHandle
);
NTSYSAPI
NTSTATUS
NTAPI
BcdCloseObject(
_In_ HANDLE BcdObjectHandle
);
typedef enum _BCD_COPY_FLAGS
{
BCD_COPY_NONE = 0x0,
BCD_COPY_COPY_CREATE_NEW_OBJECT_IDENTIFIER = 0x1,
BCD_COPY_COPY_DELETE_EXISTING_OBJECT = 0x2,
BCD_COPY_COPY_UNKNOWN_FIRMWARE_APPLICATION = 0x4,
BCD_COPY_IGNORE_SETUP_TEMPLATE_ELEMENTS = 0x8,
BCD_COPY_RETAIN_ELEMENT_DATA = 0x10,
BCD_COPY_MIGRATE_ELEMENT_DATA = 0x20
} BCD_COPY_FLAGS;
NTSYSAPI
NTSTATUS
NTAPI
BcdCopyObject(
_In_ HANDLE BcdStoreHandle,
_In_ HANDLE BcdObjectHandle,
_In_ BCD_COPY_FLAGS BcdCopyFlags,
_In_ HANDLE TargetStoreHandle,
_Out_ PHANDLE TargetObjectHandle
);
NTSYSAPI
NTSTATUS
NTAPI
BcdCopyObjectEx(
_In_ HANDLE BcdStoreHandle,
_In_ HANDLE BcdObjectHandle,
_In_ BCD_COPY_FLAGS BcdCopyFlags,
_In_ HANDLE TargetStoreHandle,
_In_ PGUID TargetObjectId,
_Out_ PHANDLE TargetObjectHandle
);
NTSYSAPI
NTSTATUS
NTAPI
BcdCopyObjects(
_In_ HANDLE BcdStoreHandle,
_In_ BCD_OBJECT_DESCRIPTION Characteristics,
_In_ BCD_COPY_FLAGS BcdCopyFlags,
_In_ HANDLE TargetStoreHandle
);
NTSYSAPI
NTSTATUS
NTAPI
BcdMigrateObjectElementValues(
_In_ HANDLE TemplateObjectHandle,
_In_ HANDLE SourceObjectHandle,
_In_ HANDLE TargetObjectHandle
);
NTSYSAPI
NTSTATUS
NTAPI
BcdQueryObject(
_In_ HANDLE BcdObjectHandle,
_In_ ULONG BcdVersion, // BCD_OBJECT_DESCRIPTION_VERSION
_Out_ BCD_OBJECT_DESCRIPTION Description,
_Out_ PGUID Identifier
);
typedef enum _BCD_ELEMENT_DATATYPE_FORMAT
{
BCD_ELEMENT_DATATYPE_FORMAT_UNKNOWN,
BCD_ELEMENT_DATATYPE_FORMAT_DEVICE, // 0x01000000
BCD_ELEMENT_DATATYPE_FORMAT_STRING, // 0x02000000
BCD_ELEMENT_DATATYPE_FORMAT_OBJECT, // 0x03000000
BCD_ELEMENT_DATATYPE_FORMAT_OBJECTLIST, // 0x04000000
BCD_ELEMENT_DATATYPE_FORMAT_INTEGER, // 0x05000000
BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, // 0x06000000
BCD_ELEMENT_DATATYPE_FORMAT_INTEGERLIST, // 0x07000000
BCD_ELEMENT_DATATYPE_FORMAT_BINARY // 0x08000000
} BCD_ELEMENT_DATATYPE_FORMAT;
typedef enum _BCD_ELEMENT_DATATYPE_CLASS
{
BCD_ELEMENT_DATATYPE_CLASS_NONE,
BCD_ELEMENT_DATATYPE_CLASS_LIBRARY, // 0x10000000
BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, // 0x20000000
BCD_ELEMENT_DATATYPE_CLASS_DEVICE, // 0x30000000
BCD_ELEMENT_DATATYPE_CLASS_SETUPTEMPLATE, // 0x40000000
BCD_ELEMENT_DATATYPE_CLASS_OEM // 0x50000000
} BCD_ELEMENT_DATATYPE_CLASS;
typedef enum _BCD_ELEMENT_DEVICE_TYPE
{
BCD_ELEMENT_DEVICE_TYPE_NONE,
BCD_ELEMENT_DEVICE_TYPE_BOOT_DEVICE,
BCD_ELEMENT_DEVICE_TYPE_PARTITION,
BCD_ELEMENT_DEVICE_TYPE_FILE,
BCD_ELEMENT_DEVICE_TYPE_RAMDISK,
BCD_ELEMENT_DEVICE_TYPE_UNKNOWN,
BCD_ELEMENT_DEVICE_TYPE_QUALIFIED_PARTITION,
BCD_ELEMENT_DEVICE_TYPE_VMBUS,
BCD_ELEMENT_DEVICE_TYPE_LOCATE_DEVICE,
BCD_ELEMENT_DEVICE_TYPE_URI,
BCD_ELEMENT_DEVICE_TYPE_COMPOSITE
} BCD_ELEMENT_DEVICE_TYPE;
#define MAKE_BCDE_DATA_TYPE(Class, Format, Subtype) \
(((((ULONG)Class) & 0xF) << 28) | ((((ULONG)Format) & 0xF) << 24) | (((ULONG)Subtype) & 0x00FFFFFF))
#define GET_BCDE_DATA_CLASS(DataType) \
((BCD_ELEMENT_DATATYPE_CLASS)(((((ULONG)DataType)) >> 28) & 0xF))
#define GET_BCDE_DATA_FORMAT(DataType) \
((BCD_ELEMENT_DATATYPE_FORMAT)(((((ULONG)DataType)) >> 24) & 0xF))
#define GET_BCDE_DATA_SUBTYPE(DataType) \
((ULONG)((((ULONG)DataType)) & 0x00FFFFFF))
typedef union _BCD_ELEMENT_DATATYPE
{
ULONG PackedValue;
struct
{
ULONG SubType : 24;
BCD_ELEMENT_DATATYPE_FORMAT Format : 4;
BCD_ELEMENT_DATATYPE_CLASS Class : 4;
};
} BCD_ELEMENT_DATATYPE, *PBCD_ELEMENT_DATATYPE;
static_assert(sizeof(BCD_ELEMENT_DATATYPE) == sizeof(ULONG), "sizeof(BCD_ELEMENT_DATATYPE) is invalid.");
NTSYSAPI
NTSTATUS
NTAPI
BcdEnumerateElementTypes(
_In_ HANDLE BcdObjectHandle,
_Out_writes_bytes_opt_(*BufferSize) PVOID Buffer, // BCD_ELEMENT_DATATYPE[]
_Inout_ PULONG BufferSize,
_Out_ PULONG ElementCount
);
typedef struct _BCD_ELEMENT_DEVICE_QUALIFIED_PARTITION
{
ULONG PartitionStyle;
ULONG Reserved;
struct
{
union
{
ULONG DiskSignature;
ULONG64 PartitionOffset;
} Mbr;
union
{
GUID DiskSignature;
GUID PartitionSignature;
} Gpt;
};
} BCD_ELEMENT_DEVICE_QUALIFIED_PARTITION, *PBCD_ELEMENT_DEVICE_QUALIFIED_PARTITION;
typedef struct _BCD_ELEMENT_DEVICE
{
ULONG DeviceType;
GUID AdditionalOptions;
struct
{
union
{
ULONG ParentOffset;
WCHAR Path[ANYSIZE_ARRAY];
} File;
union
{
WCHAR Path[ANYSIZE_ARRAY];
} Partition;
union
{
ULONG Type;
ULONG ParentOffset;
ULONG ElementType;
WCHAR Path[ANYSIZE_ARRAY];
} Locate;
union
{
GUID InterfaceInstance;
} Vmbus;
union
{
ULONG Data[ANYSIZE_ARRAY];
} Unknown;
BCD_ELEMENT_DEVICE_QUALIFIED_PARTITION QualifiedPartition;
};
} BCD_ELEMENT_DEVICE, *PBCD_ELEMENT_DEVICE;
typedef struct _BCD_ELEMENT_STRING
{
WCHAR Value[ANYSIZE_ARRAY];
} BCD_ELEMENT_STRING, *PBCD_ELEMENT_STRING;
typedef struct _BCD_ELEMENT_OBJECT
{
GUID Object;
} BCD_ELEMENT_OBJECT, *PBCD_ELEMENT_OBJECT;
typedef struct _BCD_ELEMENT_OBJECT_LIST
{
GUID ObjectList[ANYSIZE_ARRAY];
} BCD_ELEMENT_OBJECT_LIST, *PBCD_ELEMENT_OBJECT_LIST;
typedef struct _BCD_ELEMENT_INTEGER
{
ULONG64 Value;
} BCD_ELEMENT_INTEGER, *PBCD_ELEMENT_INTEGER;
typedef struct _BCD_ELEMENT_INTEGER_LIST
{
ULONG64 Value[ANYSIZE_ARRAY];
} BCD_ELEMENT_INTEGER_LIST, *PBCD_ELEMENT_INTEGER_LIST;
typedef struct _BCD_ELEMENT_BOOLEAN
{
BOOLEAN Value;
//BOOLEAN Pad; // sym
} BCD_ELEMENT_BOOLEAN, *PBCD_ELEMENT_BOOLEAN;
#define BCD_ELEMENT_DESCRIPTION_VERSION 0x1
typedef struct BCD_ELEMENT_DESCRIPTION
{
ULONG Version; // BCD_ELEMENT_DESCRIPTION_VERSION
ULONG Type;
ULONG DataSize;
} BCD_ELEMENT_DESCRIPTION, *PBCD_ELEMENT_DESCRIPTION;
typedef struct _BCD_ELEMENT
{
PBCD_ELEMENT_DESCRIPTION Description;
PVOID Data;
} BCD_ELEMENT, *PBCD_ELEMENT;
NTSYSAPI
NTSTATUS
NTAPI
BcdEnumerateElements(
_In_ HANDLE BcdObjectHandle,
_Out_writes_bytes_opt_(*BufferSize) PVOID Buffer, // BCD_ELEMENT[]
_Inout_ PULONG BufferSize,
_Out_ PULONG ElementCount
);
typedef enum _BCD_FLAGS
{
BCD_FLAG_NONE = 0x0,
BCD_FLAG_QUALIFIED_PARTITION = 0x1,
BCD_FLAG_NO_DEVICE_TRANSLATION = 0x2,
BCD_FLAG_ENUMERATE_INHERITED_OBJECTS = 0x4,
BCD_FLAG_ENUMERATE_DEVICE_OPTIONS = 0x8,
BCD_FLAG_OBSERVE_PRECEDENCE = 0x10,
BCD_FLAG_DISABLE_VHD_NT_TRANSLATION = 0x20,
BCD_FLAG_DISABLE_VHD_DEVICE_DETECTION = 0x40,
BCD_FLAG_DISABLE_POLICY_CHECKS = 0x80
} BCD_FLAGS;
NTSYSAPI
NTSTATUS
NTAPI
BcdEnumerateElementsWithFlags(
_In_ HANDLE BcdObjectHandle,
_In_ BCD_FLAGS BcdFlags,
_Out_writes_bytes_opt_(*BufferSize) PVOID Buffer, // BCD_ELEMENT[]
_Inout_ PULONG BufferSize,
_Out_ PULONG ElementCount
);
NTSYSAPI
NTSTATUS
NTAPI
BcdEnumerateAndUnpackElements(
_In_ HANDLE BcdStoreHandle,
_In_ HANDLE BcdObjectHandle,
_In_ BCD_FLAGS BcdFlags,
_Out_writes_bytes_opt_(*BufferSize) PVOID Buffer, // BCD_ELEMENT[]
_Inout_ PULONG BufferSize,
_Out_ PULONG ElementCount
);
NTSYSAPI
NTSTATUS
NTAPI
BcdGetElementData(
_In_ HANDLE BcdObjectHandle,
_In_ ULONG BcdElement, // BCD_ELEMENT_DATATYPE
_Out_writes_bytes_opt_(*BufferSize) PVOID Buffer,
_Inout_ PULONG BufferSize
);
NTSYSAPI
NTSTATUS
NTAPI
BcdGetElementDataWithFlags(
_In_ HANDLE BcdObjectHandle,
_In_ ULONG BcdElement, // BCD_ELEMENT_DATATYPE
_In_ BCD_FLAGS BcdFlags,
_Out_writes_bytes_opt_(*BufferSize) PVOID Buffer,
_Inout_ PULONG BufferSize
);
NTSYSAPI
NTSTATUS
NTAPI
BcdSetElementData(
_In_ HANDLE BcdObjectHandle,
_In_ ULONG BcdElement, // BCD_ELEMENT_DATATYPE
_In_reads_bytes_opt_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize
);
NTSYSAPI
NTSTATUS
NTAPI
BcdSetElementDataWithFlags(
_In_ HANDLE BcdObjectHandle,
_In_ ULONG BcdElement, // BCD_ELEMENT_DATATYPE
_In_ BCD_FLAGS BcdFlags,
_In_reads_bytes_opt_(BufferSize) PVOID Buffer,
_In_ ULONG BufferSize
);
NTSYSAPI
NTSTATUS
NTAPI
BcdDeleteElement(
_In_ HANDLE BcdObjectHandle,
_In_ ULONG BcdElement // BCD_ELEMENT_DATATYPE
);
//
// Element types
//
/**
* BCD configuration elements for the Boot Manager types.
*/
typedef enum _BcdBootMgrElementTypes
{
/**
* The order in which BCD objects should be displayed. [0x24000001]
* Objects are displayed using the string specified by the BcdLibraryString_Description element.
*/
BcdBootMgrObjectList_DisplayOrder = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_OBJECTLIST, 1),
/**
* List of boot environment applications the boot manager should execute. [0x24000002]
* The applications are executed in the order they appear in this list.
* If the firmware boot manager does not support loading multiple applications, this list cannot contain more than one entry.
*/
BcdBootMgrObjectList_BootSequence = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_OBJECTLIST, 2),
/**
* The default boot environment application to load if the user does not select one. [0x23000003]
*/
BcdBootMgrObject_DefaultObject = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_OBJECT, 3),
/**
* The maximum number of seconds a boot selection menu is to be displayed to the user. [0x25000004]
* The menu is displayed until the user selects an option or the time-out expires.
* If this value is not specified, the boot manager waits for the user to make a selection.
*/
BcdBootMgrInteger_Timeout = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_INTEGER, 4),
/**
* Indicates that a resume operation should be attempted during a system restart. [0x26000005]
*/
BcdBootMgrBoolean_AttemptResume = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, 5),
/**
* The resume application object. [0x23000006]
*/
BcdBootMgrObject_ResumeObject = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_OBJECT, 6),
/**
* The startup sequence. [0x24000007]
*/
BcdBootMgrObjectList_StartupSequence = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_OBJECTLIST, 7),
/**
* The boot manager tools display order list. [0x24000010]
*/
BcdBootMgrObjectList_ToolsDisplayOrder = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_OBJECTLIST, 16),
/**
* Forces the display of the legacy boot menu, regardless of the number of OS entries in the BCD store and their BcdOSLoaderInteger_BootMenuPolicy. [0x26000020]
*/
BcdBootMgrBoolean_DisplayBootMenu = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, 32),
/**
* Indicates whether the display of errors should be suppressed. If this setting is enabled, the boot manager exits to the multi-OS menu on OS launch error. [0x26000021]
*/
BcdBootMgrBoolean_NoErrorDisplay = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, 33),
/**
* The device on which the boot application resides. [0x21000022]
*/
BcdBootMgrDevice_BcdDevice = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_DEVICE, 34),
/**
* The boot application. [0x22000023] (BCDE_BOOTMGR_TYPE_BCD_FILEPATH)
*/
BcdBootMgrString_BcdFilePath = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_STRING, 35),
/**
* Indicates whether HORM (Hibernate Once/Resume Many) is enabled. [0x26000024]
*/
BcdBootMgrBoolean_HormEnabled = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, 36),
/**
* Indicates whether the system is in hibernation root mode. [0x26000025]
*/
BcdBootMgrBoolean_HiberRoot = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, 37),
/**
* The password override string. [0x22000026]
*/
BcdBootMgrString_PasswordOverride = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_STRING, 38),
/**
* The PIN/passphrase override string. [0x22000027]
*/
BcdBootMgrString_PinpassPhraseOverride = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_STRING, 39),
/**
* Controls whether custom actions are processed before a boot sequence. Note This value is supported starting in Windows 8 and Windows Server 2012. [0x26000028]
*/
BcdBootMgrBoolean_ProcessCustomActionsFirst = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, 40),
/**
* Custom Bootstrap Actions. [0x27000030] (BCDE_BOOTMGR_TYPE_CUSTOM_ACTIONS_LIST)
*/
BcdBootMgrIntegerList_CustomActionsList = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_INTEGERLIST, 48),
/**
* Controls whether a boot sequence persists across multiple boots. Note This value is supported starting in Windows 8 and Windows Server 2012. [0x26000031]
*/
BcdBootMgrBoolean_PersistBootSequence = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, 49),
/**
* Indicates whether to skip the startup sequence. [0x26000032]
*/
BcdBootMgrBoolean_SkipStartupSequence = MAKE_BCDE_DATA_TYPE(BCD_ELEMENT_DATATYPE_CLASS_APPLICATION, BCD_ELEMENT_DATATYPE_FORMAT_BOOLEAN, 50),
} BcdBootMgrElementTypes;
/**
* Specifies the policy for using the first megabyte of memory.
*/
typedef enum _BcdLibrary_FirstMegabytePolicy
{
/* Use none of the first megabyte of memory. */
FirstMegabytePolicyUseNone,
/* Use all of the first megabyte of memory. */
FirstMegabytePolicyUseAll,
/* Reserved for future use. */
FirstMegabytePolicyUsePrivate
} BcdLibrary_FirstMegabytePolicy;
/**
* Specifies the type of debugger.
*/
typedef enum _BcdLibrary_DebuggerType
{
/* Serial debugger. */
DebuggerSerial = 0,
/* 1394 debugger. */
Debugger1394 = 1,
/* USB debugger. */
DebuggerUsb = 2,
/* Network debugger. */
DebuggerNet = 3,
/* Local debugger. */
DebuggerLocal = 4
} BcdLibrary_DebuggerType;
/**
* Specifies the start policy for the debugger.
*/
typedef enum _BcdLibrary_DebuggerStartPolicy
{
/* The debugger will start active. */
DebuggerStartActive,
/**
* The debugger will start in the auto-enabled state.
* If a debugger is attached it will be used; otherwise the debugger port will be available for other applications.
*/