mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 09:42:07 +00:00
[BOOTLIB]: Fix a few subtle bugs which made us incorrectly believe that we were booting from a raw removable drive. We now correctly detect that we are booting off CDROM media. Of course, now everything else is hopelessly broken and we've regressed to die before we get anywhere. Progress.
svn path=/trunk/; revision=70540
This commit is contained in:
parent
e0df0d3663
commit
79e72915d9
3 changed files with 20 additions and 10 deletions
|
@ -1085,7 +1085,7 @@ BmFwVerifySelfIntegrity (
|
|||
EfiPrintf(L"Device Type %d Local Type %d\r\n", BlpBootDevice->DeviceType, BlpBootDevice->Local.Type);
|
||||
if ((BlpBootDevice->DeviceType == LocalDevice) &&
|
||||
(BlpBootDevice->Local.Type == CdRomDevice) &&
|
||||
(BlpApplicationFlags & BL_APPLICATION_ENTRY_FLAG_NO_GUID))
|
||||
(BlpApplicationFlags & BL_APPLICATION_FLAG_CONVERTED_FROM_EFI))
|
||||
{
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -44,14 +44,21 @@ EfiIsDevicePathParent (
|
|||
_In_ EFI_DEVICE_PATH *DevicePath2
|
||||
)
|
||||
{
|
||||
EFI_DEVICE_PATH* CurrentPath1;
|
||||
EFI_DEVICE_PATH* CurrentPath2;
|
||||
USHORT Length1, Length2;
|
||||
|
||||
/* Start with the current nodes */
|
||||
CurrentPath1 = DevicePath1;
|
||||
CurrentPath2 = DevicePath2;
|
||||
|
||||
/* Loop each element of the device path */
|
||||
while (!IsDevicePathEndType(DevicePath1) && !IsDevicePathEndType(DevicePath2))
|
||||
while (!(IsDevicePathEndType(CurrentPath1)) &&
|
||||
!(IsDevicePathEndType(CurrentPath2)))
|
||||
{
|
||||
/* Check if the element has a different length */
|
||||
Length1 = DevicePathNodeLength(DevicePath1);
|
||||
Length2 = DevicePathNodeLength(DevicePath2);
|
||||
Length1 = DevicePathNodeLength(CurrentPath1);
|
||||
Length2 = DevicePathNodeLength(CurrentPath2);
|
||||
if (Length1 != Length2)
|
||||
{
|
||||
/* Then they're not related */
|
||||
|
@ -59,25 +66,25 @@ EfiIsDevicePathParent (
|
|||
}
|
||||
|
||||
/* Check if the rest of the element data matches */
|
||||
if (RtlCompareMemory(DevicePath1, DevicePath2, Length1) != Length1)
|
||||
if (RtlCompareMemory(CurrentPath1, CurrentPath2, Length1) != Length1)
|
||||
{
|
||||
/* Nope, not related */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Move to the next element */
|
||||
DevicePath1 = NextDevicePathNode(DevicePath1);
|
||||
DevicePath2 = NextDevicePathNode(DevicePath2);
|
||||
CurrentPath1 = NextDevicePathNode(CurrentPath1);
|
||||
CurrentPath2 = NextDevicePathNode(CurrentPath2);
|
||||
}
|
||||
|
||||
/* If the last element in path 1 is empty, then path 2 is the child (deeper) */
|
||||
if (!IsDevicePathEndType(DevicePath1))
|
||||
if (!IsDevicePathEndType(CurrentPath1))
|
||||
{
|
||||
return DevicePath2;
|
||||
}
|
||||
|
||||
/* If the last element in path 2 is empty, then path 1 is the child (deeper) */
|
||||
if (!IsDevicePathEndType(DevicePath2))
|
||||
if (!IsDevicePathEndType(CurrentPath2))
|
||||
{
|
||||
return DevicePath1;
|
||||
}
|
||||
|
|
|
@ -920,7 +920,8 @@ BlockIoEfiGetChildHandle (
|
|||
/* Yup, return back to caller */
|
||||
ChildProtocolInterface->Handle = Handle;
|
||||
ChildProtocolInterface->Interface = DevicePath;
|
||||
break;
|
||||
Status = STATUS_SUCCESS;
|
||||
goto Quickie;
|
||||
}
|
||||
|
||||
/* Close the device path */
|
||||
|
@ -930,6 +931,7 @@ BlockIoEfiGetChildHandle (
|
|||
/* If we got here, nothing was found */
|
||||
Status = STATUS_NO_SUCH_DEVICE;
|
||||
|
||||
Quickie:
|
||||
/* Free the handle array buffer */
|
||||
BlMmFreeHeap(DeviceHandles);
|
||||
return Status;
|
||||
|
@ -981,6 +983,7 @@ BlockIoEfiGetDeviceInformation (
|
|||
/* Iteratate twice -- once for the top level, once for the bottom */
|
||||
for (i = 0, Found = FALSE; Found == FALSE && Protocol[i].Handle; i++)
|
||||
{
|
||||
/* Check what kind of leaf node device this is */
|
||||
LeafNode = EfiGetLeafNode(Protocol[i].Interface);
|
||||
EfiPrintf(L"Pass %d, Leaf node: %p Type: %d\r\n", i, LeafNode, LeafNode->Type);
|
||||
if (LeafNode->Type == ACPI_DEVICE_PATH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue