From nobody Fri Dec 27 18:28:10 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1502220925473302.6230253324186; Tue, 8 Aug 2017 12:35:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1A9E221E11D7E; Tue, 8 Aug 2017 12:33:04 -0700 (PDT) Received: from mail.zytor.com (terminus.zytor.com [65.50.211.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A94B721E0C31A for ; Tue, 8 Aug 2017 12:33:02 -0700 (PDT) Received: from localhost.localdomain ([IPv6:2804:7f4:c480:4886:0:0:0:4]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id v78JWiKN019064 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 8 Aug 2017 12:33:03 -0700 X-Original-To: edk2-devel@lists.01.org From: Paulo Alcantara To: edk2-devel@lists.01.org Date: Tue, 8 Aug 2017 16:31:42 -0300 Message-Id: <20170808193143.18128-4-pcacjr@zytor.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170808193143.18128-1-pcacjr@zytor.com> References: <20170808193143.18128-1-pcacjr@zytor.com> Subject: [edk2] [PATCH 3/4] MdeModulePkg/UdfDxe: Add seek, read and listing support on files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Eric Dong , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch implements UdfRead(), UdfGetPosition() and UdfSetPosition() functions. Cc: Star Zeng Cc: Eric Dong Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Paulo Alcantara --- MdeModulePkg/Universal/Disk/UdfDxe/File.c | 264 +++++++++++++++++= +++- .../Universal/Disk/UdfDxe/FileSystemOperations.c | 102 ++++++-- MdeModulePkg/Universal/Disk/UdfDxe/Udf.h | 33 +++ 3 files changed, 371 insertions(+), 28 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/File.c b/MdeModulePkg/Unive= rsal/Disk/UdfDxe/File.c index dcb9ff2cf5..3b93beb3f8 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/File.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/File.c @@ -198,7 +198,7 @@ UdfOpen ( // // Build full path // - if (FileName[0] =3D=3D L'\\') { + if (*FileName =3D=3D L'\\') { StrCpyS (FilePath, UDF_PATH_LENGTH, FileName); } else { StrCpyS (FilePath, UDF_PATH_LENGTH, PrivFileData->AbsoluteFileName); @@ -247,6 +247,7 @@ UdfOpen ( } =20 StrCpyS (NewPrivFileData->FileName, UDF_PATH_LENGTH, FileName); + Status =3D GetFileSize ( PrivFsData->BlockIo, PrivFsData->DiskIo, @@ -308,7 +309,197 @@ UdfRead ( OUT VOID *Buffer ) { - return EFI_VOLUME_CORRUPTED; + EFI_TPL OldTpl; + EFI_STATUS Status; + PRIVATE_UDF_FILE_DATA *PrivFileData; + PRIVATE_UDF_SIMPLE_FS_DATA *PrivFsData; + UDF_VOLUME_INFO *Volume; + UDF_FILE_INFO *Parent; + UDF_READ_DIRECTORY_INFO *ReadDirInfo; + EFI_BLOCK_IO_PROTOCOL *BlockIo; + EFI_DISK_IO_PROTOCOL *DiskIo; + UDF_FILE_INFO FoundFile; + UDF_FILE_IDENTIFIER_DESCRIPTOR *NewFileIdentifierDesc; + VOID *NewFileEntryData; + CHAR16 FileName[UDF_FILENAME_LENGTH] =3D { 0 }; + UINT64 FileSize; + + OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); + + if (This =3D=3D NULL || BufferSize =3D=3D NULL || (*BufferSize !=3D 0 && + Buffer =3D=3D NULL)) { + Status =3D EFI_INVALID_PARAMETER; + goto Error_Invalid_Params; + } + + PrivFileData =3D PRIVATE_UDF_FILE_DATA_FROM_THIS (This); + + PrivFsData =3D PRIVATE_UDF_SIMPLE_FS_DATA_FROM_THIS (PrivFileData->Simpl= eFs); + + BlockIo =3D PrivFsData->BlockIo; + DiskIo =3D PrivFsData->DiskIo; + Volume =3D &PrivFsData->Volume; + ReadDirInfo =3D &PrivFileData->ReadDirInfo; + NewFileIdentifierDesc =3D NULL; + NewFileEntryData =3D NULL; + + Parent =3D _PARENT_FILE (PrivFileData); + + Status =3D EFI_VOLUME_CORRUPTED; + + if (IS_FID_NORMAL_FILE (Parent->FileIdentifierDesc)) { + if (PrivFileData->FilePosition > PrivFileData->FileSize) { + // + // File's position is beyond the EOF + // + Status =3D EFI_DEVICE_ERROR; + goto Error_File_Beyond_The_Eof; + } + + if (PrivFileData->FilePosition =3D=3D PrivFileData->FileSize) { + *BufferSize =3D 0; + Status =3D EFI_SUCCESS; + goto Done; + } + + Status =3D ReadFileData ( + BlockIo, + DiskIo, + Volume, + Parent, + PrivFileData->FileSize, + &PrivFileData->FilePosition, + Buffer, + BufferSize + ); + } else if (IS_FID_DIRECTORY_FILE (Parent->FileIdentifierDesc)) { + if (ReadDirInfo->FidOffset =3D=3D 0 && PrivFileData->FilePosition > 0)= { + Status =3D EFI_DEVICE_ERROR; + *BufferSize =3D 0; + goto Done; + } + + for (;;) { + Status =3D ReadDirectoryEntry ( + BlockIo, + DiskIo, + Volume, + &Parent->FileIdentifierDesc->Icb, + Parent->FileEntry, + ReadDirInfo, + &NewFileIdentifierDesc + ); + if (EFI_ERROR (Status)) { + if (Status =3D=3D EFI_DEVICE_ERROR) { + FreePool (ReadDirInfo->DirectoryData); + ZeroMem ((VOID *)ReadDirInfo, sizeof (UDF_READ_DIRECTORY_INFO)); + + *BufferSize =3D 0; + Status =3D EFI_SUCCESS; + } + + goto Done; + } + + if (!IS_FID_PARENT_FILE (NewFileIdentifierDesc)) { + break; + } + + FreePool ((VOID *)NewFileIdentifierDesc); + } + + Status =3D FindFileEntry ( + BlockIo, + DiskIo, + Volume, + &NewFileIdentifierDesc->Icb, + &NewFileEntryData + ); + if (EFI_ERROR (Status)) { + goto Error_Find_Fe; + } + + if (IS_FE_SYMLINK (NewFileEntryData)) { + Status =3D ResolveSymlink ( + BlockIo, + DiskIo, + Volume, + Parent, + NewFileEntryData, + &FoundFile + ); + if (EFI_ERROR (Status)) { + goto Error_Resolve_Symlink; + } + + FreePool ((VOID *)NewFileEntryData); + NewFileEntryData =3D FoundFile.FileEntry; + + Status =3D GetFileNameFromFid (NewFileIdentifierDesc, FileName); + if (EFI_ERROR (Status)) { + FreePool ((VOID *)FoundFile.FileIdentifierDesc); + goto Error_Get_FileName; + } + + FreePool ((VOID *)NewFileIdentifierDesc); + NewFileIdentifierDesc =3D FoundFile.FileIdentifierDesc; + } else { + FoundFile.FileIdentifierDesc =3D NewFileIdentifierDesc; + FoundFile.FileEntry =3D NewFileEntryData; + + Status =3D GetFileNameFromFid (FoundFile.FileIdentifierDesc, FileNam= e); + if (EFI_ERROR (Status)) { + goto Error_Get_FileName; + } + } + + Status =3D GetFileSize ( + BlockIo, + DiskIo, + Volume, + &FoundFile, + &FileSize + ); + if (EFI_ERROR (Status)) { + goto Error_Get_File_Size; + } + + Status =3D SetFileInfo ( + &FoundFile, + FileSize, + FileName, + BufferSize, + Buffer + ); + if (EFI_ERROR (Status)) { + goto Error_Set_File_Info; + } + + PrivFileData->FilePosition++; + Status =3D EFI_SUCCESS; + } else if (IS_FID_DELETED_FILE (Parent->FileIdentifierDesc)) { + Status =3D EFI_DEVICE_ERROR; + } + +Error_Set_File_Info: +Error_Get_File_Size: +Error_Get_FileName: +Error_Resolve_Symlink: + if (NewFileEntryData !=3D NULL) { + FreePool (NewFileEntryData); + } + +Error_Find_Fe: + if (NewFileIdentifierDesc !=3D NULL) { + FreePool ((VOID *)NewFileIdentifierDesc); + } + +Done: +Error_File_Beyond_The_Eof: +Error_Invalid_Params: + gBS->RestoreTPL (OldTpl); + + return Status; } =20 /** @@ -346,7 +537,7 @@ UdfClose ( if (!PrivFileData->IsRootDirectory) { CleanupFileInformation (&PrivFileData->File); =20 - if (PrivFileData->ReadDirInfo.DirectoryData) { + if (PrivFileData->ReadDirInfo.DirectoryData !=3D NULL) { FreePool (PrivFileData->ReadDirInfo.DirectoryData); } } @@ -439,7 +630,28 @@ UdfGetPosition ( OUT UINT64 *Position ) { - return EFI_UNSUPPORTED; + PRIVATE_UDF_FILE_DATA *PrivFileData; + + if (This =3D=3D NULL || Position =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + PrivFileData =3D PRIVATE_UDF_FILE_DATA_FROM_THIS (This); + + // + // As per UEFI spec, if the file handle is a directory, then the current= file + // position has no meaning and the operation is not supported. + // + if (IS_FID_DIRECTORY_FILE (&PrivFileData->File.FileIdentifierDesc)) { + return EFI_UNSUPPORTED; + } + + // + // The file is not a directory. So, return its position. + // + *Position =3D PrivFileData->FilePosition; + + return EFI_SUCCESS; } =20 /** @@ -459,7 +671,45 @@ UdfSetPosition ( IN UINT64 Position ) { - return EFI_UNSUPPORTED; + EFI_STATUS Status; + PRIVATE_UDF_FILE_DATA *PrivFileData; + UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc; + + if (This =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + Status =3D EFI_UNSUPPORTED; + + PrivFileData =3D PRIVATE_UDF_FILE_DATA_FROM_THIS (This); + + FileIdentifierDesc =3D PrivFileData->File.FileIdentifierDesc; + if (IS_FID_DIRECTORY_FILE (FileIdentifierDesc)) { + // + // If the file handle is a directory, the _only_ position that may be = set is + // zero. This has no effect of starting the read proccess of the direc= tory + // entries over. + // + if (Position =3D=3D 0) { + PrivFileData->FilePosition =3D Position; + PrivFileData->ReadDirInfo.FidOffset =3D 0; + Status =3D EFI_SUCCESS; + } + } else if (IS_FID_NORMAL_FILE (FileIdentifierDesc)) { + // + // Seeking to position 0xFFFFFFFFFFFFFFFF causes the current position = to be + // set to the EOF. + // + if (Position =3D=3D 0xFFFFFFFFFFFFFFFF) { + PrivFileData->FilePosition =3D PrivFileData->FileSize - 1; + } else { + PrivFileData->FilePosition =3D Position; + } + + Status =3D EFI_SUCCESS; + } + + return Status; } =20 /** @@ -505,7 +755,7 @@ UdfGetInfo ( UINT64 FreeSpaceSize; CHAR16 VolumeLabel[64]; =20 - if (This =3D=3D NULL || InformationType =3D=3D NULL || BufferSize =3D=3D= 0 || + if (This =3D=3D NULL || InformationType =3D=3D NULL || BufferSize =3D=3D= NULL || (*BufferSize !=3D 0 && Buffer =3D=3D NULL)) { return EFI_INVALID_PARAMETER; } @@ -553,7 +803,7 @@ UdfGetInfo ( // NULL-terminated OSTA compressed format, so we must check for the = NULL // character. // - if (!*String) { + if (*String =3D=3D L'\0') { break; } =20 diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 2f7f945479..65cf8dc057 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -384,7 +384,7 @@ GetFileSetDescriptors ( =20 for (Index =3D 0; Index < Volume->LogicalVolDescsNo; Index++) { FileSetDesc =3D AllocateZeroPool (sizeof (UDF_FILE_SET_DESCRIPTOR)); - if (!FileSetDesc) { + if (FileSetDesc =3D=3D NULL) { Status =3D EFI_OUT_OF_RESOURCES; goto Error_Alloc_Fsd; } @@ -533,13 +533,13 @@ GetFileEntryData ( ExtendedFileEntry =3D (UDF_EXTENDED_FILE_ENTRY *)FileEntryData; =20 *Length =3D ExtendedFileEntry->InformationLength; - *Data =3D (VOID *)((UINT8 *)&ExtendedFileEntry->Data[0] + + *Data =3D (VOID *)((UINT8 *)ExtendedFileEntry->Data + ExtendedFileEntry->LengthOfExtendedAttributes); } else if (IS_FE (FileEntryData)) { FileEntry =3D (UDF_FILE_ENTRY *)FileEntryData; =20 *Length =3D FileEntry->InformationLength; - *Data =3D (VOID *)((UINT8 *)&FileEntry->Data[0] + + *Data =3D (VOID *)((UINT8 *)FileEntry->Data + FileEntry->LengthOfExtendedAttributes); } } @@ -561,13 +561,13 @@ GetAdsInformation ( ExtendedFileEntry =3D (UDF_EXTENDED_FILE_ENTRY *)FileEntryData; =20 *Length =3D ExtendedFileEntry->LengthOfAllocationDescriptors; - *AdsData =3D (VOID *)((UINT8 *)&ExtendedFileEntry->Data[0] + + *AdsData =3D (VOID *)((UINT8 *)ExtendedFileEntry->Data + ExtendedFileEntry->LengthOfExtendedAttributes); } else if (IS_FE (FileEntryData)) { FileEntry =3D (UDF_FILE_ENTRY *)FileEntryData; =20 *Length =3D FileEntry->LengthOfAllocationDescriptors; - *AdsData =3D (VOID *)((UINT8 *)&FileEntry->Data[0] + + *AdsData =3D (VOID *)((UINT8 *)FileEntry->Data + FileEntry->LengthOfExtendedAttributes); } } @@ -955,7 +955,7 @@ ReadFile ( // Allocate buffer for starting read data. // ReadFileInfo->FileData =3D AllocatePool (Length); - if (!ReadFileInfo->FileData) { + if (ReadFileInfo->FileData =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } =20 @@ -1135,7 +1135,7 @@ ReadFile ( ReadFileInfo->FilePosition +=3D DataLength; =20 BytesLeft -=3D DataLength; - if (!BytesLeft) { + if (BytesLeft =3D=3D 0) { // // There is no more file data to read. // @@ -1155,7 +1155,8 @@ ReadFile ( =20 break; case EXTENDED_ADS_SEQUENCE: - // Not supported. Haven't got a volume with that yet. + // FIXME: Not supported. Got no volume with it, yet. + ASSERT (FALSE); Status =3D EFI_UNSUPPORTED; break; } @@ -1214,7 +1215,7 @@ InternalFindFile ( // If FileName is current file or working directory, just duplicate Pare= nt's // FE/EFE and FID descriptors. // - if (!StrCmp (FileName, L".")) { + if (StrCmp (FileName, L".") =3D=3D 0) { DuplicateFe (BlockIo, Volume, Parent->FileEntry, &File->FileEntry); DuplicateFid (Parent->FileIdentifierDesc, &File->FileIdentifierDesc); =20 @@ -1254,7 +1255,7 @@ InternalFindFile ( // directory (Parent), and if FileName is either ".." or "\\", then = it's // the expected FID. // - if (!StrCmp (FileName, L"..") || !StrCmp (FileName, L"\\")) { + if (StrCmp (FileName, L"..") =3D=3D 0 || StrCmp (FileName, L"\\") = =3D=3D 0) { Found =3D TRUE; break; } @@ -1268,14 +1269,14 @@ InternalFindFile ( } =20 // - // OK - their filename lengths match. Now, compare if their filename= s. + // OK - their filename lengths match. Now, compare their characters. // Status =3D GetFileNameFromFid (FileIdentifierDesc, FoundFileName); if (EFI_ERROR (Status)) { break; } =20 - if (!StrCmp (FileName, FoundFileName)) { + if (StrCmp (FileName, FoundFileName) =3D=3D 0) { // // FID has been found. Prepare to find its respective FE/EFE. // @@ -1288,7 +1289,7 @@ InternalFindFile ( FreePool ((VOID *)FileIdentifierDesc); } =20 - if (ReadDirInfo.DirectoryData) { + if (ReadDirInfo.DirectoryData !=3D NULL) { // // Free all allocated resources for the directory listing. // @@ -1306,7 +1307,7 @@ InternalFindFile ( // // Otherwise, find FE/EFE from the respective FID. // - if (StrCmp (FileName, L"\\")) { + if (StrCmp (FileName, L"\\") !=3D 0) { Status =3D FindFileEntry ( BlockIo, DiskIo, @@ -1685,7 +1686,7 @@ FindFile ( // // Open root directory. // - if (!Root) { + if (Root =3D=3D NULL) { // // There is no file found for the root directory yet. So, find onl= y its // FID by now. @@ -1798,7 +1799,7 @@ ReadDirectoryEntry ( UDF_READ_FILE_INFO ReadFileInfo; UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc; =20 - if (!ReadDirInfo->DirectoryData) { + if (ReadDirInfo->DirectoryData =3D=3D NULL) { // // The directory's recorded data has not been read yet. So let's cache= it // into memory and the next calls won't need to read it again. @@ -1873,7 +1874,7 @@ GetFileNameFromFid ( =20 OstaCompressed =3D (UINT8 *)( - (UINT8 *)&FileIdentifierDesc->Data[0] + + (UINT8 *)FileIdentifierDesc->Data + FileIdentifierDesc->LengthOfImplementationUse ); =20 @@ -2235,8 +2236,7 @@ SetFileInfo ( // FileInfoLength =3D sizeof (EFI_FILE_INFO) + (FileName ? StrSize (FileName) : - sizeof (CHAR16) - ); + sizeof (CHAR16)); if (*BufferSize < FileInfoLength) { // // The given Buffer has no size enough for EFI_FILE_INFO structure. @@ -2434,7 +2434,7 @@ GetVolumeSize ( =20 Length =3D LogicalVolInt->NumberOfPartitions; for (Index =3D 0; Index < Length; Index +=3D sizeof (UINT32)) { - LsnsNo =3D *(UINT32 *)((UINT8 *)&LogicalVolInt->Data[0] + Index); + LsnsNo =3D *(UINT32 *)((UINT8 *)LogicalVolInt->Data + Index); if (LsnsNo =3D=3D 0xFFFFFFFFUL) { // // Size not specified. @@ -2447,7 +2447,7 @@ GetVolumeSize ( =20 Length =3D (LogicalVolInt->NumberOfPartitions * sizeof (UINT32)) << 1; for (; Index < Length; Index +=3D sizeof (UINT32)) { - LsnsNo =3D *(UINT32 *)((UINT8 *)&LogicalVolInt->Data[0] + Index); + LsnsNo =3D *(UINT32 *)((UINT8 *)LogicalVolInt->Data + Index); if (LsnsNo =3D=3D 0xFFFFFFFFUL) { // // Size not specified. @@ -2470,3 +2470,63 @@ GetVolumeSize ( =20 return EFI_SUCCESS; } + +/** + Seek a file and read its data into memory on an UDF volume. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in] Volume UDF volume information structure. + @param[in] File File information structure. + @param[in] FileSize Size of the file. + @param[in out] FilePosition File position. + @param[in out] Buffer File data. + @param[in out] BufferSize Read size. + + @retval EFI_SUCCESS File seeked and read. + @retval EFI_UNSUPPORTED Extended Allocation Descriptors not support= ed. + @retval EFI_NO_MEDIA The device has no media. + @retval EFI_DEVICE_ERROR The device reported an error. + @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. + @retval EFI_OUT_OF_RESOURCES The file's recorded data was not read due t= o lack + of resources. + +**/ +EFI_STATUS +ReadFileData ( + IN EFI_BLOCK_IO_PROTOCOL *BlockIo, + IN EFI_DISK_IO_PROTOCOL *DiskIo, + IN UDF_VOLUME_INFO *Volume, + IN UDF_FILE_INFO *File, + IN UINT64 FileSize, + IN OUT UINT64 *FilePosition, + IN OUT VOID *Buffer, + IN OUT UINT64 *BufferSize + ) +{ + EFI_STATUS Status; + UDF_READ_FILE_INFO ReadFileInfo; + + ReadFileInfo.Flags =3D READ_FILE_SEEK_AND_READ; + ReadFileInfo.FilePosition =3D *FilePosition; + ReadFileInfo.FileData =3D Buffer; + ReadFileInfo.FileDataSize =3D *BufferSize; + ReadFileInfo.FileSize =3D FileSize; + + Status =3D ReadFile ( + BlockIo, + DiskIo, + Volume, + &File->FileIdentifierDesc->Icb, + File->FileEntry, + &ReadFileInfo + ); + if (EFI_ERROR (Status)) { + return Status; + } + + *BufferSize =3D ReadFileInfo.FileDataSize; + *FilePosition =3D ReadFileInfo.FilePosition; + + return EFI_SUCCESS; +} diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h b/MdeModulePkg/Univer= sal/Disk/UdfDxe/Udf.h index 37d7c613e1..ccea385e22 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h +++ b/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h @@ -1032,6 +1032,39 @@ GetVolumeSize ( ); =20 /** + Seek a file and read its data into memory on an UDF volume. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in] Volume UDF volume information structure. + @param[in] File File information structure. + @param[in] FileSize Size of the file. + @param[in out] FilePosition File position. + @param[in out] Buffer File data. + @param[in out] BufferSize Read size. + + @retval EFI_SUCCESS File seeked and read. + @retval EFI_UNSUPPORTED Extended Allocation Descriptors not support= ed. + @retval EFI_NO_MEDIA The device has no media. + @retval EFI_DEVICE_ERROR The device reported an error. + @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. + @retval EFI_OUT_OF_RESOURCES The file's recorded data was not read due t= o lack + of resources. + +**/ +EFI_STATUS +ReadFileData ( + IN EFI_BLOCK_IO_PROTOCOL *BlockIo, + IN EFI_DISK_IO_PROTOCOL *DiskIo, + IN UDF_VOLUME_INFO *Volume, + IN UDF_FILE_INFO *File, + IN UINT64 FileSize, + IN OUT UINT64 *FilePosition, + IN OUT VOID *Buffer, + IN OUT UINT64 *BufferSize + ); + +/** Mangle a filename by cutting off trailing whitespaces, "\\", "." and "..= ". =20 @param[in] FileName Filename. --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel