]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
Enhance GPT to remove the assumption that GPT partition entry in PMBR must be the...
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / PartitionDxe / Mbr.c
index 5d544e8b775d5cae7c4053b3577eba5094ce9bfd..37c12d365aed106739efcefee8bb22fb56140393 100644 (file)
@@ -11,7 +11,7 @@
         always on the first sector of a media. The first sector also contains\r
         the legacy boot strap code.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -132,21 +132,20 @@ PartitionInstallMbrChildHandles (
   EFI_DEVICE_PATH_PROTOCOL  *DevicePathNode;\r
   EFI_DEVICE_PATH_PROTOCOL  *LastDevicePathNode;\r
 \r
-  Mbr             = NULL;\r
   Found           = EFI_NOT_FOUND;\r
 \r
   Mbr             = AllocatePool (BlockIo->Media->BlockSize);\r
   if (Mbr == NULL) {\r
-    goto Done;\r
+    return Found;\r
   }\r
 \r
-  Status = BlockIo->ReadBlocks (\r
-                      BlockIo,\r
-                      BlockIo->Media->MediaId,\r
-                      0,\r
-                      BlockIo->Media->BlockSize,\r
-                      Mbr\r
-                      );\r
+  Status = DiskIo->ReadDisk (\r
+                     DiskIo,\r
+                     BlockIo->Media->MediaId,\r
+                     0,\r
+                     BlockIo->Media->BlockSize,\r
+                     Mbr\r
+                     );\r
   if (EFI_ERROR (Status)) {\r
     Found = Status;\r
     goto Done;\r
@@ -240,13 +239,13 @@ PartitionInstallMbrChildHandles (
 \r
     do {\r
 \r
-      Status = BlockIo->ReadBlocks (\r
-                          BlockIo,\r
-                          BlockIo->Media->MediaId,\r
-                          ExtMbrStartingLba,\r
-                          BlockIo->Media->BlockSize,\r
-                          Mbr\r
-                          );\r
+      Status = DiskIo->ReadDisk (\r
+                         DiskIo,\r
+                         BlockIo->Media->MediaId,\r
+                         MultU64x32 (ExtMbrStartingLba, BlockIo->Media->BlockSize),\r
+                         BlockIo->Media->BlockSize,\r
+                         Mbr\r
+                         );\r
       if (EFI_ERROR (Status)) {\r
         Found = Status;\r
         goto Done;\r