]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
MdeModulePkg/UefiBootManagerLib: Match the nested partitions
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmBoot.c
index 6a23477eb8730dfa94faa4e6447b792d514cd901..2284ce1a564626ecbfbf079a60b48ddddc2ceb30 100644 (file)
@@ -1979,37 +1979,33 @@ BmMatchPartitionDevicePathNode (
   }\r
 \r
   //\r
-  // find the partition device path node\r
+  // Match all the partition device path nodes including the nested partition nodes\r
   //\r
   while (!IsDevicePathEnd (BlockIoDevicePath)) {\r
     if ((DevicePathType (BlockIoDevicePath) == MEDIA_DEVICE_PATH) &&\r
         (DevicePathSubType (BlockIoDevicePath) == MEDIA_HARDDRIVE_DP)\r
         ) {\r
-      break;\r
+      //\r
+      // See if the harddrive device path in blockio matches the orig Hard Drive Node\r
+      //\r
+      Node = (HARDDRIVE_DEVICE_PATH *) BlockIoDevicePath;\r
+\r
+      //\r
+      // Match Signature and PartitionNumber.\r
+      // Unused bytes in Signature are initiaized with zeros.\r
+      //\r
+      if ((Node->PartitionNumber == HardDriveDevicePath->PartitionNumber) &&\r
+          (Node->MBRType == HardDriveDevicePath->MBRType) &&\r
+          (Node->SignatureType == HardDriveDevicePath->SignatureType) &&\r
+          (CompareMem (Node->Signature, HardDriveDevicePath->Signature, sizeof (Node->Signature)) == 0)) {\r
+        return TRUE;\r
+      }\r
     }\r
 \r
     BlockIoDevicePath = NextDevicePathNode (BlockIoDevicePath);\r
   }\r
 \r
-  if (IsDevicePathEnd (BlockIoDevicePath)) {\r
-    return FALSE;\r
-  }\r
-\r
-  //\r
-  // See if the harddrive device path in blockio matches the orig Hard Drive Node\r
-  //\r
-  Node = (HARDDRIVE_DEVICE_PATH *) BlockIoDevicePath;\r
-\r
-  //\r
-  // Match Signature and PartitionNumber.\r
-  // Unused bytes in Signature are initiaized with zeros.\r
-  //\r
-  return (BOOLEAN) (\r
-    (Node->PartitionNumber == HardDriveDevicePath->PartitionNumber) &&\r
-    (Node->MBRType == HardDriveDevicePath->MBRType) &&\r
-    (Node->SignatureType == HardDriveDevicePath->SignatureType) &&\r
-    (CompareMem (Node->Signature, HardDriveDevicePath->Signature, sizeof (Node->Signature)) == 0)\r
-    );\r
+  return FALSE;\r
 }\r
 \r
 /**\r