/* Get either a Short Allocation Descriptor or a Long Allocation Descriptor from file's data. */
EFI_STATUS GetAllocationDescriptor(IN UDF_FE_RECORDING_FLAGS RecordingFlags, IN VOID *Data, IN OUT UINT64 *Offset, IN UINT64 Length, OUT VOID **FoundAd)
/* Get either a Short Allocation Descriptor or a Long Allocation Descriptor from file's data. */
EFI_STATUS GetAllocationDescriptor(IN UDF_FE_RECORDING_FLAGS RecordingFlags, IN VOID *Data, IN OUT UINT64 *Offset, IN UINT64 Length, OUT VOID **FoundAd)
{
  if (RecordingFlags == LongAdsSequence) {
    return GetLongAdFromAds (
             Data,
             Offset,
             Length,
             (UDF_LONG_ALLOCATION_DESCRIPTOR **)FoundAd
             );
  } else if (RecordingFlags == ShortAdsSequence) {
    return GetShortAdFromAds (
             Data,
             Offset,
             Length,
             (UDF_SHORT_ALLOCATION_DESCRIPTOR **)FoundAd
             );
  }
  ASSERT (FALSE);
  return EFI_DEVICE_ERROR;
}