]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Disk/Partition/Dxe/Gpt.c
Fixed bug in partition driver:
[mirror_edk2.git] / EdkModulePkg / Universal / Disk / Partition / Dxe / Gpt.c
index 12ec97612dd30eb5ea6f75080304ce23c5e9601d..42411806f648985811876c4a149d62c82b40b0e7 100644 (file)
@@ -75,7 +75,7 @@ PartitionSetCrc (
   IN OUT EFI_TABLE_HEADER *Hdr\r
   );\r
 \r
-BOOLEAN\r
+EFI_STATUS\r
 PartitionInstallGptChildHandles (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
   IN  EFI_HANDLE                   Handle,\r
@@ -96,8 +96,9 @@ Arguments:
   DevicePath - Parent Device Path\r
 \r
 Returns:\r
-  TRUE       - Valid GPT disk\r
-  FALSE      - Not a valid GPT disk\r
+  EFI_SUCCESS  - Valid GPT disk\r
+  EFI_MEDIA_CHANGED - Media changed Detected\r
+  !EFI_SUCCESS - Not a valid GPT disk\r
 \r
 --*/\r
 {\r
@@ -110,7 +111,7 @@ Returns:
   EFI_PARTITION_ENTRY         *PartEntry;\r
   EFI_PARTITION_ENTRY_STATUS  *PEntryStatus;\r
   UINTN                       Index;\r
-  BOOLEAN                     GptValid;\r
+  EFI_STATUS                  GptValid;\r
   HARDDRIVE_DEVICE_PATH       HdDev;\r
 \r
   ProtectiveMbr = NULL;\r
@@ -125,14 +126,14 @@ Returns:
   DEBUG ((EFI_D_INFO, " BlockSize : %d \n", BlockSize));\r
   DEBUG ((EFI_D_INFO, " LastBlock : %x \n", LastBlock));\r
 \r
-  GptValid = FALSE;\r
+  GptValid = EFI_NOT_FOUND;\r
 \r
   //\r
   // Allocate a buffer for the Protective MBR\r
   //\r
   ProtectiveMbr = AllocatePool (BlockSize);\r
   if (ProtectiveMbr == NULL) {\r
-    return FALSE;\r
+    return EFI_NOT_FOUND;\r
   }\r
 \r
   //\r
@@ -146,6 +147,7 @@ Returns:
                       ProtectiveMbr\r
                       );\r
   if (EFI_ERROR (Status)) {\r
+    GptValid = Status;\r
     goto Done;\r
   }\r
   //\r
@@ -224,6 +226,7 @@ Returns:
                     PartEntry\r
                     );\r
   if (EFI_ERROR (Status)) {\r
+    GptValid = Status;\r
     DEBUG ((EFI_D_INFO, " Partition Entry ReadBlocks error\n"));\r
     goto Done;\r
   }\r
@@ -246,7 +249,7 @@ Returns:
   //\r
   // If we got this far the GPT layout of the disk is valid and we should return true\r
   //\r
-  GptValid = TRUE;\r
+  GptValid = EFI_SUCCESS;\r
 \r
   //\r
   // Create child device handles\r