/* If any errors are generated while the protocol interfaces are being uninstalled, then the protocol interfaces uninstalled prior to the error will be reinstalled and EFI_INVALID_PARAMETER will be returned. */
EFI_STATUS EFIAPI CoreUninstallMultipleProtocolInterfaces(IN EFI_HANDLE Handle,...)
/* If any errors are generated while the protocol interfaces are being uninstalled, then the protocol interfaces uninstalled prior to the error will be reinstalled and EFI_INVALID_PARAMETER will be returned. */
EFI_STATUS EFIAPI CoreUninstallMultipleProtocolInterfaces(IN EFI_HANDLE Handle,...)
{
  EFI_STATUS  Status;
  VA_LIST     Args;
  EFI_GUID    *Protocol;
  VOID        *Interface;
  UINTN       Index;
  VA_START (Args, Handle);
  for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) {
    Protocol = VA_ARG (Args, EFI_GUID *);
    if (Protocol == NULL) {
      break;
    }
    Interface = VA_ARG (Args, VOID *);
    Status = CoreUninstallProtocolInterface (Handle, Protocol, Interface);
  }
  VA_END (Args);
  if (EFI_ERROR (Status)) {
    VA_START (Args, Handle);
    for ( ; Index > 1; Index--) {
      Protocol  = VA_ARG (Args, EFI_GUID *);
      Interface = VA_ARG (Args, VOID *);
      CoreInstallProtocolInterface (&Handle, Protocol, EFI_NATIVE_INTERFACE, Interface);
    }
    VA_END (Args);
    Status = EFI_INVALID_PARAMETER;
  }
  return Status;
}