/* Check if the device path is EFI system Partition. */
BOOLEAN IsEfiSysPartitionDevicePath(EFI_DEVICE_PATH_PROTOCOL *DevicePath)
/* Check if the device path is EFI system Partition. */
BOOLEAN IsEfiSysPartitionDevicePath(EFI_DEVICE_PATH_PROTOCOL *DevicePath)
{
  EFI_STATUS                Status;
  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;
  HARDDRIVE_DEVICE_PATH     *Hd;
  EFI_HANDLE                Handle;
  TempDevicePath = DevicePath;
  while (!IsDevicePathEnd (TempDevicePath)) {
    if ((DevicePathType (TempDevicePath) == MEDIA_DEVICE_PATH) &&
        (DevicePathSubType (TempDevicePath) == MEDIA_HARDDRIVE_DP))
    {
      Hd = (HARDDRIVE_DEVICE_PATH *)TempDevicePath;
      if (Hd->MBRType == MBR_TYPE_EFI_PARTITION_TABLE_HEADER) {
        break;
      }
    }
    TempDevicePath = NextDevicePathNode (TempDevicePath);
  }
  if (!IsDevicePathEnd (TempDevicePath)) {
    Status = gBS->LocateDevicePath (&gEfiPartTypeSystemPartGuid, &DevicePath, &Handle);
    return EFI_ERROR (Status) ? FALSE : TRUE;
  } else {
    return FALSE;
  }
}