/* Get the GUID file name from the file path. */
EFI_GUID* GetFileNameFromFilePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
/* Get the GUID file name from the file path. */
EFI_GUID* GetFileNameFromFilePath(IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
{
  MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *ThisFilePath;
  EFI_GUID                           *FileName;
  FileName = NULL;
  if (FilePath != NULL) {
    ThisFilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)FilePath;
    while (!IsDevicePathEnd (ThisFilePath)) {
      FileName = EfiGetNameGuidFromFwVolDevicePathNode (ThisFilePath);
      if (FileName != NULL) {
        break;
      }
      ThisFilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)NextDevicePathNode (ThisFilePath);
    }
  }
  return FileName;
}