\r
#include "Udf.h"\r
\r
+/**\r
+ Find the anchor volume descriptor pointer.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[out] AnchorPoint Anchor volume descriptor pointer.\r
+\r
+ @retval EFI_SUCCESS Anchor volume descriptor pointer found.\r
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+ @retval other Anchor volume descriptor pointer not found.\r
+\r
+**/\r
EFI_STATUS\r
FindAnchorVolumeDescriptorPointer (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
return EFI_VOLUME_CORRUPTED;\r
}\r
\r
+/**\r
+ Save the content of Logical Volume Descriptors and Partitions Descriptors in\r
+ memory.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[in] AnchorPoint Anchor volume descriptor pointer.\r
+ @param[out] Volume UDF volume information structure.\r
+\r
+ @retval EFI_SUCCESS The descriptors were saved.\r
+ @retval EFI_OUT_OF_RESOURCES The descriptors were not saved due to lack of\r
+ resources.\r
+ @retval other The descriptors were not saved due to\r
+ ReadDisk error.\r
+\r
+**/\r
EFI_STATUS\r
StartMainVolumeDescriptorSequence (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
return Status;\r
}\r
\r
-//\r
-// Return a Partition Descriptor given a Long Allocation Descriptor. This is\r
-// necessary to calculate the right extent (LongAd) offset which is added up\r
-// with partition's starting location.\r
-//\r
+/**\r
+ Return a Partition Descriptor given a Long Allocation Descriptor. This is\r
+ necessary to calculate the right extent (LongAd) offset which is added up\r
+ with partition's starting location.\r
+\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] LongAd Long Allocation Descriptor pointer.\r
+\r
+ @return A pointer to a Partition Descriptor.\r
+\r
+**/\r
UDF_PARTITION_DESCRIPTOR *\r
GetPdFromLongAd (\r
IN UDF_VOLUME_INFO *Volume,\r
return NULL;\r
}\r
\r
-//\r
-// Return logical sector number of a given Long Allocation Descriptor.\r
-//\r
+/**\r
+ Return logical sector number of a given Long Allocation Descriptor.\r
+\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] LongAd Long Allocation Descriptor pointer.\r
+\r
+ @return The logical sector number of a given Long Allocation Descriptor.\r
+\r
+**/\r
UINT64\r
GetLongAdLsn (\r
IN UDF_VOLUME_INFO *Volume,\r
LongAd->ExtentLocation.LogicalBlockNumber;\r
}\r
\r
-//\r
-// Return logical sector number of a given Short Allocation Descriptor.\r
-//\r
+/**\r
+ Return logical sector number of a given Short Allocation Descriptor.\r
+\r
+ @param[in] PartitionDesc Partition Descriptor pointer.\r
+ @param[in] ShortAd Short Allocation Descriptor pointer.\r
+\r
+ @return The logical sector number of a given Short Allocation Descriptor.\r
+\r
+**/\r
UINT64\r
GetShortAdLsn (\r
IN UDF_PARTITION_DESCRIPTOR *PartitionDesc,\r
ShortAd->ExtentPosition;\r
}\r
\r
-//\r
-// Find File Set Descriptor of a given Logical Volume Descriptor.\r
-//\r
-// The found FSD will contain the extent (LogicalVolumeContentsUse) where our\r
-// root directory is.\r
-//\r
+/**\r
+ Find File Set Descriptor of a given Logical Volume Descriptor.\r
+\r
+ The found FSD will contain the extent (LogicalVolumeContentsUse) where our\r
+ root directory is.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] LogicalVolDescNum Index of Logical Volume Descriptor\r
+ @param[out] FileSetDesc File Set Descriptor pointer.\r
+\r
+ @retval EFI_SUCCESS File Set Descriptor pointer found.\r
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+ @retval other File Set Descriptor pointer not found.\r
+\r
+**/\r
EFI_STATUS\r
FindFileSetDescriptor (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
return EFI_SUCCESS;\r
}\r
\r
-//\r
-// Get all File Set Descriptors for each Logical Volume Descriptor.\r
-//\r
+/**\r
+ Get all File Set Descriptors for each Logical Volume Descriptor.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[in, out] Volume Volume information pointer.\r
+\r
+ @retval EFI_SUCCESS File Set Descriptors were got.\r
+ @retval EFI_OUT_OF_RESOURCES File Set Descriptors were not got due to lack\r
+ of resources.\r
+ @retval other Error occured when finding File Set\r
+ Descriptor in Logical Volume Descriptor.\r
+\r
+**/\r
EFI_STATUS\r
GetFileSetDescriptors (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
return Status;\r
}\r
\r
-//\r
-// Read Volume and File Structure on an UDF file system.\r
-//\r
+/**\r
+ Read Volume and File Structure on an UDF file system.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[out] Volume Volume information pointer.\r
+\r
+ @retval EFI_SUCCESS Volume and File Structure were read.\r
+ @retval other Volume and File Structure were not read.\r
+\r
+**/\r
EFI_STATUS\r
ReadVolumeFileStructure (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
return Status;\r
}\r
\r
-//\r
-// Calculate length of a given File Identifier Descriptor.\r
-//\r
+/**\r
+ Calculate length of a given File Identifier Descriptor.\r
+\r
+ @param[in] FileIdentifierDesc File Identifier Descriptor pointer.\r
+\r
+ @return The length of a given File Identifier Descriptor.\r
+\r
+**/\r
UINT64\r
GetFidDescriptorLength (\r
IN UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc\r
);\r
}\r
\r
-//\r
-// Duplicate a given File Identifier Descriptor.\r
-//\r
+/**\r
+ Duplicate a given File Identifier Descriptor.\r
+\r
+ @param[in] FileIdentifierDesc File Identifier Descriptor pointer.\r
+ @param[out] NewFileIdentifierDesc The duplicated File Identifier Descriptor.\r
+\r
+**/\r
VOID\r
DuplicateFid (\r
IN UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc,\r
ASSERT (*NewFileIdentifierDesc != NULL);\r
}\r
\r
-//\r
-// Duplicate either a given File Entry or a given Extended File Entry.\r
-//\r
+/**\r
+ Duplicate either a given File Entry or a given Extended File Entry.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] FileEntry (Extended) File Entry pointer.\r
+ @param[out] NewFileEntry The duplicated (Extended) File Entry.\r
+\r
+**/\r
VOID\r
DuplicateFe (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
ASSERT (*NewFileEntry != NULL);\r
}\r
\r
-//\r
-// Get raw data + length of a given File Entry or Extended File Entry.\r
-//\r
-// The file's recorded data can contain either real file content (inline) or\r
-// a sequence of extents (or Allocation Descriptors) which tells where file's\r
-// content is stored in.\r
-//\r
-// NOTE: The FE/EFE can be thought it was an inode.\r
-//\r
+/**\r
+ Get raw data + length of a given File Entry or Extended File Entry.\r
+\r
+ The file's recorded data can contain either real file content (inline) or\r
+ a sequence of extents (or Allocation Descriptors) which tells where file's\r
+ content is stored in.\r
+\r
+ NOTE: The FE/EFE can be thought it was an inode.\r
+\r
+ @param[in] FileEntryData (Extended) File Entry pointer.\r
+ @param[out] Data Buffer contains the raw data of a given\r
+ (Extended) File Entry.\r
+ @param[out] Length Length of the data in Buffer.\r
+\r
+**/\r
VOID\r
GetFileEntryData (\r
IN VOID *FileEntryData,\r
}\r
}\r
\r
-//\r
-// Get Allocation Descriptors' data information from a given FE/EFE.\r
-//\r
+/**\r
+ Get Allocation Descriptors' data information from a given FE/EFE.\r
+\r
+ @param[in] FileEntryData (Extended) File Entry pointer.\r
+ @param[out] AdsData Buffer contains the Allocation Descriptors'\r
+ data from a given FE/EFE.\r
+ @param[out] Length Length of the data in AdsData.\r
+\r
+**/\r
VOID\r
GetAdsInformation (\r
IN VOID *FileEntryData,\r
}\r
}\r
\r
-//\r
-// Read next Long Allocation Descriptor from a given file's data.\r
-//\r
+/**\r
+ Read next Long Allocation Descriptor from a given file's data.\r
+\r
+ @param[in] Data File's data pointer.\r
+ @param[in,out] Offset Starting offset of the File's data to read.\r
+ @param[in] Length Length of the data to read.\r
+ @param[out] FoundLongAd Long Allocation Descriptor pointer.\r
+\r
+ @retval EFI_SUCCESS A Long Allocation Descriptor was found.\r
+ @retval EFI_DEVICE_ERROR No more Long Allocation Descriptors.\r
+\r
+**/\r
EFI_STATUS\r
GetLongAdFromAds (\r
IN VOID *Data,\r
return EFI_SUCCESS;\r
}\r
\r
-//\r
-// Read next Short Allocation Descriptor from a given file's data.\r
-//\r
+/**\r
+ Read next Short Allocation Descriptor from a given file's data.\r
+\r
+ @param[in] Data File's data pointer.\r
+ @param[in,out] Offset Starting offset of the File's data to read.\r
+ @param[in] Length Length of the data to read.\r
+ @param[out] FoundShortAd Short Allocation Descriptor pointer.\r
+\r
+ @retval EFI_SUCCESS A Short Allocation Descriptor was found.\r
+ @retval EFI_DEVICE_ERROR No more Short Allocation Descriptors.\r
+\r
+**/\r
EFI_STATUS\r
GetShortAdFromAds (\r
IN VOID *Data,\r
return EFI_SUCCESS;\r
}\r
\r
-//\r
-// Get either a Short Allocation Descriptor or a Long Allocation Descriptor from\r
-// file's data.\r
-//\r
+/**\r
+ Get either a Short Allocation Descriptor or a Long Allocation Descriptor from\r
+ file's data.\r
+\r
+ @param[in] RecordingFlags Flag to indicate the type of descriptor.\r
+ @param[in] Data File's data pointer.\r
+ @param[in,out] Offset Starting offset of the File's data to read.\r
+ @param[in] Length Length of the data to read.\r
+ @param[out] FoundAd Allocation Descriptor pointer.\r
+\r
+ @retval EFI_SUCCESS A Short Allocation Descriptor was found.\r
+ @retval EFI_DEVICE_ERROR No more Allocation Descriptors.\r
+ Invalid type of descriptor was given.\r
+\r
+**/\r
EFI_STATUS\r
GetAllocationDescriptor (\r
IN UDF_FE_RECORDING_FLAGS RecordingFlags,\r
return EFI_DEVICE_ERROR;\r
}\r
\r
-//\r
-// Return logical sector number of either Short or Long Allocation Descriptor.\r
-//\r
+/**\r
+ Return logical sector number of either Short or Long Allocation Descriptor.\r
+\r
+ @param[in] RecordingFlags Flag to indicate the type of descriptor.\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] ParentIcb Long Allocation Descriptor pointer.\r
+ @param[in] Ad Allocation Descriptor pointer.\r
+\r
+ @return The logical sector number of the given Allocation Descriptor.\r
+\r
+**/\r
UINT64\r
GetAllocationDescriptorLsn (\r
IN UDF_FE_RECORDING_FLAGS RecordingFlags,\r
return 0;\r
}\r
\r
-//\r
-// Return offset + length of a given indirect Allocation Descriptor (AED).\r
-//\r
+/**\r
+ Return offset + length of a given indirect Allocation Descriptor (AED).\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] ParentIcb Long Allocation Descriptor pointer.\r
+ @param[in] RecordingFlags Flag to indicate the type of descriptor.\r
+ @param[in] Ad Allocation Descriptor pointer.\r
+ @param[out] Offset Offset of a given indirect Allocation\r
+ Descriptor.\r
+ @param[out] Length Length of a given indirect Allocation\r
+ Descriptor.\r
+\r
+ @retval EFI_SUCCESS The offset and length were returned.\r
+ @retval EFI_OUT_OF_RESOURCES The offset and length were not returned due\r
+ to lack of resources.\r
+ @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
+ @retval other The offset and length were not returned.\r
+\r
+**/\r
EFI_STATUS\r
GetAedAdsOffset (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
return Status;\r
}\r
\r
-//\r
-// Read Allocation Extent Descriptor into memory.\r
-//\r
+/**\r
+ Read Allocation Extent Descriptor into memory.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] ParentIcb Long Allocation Descriptor pointer.\r
+ @param[in] RecordingFlags Flag to indicate the type of descriptor.\r
+ @param[in] Ad Allocation Descriptor pointer.\r
+ @param[out] Data Buffer that contains the Allocation Extent\r
+ Descriptor.\r
+ @param[out] Length Length of Data.\r
+\r
+ @retval EFI_SUCCESS The Allocation Extent Descriptor was read.\r
+ @retval EFI_OUT_OF_RESOURCES The Allocation Extent Descriptor was not read\r
+ due to lack of resources.\r
+ @retval other Fail to read the disk.\r
+\r
+**/\r
EFI_STATUS\r
GetAedAdsData (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
);\r
}\r
\r
-//\r
-// Function used to serialise reads of Allocation Descriptors.\r
-//\r
+/**\r
+ Function used to serialise reads of Allocation Descriptors.\r
+\r
+ @param[in] RecordingFlags Flag to indicate the type of descriptor.\r
+ @param[in] Ad Allocation Descriptor pointer.\r
+ @param[in, out] Buffer Buffer to hold the next Allocation Descriptor.\r
+ @param[in] Length Length of Buffer.\r
+\r
+ @retval EFI_SUCCESS Buffer was grown to hold the next Allocation\r
+ Descriptor.\r
+ @retval EFI_OUT_OF_RESOURCES Buffer was not grown due to lack of resources.\r
+\r
+**/\r
EFI_STATUS\r
GrowUpBufferToNextAd (\r
IN UDF_FE_RECORDING_FLAGS RecordingFlags,\r
return EFI_SUCCESS;\r
}\r
\r
-//\r
-// Read data or size of either a File Entry or an Extended File Entry.\r
-//\r
+/**\r
+ Read data or size of either a File Entry or an Extended File Entry.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] ParentIcb Long Allocation Descriptor pointer.\r
+ @param[in] FileEntryData FE/EFE structure pointer.\r
+ @param[in, out] ReadFileInfo Read file information pointer.\r
+\r
+ @retval EFI_SUCCESS Data or size of a FE/EFE was read.\r
+ @retval EFI_OUT_OF_RESOURCES Data or size of a FE/EFE was not read due to\r
+ lack of resources.\r
+ @retval EFI_INVALID_PARAMETER The read file flag given in ReadFileInfo is\r
+ invalid.\r
+ @retval EFI_UNSUPPORTED The FE recording flag given in FileEntryData\r
+ is not supported.\r
+ @retval other Data or size of a FE/EFE was not read.\r
+\r
+**/\r
EFI_STATUS\r
ReadFile (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
return Status;\r
}\r
\r
-//\r
-// Find a file by its filename from a given Parent file.\r
-//\r
+/**\r
+ Find a file by its filename from a given Parent file.\r
+\r
+ @param[in] BlockIo BlockIo interface.\r
+ @param[in] DiskIo DiskIo interface.\r
+ @param[in] Volume Volume information pointer.\r
+ @param[in] FileName File name string.\r
+ @param[in] Parent Parent directory file.\r
+ @param[in] Icb Long Allocation Descriptor pointer.\r
+ @param[out] File Found file.\r
+\r
+ @retval EFI_SUCCESS The file was found.\r
+ @retval EFI_INVALID_PARAMETER One or more input parameters are invalid.\r
+ @retval EFI_NOT_FOUND The file was not found.\r
+\r
+**/\r
EFI_STATUS\r
InternalFindFile (\r
IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
@param[in] FilePath File's absolute path.\r
@param[in] Root Root directory file.\r
@param[in] Parent Parent directory file.\r
+ @param[in] Icb ICB of Parent.\r
@param[out] File Found file.\r
\r
- @retval EFI_SUCCESS @p FilePath was found.\r
+ @retval EFI_SUCCESS FilePath was found.\r
@retval EFI_NO_MEDIA The device has no media.\r
@retval EFI_DEVICE_ERROR The device reported an error.\r
@retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
- @retval EFI_OUT_OF_RESOURCES The @p FilePath file was not found due to lack of\r
+ @retval EFI_OUT_OF_RESOURCES The FilePath file was not found due to lack of\r
resources.\r
\r
**/\r
@param[in] Volume UDF volume information structure.\r
@param[in] ParentIcb ICB of the parent file.\r
@param[in] FileEntryData FE/EFE of the parent file.\r
- @param[in out] ReadDirInfo Next read directory listing structure\r
+ @param[in, out] ReadDirInfo Next read directory listing structure\r
information.\r
@param[out] FoundFid File Identifier Descriptor pointer.\r
\r
@param[in] File File information structure.\r
@param[out] Size Size of the file.\r
\r
- @retval EFI_SUCCESS File size calculated and set in @p Size.\r
+ @retval EFI_SUCCESS File size calculated and set in Size.\r
@retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.\r
@retval EFI_NO_MEDIA The device has no media.\r
@retval EFI_DEVICE_ERROR The device reported an error.\r
@param[in] File File pointer.\r
@param[in] FileSize Size of the file.\r
@param[in] FileName Filename of the file.\r
- @param[in out] BufferSize Size of the returned file infomation.\r
+ @param[in, out] BufferSize Size of the returned file infomation.\r
@param[out] Buffer Data of the returned file information.\r
\r
@retval EFI_SUCCESS File information set.\r
@param[in] Volume UDF volume information structure.\r
@param[in] File File information structure.\r
@param[in] FileSize Size of the file.\r
- @param[in out] FilePosition File position.\r
- @param[in out] Buffer File data.\r
- @param[in out] BufferSize Read size.\r
+ @param[in, out] FilePosition File position.\r
+ @param[in, out] Buffer File data.\r
+ @param[in, out] BufferSize Read size.\r
\r
@retval EFI_SUCCESS File seeked and read.\r
@retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.\r