NULL\r
};\r
\r
+STATIC \r
+PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {\r
+ PartitionInstallGptChildHandles,\r
+ PartitionInstallElToritoChildHandles,\r
+ PartitionInstallMbrChildHandles,\r
+ NULL\r
+};\r
+\r
+\r
EFI_STATUS\r
EFIAPI\r
PartitionDriverBindingSupported (\r
EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
EFI_DISK_IO_PROTOCOL *DiskIo;\r
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;\r
+ PARTITION_DETECT_ROUTINE *Routine;\r
\r
Status = gBS->OpenProtocol (\r
ControllerHandle,\r
// media supports a given partition type install child handles to represent\r
// the partitions described by the media.\r
//\r
- if (PartitionInstallGptChildHandles (\r
- This,\r
- ControllerHandle,\r
- DiskIo,\r
- BlockIo,\r
- ParentDevicePath\r
- ) ||\r
-\r
- PartitionInstallElToritoChildHandles (\r
- This,\r
- ControllerHandle,\r
- DiskIo,\r
- BlockIo,\r
- ParentDevicePath\r
- ) ||\r
-\r
- PartitionInstallMbrChildHandles (\r
- This,\r
- ControllerHandle,\r
- DiskIo,\r
- BlockIo,\r
- ParentDevicePath\r
- )) {\r
- Status = EFI_SUCCESS;\r
- } else {\r
- Status = EFI_NOT_FOUND;\r
+ Routine = &mPartitionDetectRoutineTable[0];\r
+ while (*Routine != NULL) {\r
+ Status = (*Routine) (\r
+ This,\r
+ ControllerHandle,\r
+ DiskIo,\r
+ BlockIo,\r
+ ParentDevicePath\r
+ );\r
+ if (!EFI_ERROR (Status) || Status == EFI_MEDIA_CHANGED) {\r
+ break;\r
+ }\r
+ Routine++;\r
}\r
}\r
//\r
// driver. So don't try to close them. Otherwise, we will break the dependency\r
// between the controller and the driver set up before.\r
//\r
- if (EFI_ERROR (Status) && !EFI_ERROR (OpenStatus)) {\r
+ if (EFI_ERROR (Status) && !EFI_ERROR (OpenStatus) && Status != EFI_MEDIA_CHANGED) {\r
gBS->CloseProtocol (\r
ControllerHandle,\r
&gEfiDiskIoProtocolGuid,\r