Author: ion
Date: Fri Jan 8 00:15:00 2016
New Revision: 70540
URL:
http://svn.reactos.org/svn/reactos?rev=70540&view=rev
Log:
[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.
Modified:
trunk/reactos/boot/environ/app/bootmgr/bootmgr.c
trunk/reactos/boot/environ/lib/firmware/efi/firmware.c
trunk/reactos/boot/environ/lib/io/device.c
Modified: trunk/reactos/boot/environ/app/bootmgr/bootmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/app/bootmgr/b…
==============================================================================
--- trunk/reactos/boot/environ/app/bootmgr/bootmgr.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/app/bootmgr/bootmgr.c [iso-8859-1] Fri Jan 8 00:15:00
2016
@@ -1085,7 +1085,7 @@
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;
}
Modified: trunk/reactos/boot/environ/lib/firmware/efi/firmware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/firmware/…
==============================================================================
--- trunk/reactos/boot/environ/lib/firmware/efi/firmware.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/firmware/efi/firmware.c [iso-8859-1] Fri Jan 8
00:15:00 2016
@@ -44,14 +44,21 @@
_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 @@
}
/* 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;
}
Modified: trunk/reactos/boot/environ/lib/io/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/device…
==============================================================================
--- trunk/reactos/boot/environ/lib/io/device.c [iso-8859-1] (original)
+++ trunk/reactos/boot/environ/lib/io/device.c [iso-8859-1] Fri Jan 8 00:15:00 2016
@@ -920,7 +920,8 @@
/* 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 @@
/* 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 @@
/* 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)