179 UINTN DeviceHandleCount;
182 VOID *ComponentName2;
184 Status =
gBS->LocateHandleBuffer (
191 if (EFI_ERROR (Status)) {
195 for (Index = 0; Index < DeviceHandleCount; Index++) {
196 Status =
EfiTestManagedDevice (DeviceHandleBuffer[Index], ImageHandle, &gEfiDiskIoProtocolGuid);
197 if (!EFI_ERROR (Status)) {
198 Status =
gBS->DisconnectController (
199 DeviceHandleBuffer[Index],
203 if (EFI_ERROR (Status)) {
209 if (Index == DeviceHandleCount) {
213 Status =
gBS->HandleProtocol (ImageHandle, &gEfiComponentNameProtocolGuid, &ComponentName);
214 if (EFI_ERROR (Status)) {
215 ComponentName =
NULL;
218 Status =
gBS->HandleProtocol (ImageHandle, &gEfiComponentName2ProtocolGuid, &ComponentName2);
219 if (EFI_ERROR (Status)) {
220 ComponentName2 =
NULL;
223 if (ComponentName ==
NULL) {
224 if (ComponentName2 ==
NULL) {
225 Status =
gBS->UninstallMultipleProtocolInterfaces (
227 &gEfiDriverBindingProtocolGuid,
232 Status =
gBS->UninstallMultipleProtocolInterfaces (
234 &gEfiDriverBindingProtocolGuid,
236 &gEfiComponentName2ProtocolGuid,
242 if (ComponentName2 ==
NULL) {
243 Status =
gBS->UninstallMultipleProtocolInterfaces (
245 &gEfiDriverBindingProtocolGuid,
247 &gEfiComponentNameProtocolGuid,
252 Status =
gBS->UninstallMultipleProtocolInterfaces (
254 &gEfiDriverBindingProtocolGuid,
256 &gEfiComponentNameProtocolGuid,
258 &gEfiComponentName2ProtocolGuid,
266 if (DeviceHandleBuffer !=
NULL) {
301 Status =
gBS->OpenProtocol (
303 &gEfiDiskIoProtocolGuid,
305 This->DriverBindingHandle,
307 EFI_OPEN_PROTOCOL_BY_DRIVER
310 if (EFI_ERROR (Status)) {
319 &gEfiDiskIoProtocolGuid,
320 This->DriverBindingHandle,
327 Status =
gBS->OpenProtocol (
329 &gEfiBlockIoProtocolGuid,
331 This->DriverBindingHandle,
333 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
375 if (!EFI_ERROR (Status)) {
380 if (EFI_ERROR (Status)) {
387 Status =
gBS->OpenProtocol (
389 &gEfiBlockIoProtocolGuid,
391 This->DriverBindingHandle,
393 EFI_OPEN_PROTOCOL_GET_PROTOCOL
395 if (EFI_ERROR (Status)) {
399 Status =
gBS->OpenProtocol (
401 &gEfiDiskIoProtocolGuid,
403 This->DriverBindingHandle,
405 EFI_OPEN_PROTOCOL_BY_DRIVER
407 if (EFI_ERROR (Status)) {
411 Status =
gBS->OpenProtocol (
413 &gEfiDiskIo2ProtocolGuid,
415 This->DriverBindingHandle,
417 EFI_OPEN_PROTOCOL_BY_DRIVER
419 if (EFI_ERROR (Status)) {
434 if (EFI_ERROR (Status)) {
435 Status =
gBS->OpenProtocol (
437 &gEfiSimpleFileSystemProtocolGuid,
439 This->DriverBindingHandle,
441 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
443 if (EFI_ERROR (Status)) {
446 &gEfiDiskIoProtocolGuid,
447 This->DriverBindingHandle,
452 &gEfiDiskIo2ProtocolGuid,
453 This->DriverBindingHandle,
501 Status =
gBS->OpenProtocol (
503 &gEfiSimpleFileSystemProtocolGuid,
504 (VOID **)&FileSystem,
505 This->DriverBindingHandle,
507 EFI_OPEN_PROTOCOL_GET_PROTOCOL
510 if (!EFI_ERROR (Status)) {
511 Volume = VOLUME_FROM_VOL_INTERFACE (FileSystem);
512 DiskIo2 = Volume->DiskIo2;
516 if (!EFI_ERROR (Status)) {
517 if (DiskIo2 !=
NULL) {
518 Status =
gBS->CloseProtocol (
520 &gEfiDiskIo2ProtocolGuid,
521 This->DriverBindingHandle,
527 Status =
gBS->CloseProtocol (
529 &gEfiDiskIoProtocolGuid,
530 This->DriverBindingHandle,
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI FatUnload(IN EFI_HANDLE ImageHandle)
EFI_STATUS EFIAPI FatDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI FatEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI FatDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI FatDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS FatAcquireLockOrFail(VOID)
EFI_STATUS FatAllocateVolume(IN EFI_HANDLE Handle, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN EFI_DISK_IO2_PROTOCOL *DiskIo2, IN EFI_BLOCK_IO_PROTOCOL *BlockIo)
EFI_STATUS FatAbandonVolume(IN FAT_VOLUME *Volume)
VOID FatReleaseLock(VOID)
EFI_STATUS InitializeUnicodeCollationSupport(IN EFI_HANDLE AgentHandle)
#define ASSERT_EFI_ERROR(StatusParameter)
VOID EFIAPI Exit(IN EFI_STATUS Status)
EFI_STATUS EFIAPI EfiTestManagedDevice(IN CONST EFI_HANDLE ControllerHandle, IN CONST EFI_HANDLE DriverBindingHandle, IN CONST EFI_GUID *ProtocolGuid)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)