/* The function doesn't garentee the device path points to existing FV file. */
BOOLEAN BmIsFvFilePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
/* The function doesn't garentee the device path points to existing FV file. */
BOOLEAN BmIsFvFilePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
{
  EFI_STATUS                Status;
  EFI_HANDLE                Handle;
  EFI_DEVICE_PATH_PROTOCOL  *Node;
  Node   = DevicePath;
  Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &Node, &Handle);
  if (!EFI_ERROR (Status)) {
    return TRUE;
  }
  if ((DevicePathType (DevicePath) == HARDWARE_DEVICE_PATH) && (DevicePathSubType (DevicePath) == HW_MEMMAP_DP)) {
    DevicePath = NextDevicePathNode (DevicePath);
    if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) && (DevicePathSubType (DevicePath) == MEDIA_PIWG_FW_FILE_DP)) {
      return IsDevicePathEnd (NextDevicePathNode (DevicePath));
    }
  }
  return FALSE;
}