mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 05:00:27 +00:00
[HIVEBCD]: Implement an entire wholeseome BCD boot hive, including multiple levels of inheritance (globalsettings, dbgsettings, emssettings, bootloadersettings), plus entries for {memdiag}, {bootmgr} and {winload}.
[BOOTLIB]: Fix a bug in BCD parsing which was causing massive heap corruption. Became evident with the increased complexity of the new BCD hive. svn path=/trunk/; revision=70610
This commit is contained in:
parent
ba3178b813
commit
51f9487ff7
2 changed files with 90 additions and 12 deletions
|
@ -2,15 +2,89 @@
|
||||||
Signature = "$ReactOS$"
|
Signature = "$ReactOS$"
|
||||||
|
|
||||||
[AddReg]
|
[AddReg]
|
||||||
|
BCD,"BCD00000000\Description\Control","System",0x00010001,1
|
||||||
|
BCD,"BCD00000000\Description\Control","TreatAtSystem",0x00010001,1
|
||||||
|
BCD,"BCD00000000\Description\Control","KeyName",,"BCD00000000"
|
||||||
|
|
||||||
BCD,"BCD00000000\Description\Control","System",0x00010003,1
|
;
|
||||||
BCD,"BCD00000000\Description\Control","TreatAtSystem",0x00010003,1
|
; ReactOS Boot Manager
|
||||||
BCD,"BCD00000000\Description\Control","KeyName",2,"BCD00000000"
|
;
|
||||||
|
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Description","Type",0x00010001,0x10100002 ; identifier={bootmgr}
|
||||||
|
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000004","Element",,"ReactOS Boot Manager" ; description
|
||||||
|
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000005","Element",,"en-US" ; locale="en-US"
|
||||||
|
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\14000006","Element",0x10000,"{7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}" ; inherit={globalsettings}
|
||||||
|
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\23000003","Element",,"{7619dcc9-fafe-11d9-b411-000476eba25f}" ; default={winload}
|
||||||
|
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\24000001","Element",0x10000,"{7619dcc9-fafe-11d9-b411-000476eba25f}" ; displayorder={winload}
|
||||||
|
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\24000010","Element",0x10000,"{b2721d73-1db4-4c62-bf78-c548a880142d}" ; toolsdisplayorder={memdiag}
|
||||||
|
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\25000004","Element",0x1,0x1e ; timeout=30
|
||||||
|
|
||||||
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Description","Type",0x00010003,0x10100002
|
;
|
||||||
|
; ReactOS Boot Loader
|
||||||
|
;
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Description","Type",0x00010001,0x10200003 ; identifier={winload}
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\11000011","Element",0x1,\ ; device=boot
|
||||||
|
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
|
||||||
|
05,00,00,00,\
|
||||||
|
00,00,00,00,\
|
||||||
|
48,00,00,00,\
|
||||||
|
00,00,00,00,\
|
||||||
|
00,00,00,00,\
|
||||||
|
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
|
||||||
|
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\12000002","Element",,"\windows\system32\boot\winload.efi" ; path
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\12000004","Element",,"ReactOS Setup" ; description
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\12000005","Element",,"en-US" ; locale="en-US"
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\14000006","Element",0x10000,"{6efb52bf-1766-41db-a6b3-0ee5eff72bd7}" ; inherit={bootloadersettings}
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\16000060","Element",0x1,0x01 ; isolatedcontext=Yes
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\22000002","Element",,"\windows" ; systemroot=\Windows
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\26000010","Element",0x1,0x01 ; detecthal=Yes
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\26000022","Element",0x1,0x01 ; winpe=Yes
|
||||||
|
BCD,"BCD00000000\Objects\{7619dcc9-fafe-11d9-b411-000476eba25f}\Elements\260000b0","Element",0x1,0x01 ; ems=Yes
|
||||||
|
|
||||||
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000002","Element",2,"\EFI\BOOT\BOOTIA32.EFI"
|
;
|
||||||
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000004","Element",2,"ReactOS Boot Manager"
|
; ReactOS Memory Tester
|
||||||
BCD,"BCD00000000\Objects\{9dea862c-5cdd-4e70-acc1-f32b344d4795}\Elements\12000005","Element",2,"en-US"
|
;
|
||||||
|
BCD,"BCD00000000\Objects\{b2721d73-1db4-4c62-bf78-c548a880142d}\Description","Type",0x00010001,0x10200005 ; identifier={memdiag}
|
||||||
|
BCD,"BCD00000000\Objects\{b2721d73-1db4-4c62-bf78-c548a880142d}\Elements\11000011","Element",0x1,\ ; device=boot
|
||||||
|
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
|
||||||
|
05,00,00,00,\
|
||||||
|
00,00,00,00,\
|
||||||
|
48,00,00,00,\
|
||||||
|
00,00,00,00,\
|
||||||
|
00,00,00,00,\
|
||||||
|
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
|
||||||
|
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
|
||||||
|
BCD,"BCD00000000\Objects\{b2721d73-1db4-4c62-bf78-c548a880142d}\Elements\12000002","Element",,"\EFI\BOOT\MEMTEST.EFI" ; path
|
||||||
|
BCD,"BCD00000000\Objects\{b2721d73-1db4-4c62-bf78-c548a880142d}\Elements\12000004","Element",,"ReactOS Memory Diagnostics" ; description
|
||||||
|
BCD,"BCD00000000\Objects\{b2721d73-1db4-4c62-bf78-c548a880142d}\Elements\12000005","Element",,"en-US" ; locale="en-US"
|
||||||
|
BCD,"BCD00000000\Objects\{b2721d73-1db4-4c62-bf78-c548a880142d}\Elements\14000006","Element",0x10000,"{7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}" ; inherit={globalsettings}
|
||||||
|
BCD,"BCD00000000\Objects\{b2721d73-1db4-4c62-bf78-c548a880142d}\Elements\1600000b","Element",0x1,0x01 ; allowbadmemoryaccess=Yes
|
||||||
|
|
||||||
|
;
|
||||||
|
; Global Settings
|
||||||
|
;
|
||||||
|
BCD,"BCD00000000\Objects\{7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}\Description","Type",0x00010001,0x20100000 ; identifier={globalsettings}
|
||||||
|
BCD,"BCD00000000\Objects\{7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}\Elements\14000006","Element",0x10000,"{4636856e-540f-4170-a130-a84776f4c654}", \
|
||||||
|
"{0ce4991b-e6b3-4b16-b23c-5e0d9250e5d9}" ; inherit={dbgsettings,emssettings}
|
||||||
|
|
||||||
|
;
|
||||||
|
; Boot Loader Settings
|
||||||
|
;
|
||||||
|
BCD,"BCD00000000\Objects\{6efb52bf-1766-41db-a6b3-0ee5eff72bd7}\Description","Type",0x00010001,0x20200003 ; identifier={bootloadersettings}
|
||||||
|
BCD,"BCD00000000\Objects\{6efb52bf-1766-41db-a6b3-0ee5eff72bd7}\Elements\14000006","Element",0x10000,"{7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}" ; inherit={globalsettings}
|
||||||
|
|
||||||
|
;
|
||||||
|
; EMS Settings
|
||||||
|
;
|
||||||
|
BCD,"BCD00000000\Objects\{0ce4991b-e6b3-4b16-b23c-5e0d9250e5d9}\Description","Type",0x00010001,0x20100000 ; identifier={dbgsettings}
|
||||||
|
BCD,"BCD00000000\Objects\{0ce4991b-e6b3-4b16-b23c-5e0d9250e5d9}\Elements\16000020","Element",0x1,0x01 ; bootems=Yes
|
||||||
|
|
||||||
|
;
|
||||||
|
; Debugger Settings
|
||||||
|
;
|
||||||
|
BCD,"BCD00000000\Objects\{4636856e-540f-4170-a130-a84776f4c654}\Description","Type",0x00010001,0x20100000 ; identifier={dbgsettings}
|
||||||
|
BCD,"BCD00000000\Objects\{4636856e-540f-4170-a130-a84776f4c654}\Elements\15000011","Element",0x1,0x00 ; debugtype=Serial
|
||||||
|
BCD,"BCD00000000\Objects\{4636856e-540f-4170-a130-a84776f4c654}\Elements\15000013","Element",0x1,0x01 ; debugport=1
|
||||||
|
BCD,"BCD00000000\Objects\{4636856e-540f-4170-a130-a84776f4c654}\Elements\15000014","Element",0x1,0x00,0xc2,0x01 ; baudrate=115200
|
||||||
|
|
||||||
; EOF
|
; EOF
|
||||||
|
|
|
@ -24,7 +24,7 @@ BiNotifyEnumerationError (
|
||||||
UNREFERENCED_PARAMETER(ObjectHandle);
|
UNREFERENCED_PARAMETER(ObjectHandle);
|
||||||
UNREFERENCED_PARAMETER(ElementName);
|
UNREFERENCED_PARAMETER(ElementName);
|
||||||
UNREFERENCED_PARAMETER(Status);
|
UNREFERENCED_PARAMETER(Status);
|
||||||
EfiPrintf(L"Error in BiNotify\r\n");
|
EfiPrintf(L"Error in BiNotify: %lx for element %s\r\n", Status, ElementName);
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
|
@ -818,7 +818,7 @@ BiEnumerateElements (
|
||||||
ULONG i;
|
ULONG i;
|
||||||
PVOID ElementData, SubObjectList, RegistryElementData;
|
PVOID ElementData, SubObjectList, RegistryElementData;
|
||||||
BcdElementType ElementType;
|
BcdElementType ElementType;
|
||||||
PBCD_PACKED_ELEMENT PreviousElement;
|
PBCD_PACKED_ELEMENT PreviousElement, ElementsStart;
|
||||||
ULONG SubElementCount, SubKeyCount, SubObjectCount, ElementDataLength;
|
ULONG SubElementCount, SubKeyCount, SubObjectCount, ElementDataLength;
|
||||||
PWCHAR ElementName;
|
PWCHAR ElementName;
|
||||||
PWCHAR* SubKeys;
|
PWCHAR* SubKeys;
|
||||||
|
@ -839,6 +839,7 @@ BiEnumerateElements (
|
||||||
ElementDataLength = 0;
|
ElementDataLength = 0;
|
||||||
SubObjectCount = 0;
|
SubObjectCount = 0;
|
||||||
RemainingLength = 0;
|
RemainingLength = 0;
|
||||||
|
ElementsStart = Elements;
|
||||||
|
|
||||||
/* Open the root object key's elements */
|
/* Open the root object key's elements */
|
||||||
Status = BiOpenKey(ObjectHandle, L"Elements", &ElementsHandle);
|
Status = BiOpenKey(ObjectHandle, L"Elements", &ElementsHandle);
|
||||||
|
@ -862,6 +863,8 @@ BiEnumerateElements (
|
||||||
Status = BiOpenKey(ElementsHandle, ElementName, &ElementHandle);
|
Status = BiOpenKey(ElementsHandle, ElementName, &ElementHandle);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
EfiPrintf(L"ELEMENT ERROR: %lx\r\n", Status);
|
||||||
|
EfiStall(100000);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -869,7 +872,7 @@ BiEnumerateElements (
|
||||||
ElementType.PackedValue = wcstoul(SubKeys[i], NULL, 16);
|
ElementType.PackedValue = wcstoul(SubKeys[i], NULL, 16);
|
||||||
if (!(ElementType.PackedValue) || (ElementType.PackedValue == -1))
|
if (!(ElementType.PackedValue) || (ElementType.PackedValue == -1))
|
||||||
{
|
{
|
||||||
EfiPrintf(L"Value invald\r\n");
|
EfiPrintf(L"Value invalid\r\n");
|
||||||
BiCloseKey(ElementHandle);
|
BiCloseKey(ElementHandle);
|
||||||
ElementHandle = 0;
|
ElementHandle = 0;
|
||||||
continue;
|
continue;
|
||||||
|
@ -885,6 +888,7 @@ BiEnumerateElements (
|
||||||
&RegistryElementDataLength);
|
&RegistryElementDataLength);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
EfiPrintf(L"Element invalid\r\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -945,7 +949,7 @@ BiEnumerateElements (
|
||||||
if (RemainingLength >= TotalLength)
|
if (RemainingLength >= TotalLength)
|
||||||
{
|
{
|
||||||
/* Set the next pointer */
|
/* Set the next pointer */
|
||||||
Elements->NextEntry = (PBCD_PACKED_ELEMENT)((ULONG_PTR)Elements + TotalLength);
|
Elements->NextEntry = (PBCD_PACKED_ELEMENT)((ULONG_PTR)ElementsStart + TotalLength);
|
||||||
|
|
||||||
/* Fill this one out */
|
/* Fill this one out */
|
||||||
Elements->RootType.PackedValue = RootElementType;
|
Elements->RootType.PackedValue = RootElementType;
|
||||||
|
@ -1005,7 +1009,7 @@ BiEnumerateElements (
|
||||||
/* Link the subelements into the chain */
|
/* Link the subelements into the chain */
|
||||||
PreviousElement = Elements;
|
PreviousElement = Elements;
|
||||||
PreviousElement->NextEntry =
|
PreviousElement->NextEntry =
|
||||||
(PBCD_PACKED_ELEMENT)((ULONG_PTR)Elements +
|
(PBCD_PACKED_ELEMENT)((ULONG_PTR)ElementsStart +
|
||||||
TotalLength);
|
TotalLength);
|
||||||
Elements = PreviousElement->NextEntry;
|
Elements = PreviousElement->NextEntry;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue