diff --git a/reactos/boot/environ/app/bootmgr/bootmgr.c b/reactos/boot/environ/app/bootmgr/bootmgr.c index 1b75729c187..278e9c443f8 100644 --- a/reactos/boot/environ/app/bootmgr/bootmgr.c +++ b/reactos/boot/environ/app/bootmgr/bootmgr.c @@ -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; } diff --git a/reactos/boot/environ/lib/firmware/efi/firmware.c b/reactos/boot/environ/lib/firmware/efi/firmware.c index 63cf44fc61d..97c592f3d67 100644 --- a/reactos/boot/environ/lib/firmware/efi/firmware.c +++ b/reactos/boot/environ/lib/firmware/efi/firmware.c @@ -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; } diff --git a/reactos/boot/environ/lib/io/device.c b/reactos/boot/environ/lib/io/device.c index ed2f4bfd500..20a48a95ec7 100644 --- a/reactos/boot/environ/lib/io/device.c +++ b/reactos/boot/environ/lib/io/device.c @@ -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)