From nobody Thu Dec 26 01:50:15 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 1505451481179954.8096250087481; Thu, 14 Sep 2017 21:58:01 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 14C4921E97814; Thu, 14 Sep 2017 21:55:00 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 6A78B21E977FF for ; Thu, 14 Sep 2017 21:54:58 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:57:58 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:57:56 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114423" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:47 +0800 Message-Id: <20170915045753.588-2-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 1/7] MdeModulePkg/UdfDxe: Add checks to ensure no possible NULL ptr deref 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: Hao Wu , Ruiyu Ni , 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" Case 1 - Within DuplicateFid() & DuplicateFe(): The call to AllocateCopyPool() may return NULL. Add ASSERTs as checks. Case 2 - Within UdfRead(): Add ASSERT to ensure 'NewFileEntryData' returned from FindFileEntry() will not be NULL pointer. Case 3 - Within GetAllocationDescriptorLsn(): The return value of 'GetPdFromLongAd (Volume, ParentIcb)' may be NULL, and it will be passed into function GetShortAdLsn() which will dereference it. Add ASSERT in GetShortAdLsn() as check. Case 4 - Within ReadFile(): Add ASSERT to ensure 'Data' returned from GetAedAdsData() will not be NULL pointer. Case 5 - Within InternalFindFile(): If both 'Parent->FileIdentifierDesc' and 'Icb' are NULL, then possible NULL pointer dereference will happen in ReadDirectoryEntry(). Add additional check to resolve. Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Disk/UdfDxe/File.c | 1 + MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 18 +++++++++++= +++++++ 2 files changed, 19 insertions(+) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/File.c b/MdeModulePkg/Unive= rsal/Disk/UdfDxe/File.c index 01361141bb..82db75475b 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/File.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/File.c @@ -427,6 +427,7 @@ UdfRead ( if (EFI_ERROR (Status)) { goto Error_Find_Fe; } + ASSERT (NewFileEntryData !=3D NULL); =20 if (IS_FE_SYMLINK (NewFileEntryData)) { Status =3D ResolveSymlink ( diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 4609580b30..02a73a9eb9 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -297,6 +297,8 @@ GetShortAdLsn ( IN UDF_SHORT_ALLOCATION_DESCRIPTOR *ShortAd ) { + ASSERT (PartitionDesc !=3D NULL); + return (UINT64)PartitionDesc->PartitionStartingLocation + ShortAd->ExtentPosition; } @@ -480,6 +482,8 @@ DuplicateFid ( *NewFileIdentifierDesc =3D (UDF_FILE_IDENTIFIER_DESCRIPTOR *)AllocateCopyPool ( (UINTN) GetFidDescriptorLength (FileIdentifierDesc), FileIdentifierD= esc); + + ASSERT (*NewFileIdentifierDesc !=3D NULL); } =20 // @@ -494,6 +498,8 @@ DuplicateFe ( ) { *NewFileEntry =3D AllocateCopyPool (Volume->FileEntrySize, FileEntry); + + ASSERT (*NewFileEntry !=3D NULL); } =20 // @@ -1028,6 +1034,7 @@ ReadFile ( if (EFI_ERROR (Status)) { goto Error_Get_Aed; } + ASSERT (Data !=3D NULL); =20 AdOffset =3D 0; continue; @@ -1209,6 +1216,13 @@ InternalFindFile ( VOID *CompareFileEntry; =20 // + // Check if both Parent->FileIdentifierDesc and Icb are NULL. + // + if ((Parent->FileIdentifierDesc =3D=3D NULL) && (Icb =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + // // Check if parent file is really directory. // if (!IS_FE_DIRECTORY (Parent->FileEntry)) { @@ -1220,6 +1234,10 @@ InternalFindFile ( // FE/EFE and FID descriptors. // if (StrCmp (FileName, L".") =3D=3D 0) { + if (Parent->FileIdentifierDesc =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + DuplicateFe (BlockIo, Volume, Parent->FileEntry, &File->FileEntry); DuplicateFid (Parent->FileIdentifierDesc, &File->FileIdentifierDesc); =20 --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu Dec 26 01:50:15 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 1505451484106960.9381911921635; Thu, 14 Sep 2017 21:58:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 52BA921E97818; Thu, 14 Sep 2017 21:55:00 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 C41972007D1EB for ; Thu, 14 Sep 2017 21:54:59 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:57:59 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:57:58 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114429" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:48 +0800 Message-Id: <20170915045753.588-3-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 2/7] MdeModulePkg/UdfDxe: Fix operands of different size in bitwise OP 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: Hao Wu , Ruiyu Ni , 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" Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Disk/UdfDxe/File.c | 2 +- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/File.c b/MdeModulePkg/Unive= rsal/Disk/UdfDxe/File.c index 82db75475b..4c2cf67fa3 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/File.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/File.c @@ -806,7 +806,7 @@ UdfGetInfo ( } =20 if (Index < 128) { - *String |=3D *(UINT8 *)(OstaCompressed + Index); + *String |=3D (CHAR16)(*(UINT8 *)(OstaCompressed + Index)); } =20 // diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 02a73a9eb9..f63e7e660b 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -1782,7 +1782,7 @@ GetFileNameFromFid ( } =20 if (Index < Length) { - *FileName |=3D OstaCompressed[Index]; + *FileName |=3D (CHAR16)(OstaCompressed[Index]); } =20 FileName++; @@ -1918,7 +1918,7 @@ ResolveSymlink ( } =20 if (Index < Length) { - *C |=3D *(UINT8 *)((UINT8 *)PathComp->ComponentIdentifier + Inde= x); + *C |=3D (CHAR16)(*(UINT8 *)((UINT8 *)PathComp->ComponentIdentifi= er + Index)); } =20 C++; --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu Dec 26 01:50:15 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 1505451486864228.43451088867562; Thu, 14 Sep 2017 21:58:06 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9934F21E9781D; Thu, 14 Sep 2017 21:55:02 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 4F8B921E97813 for ; Thu, 14 Sep 2017 21:55:01 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:58:01 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:57:59 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114435" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:49 +0800 Message-Id: <20170915045753.588-4-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 3/7] MdeModulePkg/UdfDxe: Use compare operator for non-boolean comparisons 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: Ruiyu Ni , Eric Dong , Hao Wu , Dandan Bi , 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" Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index f63e7e660b..7c83830ec0 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -1255,7 +1255,7 @@ InternalFindFile ( BlockIo, DiskIo, Volume, - Parent->FileIdentifierDesc ? + (Parent->FileIdentifierDesc !=3D NULL) ? &Parent->FileIdentifierDesc->Icb : Icb, Parent->FileEntry, @@ -2117,7 +2117,7 @@ SetFileInfo ( // // Calculate the needed size for the EFI_FILE_INFO structure. // - FileInfoLength =3D sizeof (EFI_FILE_INFO) + (FileName ? + FileInfoLength =3D sizeof (EFI_FILE_INFO) + ((FileName !=3D NULL) ? StrSize (FileName) : sizeof (CHAR16)); if (*BufferSize < FileInfoLength) { --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu Dec 26 01:50:15 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 1505451489701731.7804579229218; Thu, 14 Sep 2017 21:58:09 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D4ECF21E9781F; Thu, 14 Sep 2017 21:55:04 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 2E78521E977FF for ; Thu, 14 Sep 2017 21:55:03 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:58:02 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:58:01 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114478" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:50 +0800 Message-Id: <20170915045753.588-5-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 4/7] MdeModulePkg/Udf: Refine function description comments 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: Ruiyu Ni , Eric Dong , Hao Wu , Dandan Bi , 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" Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c | 12 + MdeModulePkg/Universal/Disk/UdfDxe/File.c | 2 +- MdeModulePkg/Universal/Disk/UdfDxe/FileName.c | 27 +- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 375 ++++++++++= +++++----- MdeModulePkg/Universal/Disk/UdfDxe/Udf.h | 21 +- 5 files changed, 345 insertions(+), 92 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/= Universal/Disk/PartitionDxe/Udf.c index 7856b5dfc1..c566bfc594 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c @@ -40,6 +40,18 @@ UDF_DEVICE_PATH gUdfDevicePath =3D { } }; =20 +/** + Find the anchor volume descriptor pointer. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[out] AnchorPoint Anchor volume descriptor pointer. + + @retval EFI_SUCCESS Anchor volume descriptor pointer found. + @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. + @retval other Anchor volume descriptor pointer not fou= nd. + +**/ EFI_STATUS FindAnchorVolumeDescriptorPointer ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/File.c b/MdeModulePkg/Unive= rsal/Disk/UdfDxe/File.c index 4c2cf67fa3..625f2c5637 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/File.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/File.c @@ -861,7 +861,7 @@ UdfGetInfo ( /** Set information about a file. =20 - @param File Protocol instance pointer. + @param This Protocol instance pointer. @param InformationType Type of information in Buffer. @param BufferSize Size of buffer. @param Buffer The data to write. diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileName.c b/MdeModulePkg/U= niversal/Disk/UdfDxe/FileName.c index f73793320d..36551a4dba 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileName.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileName.c @@ -14,6 +14,14 @@ =20 #include "Udf.h" =20 +/** + Trim the leading and trailing spaces for a give Unicode string. + + @param[in] String The Unicode string to trim. + + @return A pointer to the trimmed string. + +**/ CHAR16 * TrimString ( IN CHAR16 *String @@ -35,6 +43,14 @@ TrimString ( return String; } =20 +/** + Replace the content of a Unicode string with the content of another Unic= ode + string. + + @param[in] Destination A pointer to a Unicode string. + @param[in] Source A pointer to a Unicode string. + +**/ VOID ReplaceLeft ( IN CHAR16 *Destination, @@ -49,6 +65,15 @@ ReplaceLeft ( } } =20 +/** + Remove one or more consecutive backslashes starting from the second char= acter + of a given Unicode string. + + @param[in] String A pointer to a Unicode string. + + @return A pointer to the modified string. + +**/ CHAR16 * ExcludeTrailingBackslashes ( IN CHAR16 *String @@ -85,7 +110,7 @@ Exit: =20 @param[in] FileName Filename. =20 - @retval @p FileName Filename mangled. + @retval The mangled Filename. =20 **/ CHAR16 * diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 7c83830ec0..8fcc508c41 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -14,6 +14,18 @@ =20 #include "Udf.h" =20 +/** + Find the anchor volume descriptor pointer. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[out] AnchorPoint Anchor volume descriptor pointer. + + @retval EFI_SUCCESS Anchor volume descriptor pointer found. + @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. + @retval other Anchor volume descriptor pointer not fou= nd. + +**/ EFI_STATUS FindAnchorVolumeDescriptorPointer ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -58,6 +70,22 @@ FindAnchorVolumeDescriptorPointer ( return EFI_VOLUME_CORRUPTED; } =20 +/** + Save the content of Logical Volume Descriptors and Partitions Descriptor= s in + memory. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in] AnchorPoint Anchor volume descriptor pointer. + @param[out] Volume UDF volume information structure. + + @retval EFI_SUCCESS The descriptors were saved. + @retval EFI_OUT_OF_RESOURCES The descriptors were not saved due to la= ck of + resources. + @retval other The descriptors were not saved due to + ReadDisk error. + +**/ EFI_STATUS StartMainVolumeDescriptorSequence ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -211,11 +239,17 @@ Error_Alloc_Pds: return Status; } =20 -// -// Return a Partition Descriptor given a Long Allocation Descriptor. This = is -// necessary to calculate the right extent (LongAd) offset which is added = up -// with partition's starting location. -// +/** + Return a Partition Descriptor given a Long Allocation Descriptor. This is + necessary to calculate the right extent (LongAd) offset which is added up + with partition's starting location. + + @param[in] Volume Volume information pointer. + @param[in] LongAd Long Allocation Descriptor pointer. + + @return A pointer to a Partition Descriptor. + +**/ UDF_PARTITION_DESCRIPTOR * GetPdFromLongAd ( IN UDF_VOLUME_INFO *Volume, @@ -270,9 +304,15 @@ GetPdFromLongAd ( return NULL; } =20 -// -// Return logical sector number of a given Long Allocation Descriptor. -// +/** + Return logical sector number of a given Long Allocation Descriptor. + + @param[in] Volume Volume information pointer. + @param[in] LongAd Long Allocation Descriptor pointer. + + @return The logical sector number of a given Long Allocation Descriptor. + +**/ UINT64 GetLongAdLsn ( IN UDF_VOLUME_INFO *Volume, @@ -288,9 +328,15 @@ GetLongAdLsn ( LongAd->ExtentLocation.LogicalBlockNumber; } =20 -// -// Return logical sector number of a given Short Allocation Descriptor. -// +/** + Return logical sector number of a given Short Allocation Descriptor. + + @param[in] PartitionDesc Partition Descriptor pointer. + @param[in] ShortAd Short Allocation Descriptor pointer. + + @return The logical sector number of a given Short Allocation Descriptor. + +**/ UINT64 GetShortAdLsn ( IN UDF_PARTITION_DESCRIPTOR *PartitionDesc, @@ -303,12 +349,23 @@ GetShortAdLsn ( ShortAd->ExtentPosition; } =20 -// -// Find File Set Descriptor of a given Logical Volume Descriptor. -// -// The found FSD will contain the extent (LogicalVolumeContentsUse) where = our -// root directory is. -// +/** + Find File Set Descriptor of a given Logical Volume Descriptor. + + The found FSD will contain the extent (LogicalVolumeContentsUse) where o= ur + root directory is. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in] Volume Volume information pointer. + @param[in] LogicalVolDescNum Index of Logical Volume Descriptor + @param[out] FileSetDesc File Set Descriptor pointer. + + @retval EFI_SUCCESS File Set Descriptor pointer found. + @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. + @retval other File Set Descriptor pointer not found. + +**/ EFI_STATUS FindFileSetDescriptor ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -349,9 +406,20 @@ FindFileSetDescriptor ( return EFI_SUCCESS; } =20 -// -// Get all File Set Descriptors for each Logical Volume Descriptor. -// +/** + Get all File Set Descriptors for each Logical Volume Descriptor. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in, out] Volume Volume information pointer. + + @retval EFI_SUCCESS File Set Descriptors were got. + @retval EFI_OUT_OF_RESOURCES File Set Descriptors were not got due to= lack + of resources. + @retval other Error occured when finding File Set + Descriptor in Logical Volume Descriptor. + +**/ EFI_STATUS GetFileSetDescriptors ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -414,9 +482,17 @@ Error_Alloc_Fsd: return Status; } =20 -// -// Read Volume and File Structure on an UDF file system. -// +/** + Read Volume and File Structure on an UDF file system. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[out] Volume Volume information pointer. + + @retval EFI_SUCCESS Volume and File Structure were read. + @retval other Volume and File Structure were not read. + +**/ EFI_STATUS ReadVolumeFileStructure ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -455,9 +531,14 @@ ReadVolumeFileStructure ( return Status; } =20 -// -// Calculate length of a given File Identifier Descriptor. -// +/** + Calculate length of a given File Identifier Descriptor. + + @param[in] FileIdentifierDesc File Identifier Descriptor pointer. + + @return The length of a given File Identifier Descriptor. + +**/ UINT64 GetFidDescriptorLength ( IN UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc @@ -470,9 +551,13 @@ GetFidDescriptorLength ( ); } =20 -// -// Duplicate a given File Identifier Descriptor. -// +/** + Duplicate a given File Identifier Descriptor. + + @param[in] FileIdentifierDesc File Identifier Descriptor pointer. + @param[out] NewFileIdentifierDesc The duplicated File Identifier Descri= ptor. + +**/ VOID DuplicateFid ( IN UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc, @@ -486,9 +571,15 @@ DuplicateFid ( ASSERT (*NewFileIdentifierDesc !=3D NULL); } =20 -// -// Duplicate either a given File Entry or a given Extended File Entry. -// +/** + Duplicate either a given File Entry or a given Extended File Entry. + + @param[in] BlockIo BlockIo interface. + @param[in] Volume Volume information pointer. + @param[in] FileEntry (Extended) File Entry pointer. + @param[out] NewFileEntry The duplicated (Extended) File Entry. + +**/ VOID DuplicateFe ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -502,15 +593,21 @@ DuplicateFe ( ASSERT (*NewFileEntry !=3D NULL); } =20 -// -// Get raw data + length of a given File Entry or Extended File Entry. -// -// The file's recorded data can contain either real file content (inline) = or -// a sequence of extents (or Allocation Descriptors) which tells where fil= e's -// content is stored in. -// -// NOTE: The FE/EFE can be thought it was an inode. -// +/** + Get raw data + length of a given File Entry or Extended File Entry. + + The file's recorded data can contain either real file content (inline) or + a sequence of extents (or Allocation Descriptors) which tells where file= 's + content is stored in. + + NOTE: The FE/EFE can be thought it was an inode. + + @param[in] FileEntryData (Extended) File Entry pointer. + @param[out] Data Buffer contains the raw data of a given + (Extended) File Entry. + @param[out] Length Length of the data in Buffer. + +**/ VOID GetFileEntryData ( IN VOID *FileEntryData, @@ -536,9 +633,15 @@ GetFileEntryData ( } } =20 -// -// Get Allocation Descriptors' data information from a given FE/EFE. -// +/** + Get Allocation Descriptors' data information from a given FE/EFE. + + @param[in] FileEntryData (Extended) File Entry pointer. + @param[out] AdsData Buffer contains the Allocation Descripto= rs' + data from a given FE/EFE. + @param[out] Length Length of the data in AdsData. + +**/ VOID GetAdsInformation ( IN VOID *FileEntryData, @@ -564,9 +667,18 @@ GetAdsInformation ( } } =20 -// -// Read next Long Allocation Descriptor from a given file's data. -// +/** + Read next Long Allocation Descriptor from a given file's data. + + @param[in] Data File's data pointer. + @param[in,out] Offset Starting offset of the File's data to re= ad. + @param[in] Length Length of the data to read. + @param[out] FoundLongAd Long Allocation Descriptor pointer. + + @retval EFI_SUCCESS A Long Allocation Descriptor was found. + @retval EFI_DEVICE_ERROR No more Long Allocation Descriptors. + +**/ EFI_STATUS GetLongAdFromAds ( IN VOID *Data, @@ -611,9 +723,18 @@ GetLongAdFromAds ( return EFI_SUCCESS; } =20 -// -// Read next Short Allocation Descriptor from a given file's data. -// +/** + Read next Short Allocation Descriptor from a given file's data. + + @param[in] Data File's data pointer. + @param[in,out] Offset Starting offset of the File's data to re= ad. + @param[in] Length Length of the data to read. + @param[out] FoundShortAd Short Allocation Descriptor pointer. + + @retval EFI_SUCCESS A Short Allocation Descriptor was found. + @retval EFI_DEVICE_ERROR No more Short Allocation Descriptors. + +**/ EFI_STATUS GetShortAdFromAds ( IN VOID *Data, @@ -658,10 +779,21 @@ GetShortAdFromAds ( return EFI_SUCCESS; } =20 -// -// Get either a Short Allocation Descriptor or a Long Allocation Descripto= r from -// file's data. -// +/** + Get either a Short Allocation Descriptor or a Long Allocation Descriptor= from + file's data. + + @param[in] RecordingFlags Flag to indicate the type of descriptor. + @param[in] Data File's data pointer. + @param[in,out] Offset Starting offset of the File's data to re= ad. + @param[in] Length Length of the data to read. + @param[out] FoundAd Allocation Descriptor pointer. + + @retval EFI_SUCCESS A Short Allocation Descriptor was found. + @retval EFI_DEVICE_ERROR No more Allocation Descriptors. + Invalid type of descriptor was given. + +**/ EFI_STATUS GetAllocationDescriptor ( IN UDF_FE_RECORDING_FLAGS RecordingFlags, @@ -690,9 +822,17 @@ GetAllocationDescriptor ( return EFI_DEVICE_ERROR; } =20 -// -// Return logical sector number of either Short or Long Allocation Descrip= tor. -// +/** + Return logical sector number of either Short or Long Allocation Descript= or. + + @param[in] RecordingFlags Flag to indicate the type of descriptor. + @param[in] Volume Volume information pointer. + @param[in] ParentIcb Long Allocation Descriptor pointer. + @param[in] Ad Allocation Descriptor pointer. + + @return The logical sector number of the given Allocation Descriptor. + +**/ UINT64 GetAllocationDescriptorLsn ( IN UDF_FE_RECORDING_FLAGS RecordingFlags, @@ -713,9 +853,27 @@ GetAllocationDescriptorLsn ( return 0; } =20 -// -// Return offset + length of a given indirect Allocation Descriptor (AED). -// +/** + Return offset + length of a given indirect Allocation Descriptor (AED). + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in] Volume Volume information pointer. + @param[in] ParentIcb Long Allocation Descriptor pointer. + @param[in] RecordingFlags Flag to indicate the type of descriptor. + @param[in] Ad Allocation Descriptor pointer. + @param[out] Offset Offset of a given indirect Allocation + Descriptor. + @param[out] Length Length of a given indirect Allocation + Descriptor. + + @retval EFI_SUCCESS The offset and length were returned. + @retval EFI_OUT_OF_RESOURCES The offset and length were not returned = due + to lack of resources. + @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. + @retval other The offset and length were not returned. + +**/ EFI_STATUS GetAedAdsOffset ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -784,9 +942,25 @@ Exit: return Status; } =20 -// -// Read Allocation Extent Descriptor into memory. -// +/** + Read Allocation Extent Descriptor into memory. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in] Volume Volume information pointer. + @param[in] ParentIcb Long Allocation Descriptor pointer. + @param[in] RecordingFlags Flag to indicate the type of descriptor. + @param[in] Ad Allocation Descriptor pointer. + @param[out] Data Buffer that contains the Allocation Exte= nt + Descriptor. + @param[out] Length Length of Data. + + @retval EFI_SUCCESS The Allocation Extent Descriptor was rea= d. + @retval EFI_OUT_OF_RESOURCES The Allocation Extent Descriptor was not= read + due to lack of resources. + @retval other Fail to read the disk. + +**/ EFI_STATUS GetAedAdsData ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -836,9 +1010,19 @@ GetAedAdsData ( ); } =20 -// -// Function used to serialise reads of Allocation Descriptors. -// +/** + Function used to serialise reads of Allocation Descriptors. + + @param[in] RecordingFlags Flag to indicate the type of descriptor. + @param[in] Ad Allocation Descriptor pointer. + @param[in, out] Buffer Buffer to hold the next Allocation Descr= iptor. + @param[in] Length Length of Buffer. + + @retval EFI_SUCCESS Buffer was grown to hold the next Alloca= tion + Descriptor. + @retval EFI_OUT_OF_RESOURCES Buffer was not grown due to lack of reso= urces. + +**/ EFI_STATUS GrowUpBufferToNextAd ( IN UDF_FE_RECORDING_FLAGS RecordingFlags, @@ -866,9 +1050,26 @@ GrowUpBufferToNextAd ( return EFI_SUCCESS; } =20 -// -// Read data or size of either a File Entry or an Extended File Entry. -// +/** + Read data or size of either a File Entry or an Extended File Entry. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in] Volume Volume information pointer. + @param[in] ParentIcb Long Allocation Descriptor pointer. + @param[in] FileEntryData FE/EFE structure pointer. + @param[in, out] ReadFileInfo Read file information pointer. + + @retval EFI_SUCCESS Data or size of a FE/EFE was read. + @retval EFI_OUT_OF_RESOURCES Data or size of a FE/EFE was not read du= e to + lack of resources. + @retval EFI_INVALID_PARAMETER The read file flag given in ReadFileInfo= is + invalid. + @retval EFI_UNSUPPORTED The FE recording flag given in FileEntry= Data + is not supported. + @retval other Data or size of a FE/EFE was not read. + +**/ EFI_STATUS ReadFile ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -1194,9 +1395,22 @@ Error_Get_Aed: return Status; } =20 -// -// Find a file by its filename from a given Parent file. -// +/** + Find a file by its filename from a given Parent file. + + @param[in] BlockIo BlockIo interface. + @param[in] DiskIo DiskIo interface. + @param[in] Volume Volume information pointer. + @param[in] FileName File name string. + @param[in] Parent Parent directory file. + @param[in] Icb Long Allocation Descriptor pointer. + @param[out] File Found file. + + @retval EFI_SUCCESS The file was found. + @retval EFI_INVALID_PARAMETER One or more input parameters are invalid. + @retval EFI_NOT_FOUND The file was not found. + +**/ EFI_STATUS InternalFindFile ( IN EFI_BLOCK_IO_PROTOCOL *BlockIo, @@ -1531,13 +1745,14 @@ Error_Read_Disk_Blk: @param[in] FilePath File's absolute path. @param[in] Root Root directory file. @param[in] Parent Parent directory file. + @param[in] Icb ICB of Parent. @param[out] File Found file. =20 - @retval EFI_SUCCESS @p FilePath was found. + @retval EFI_SUCCESS FilePath was found. @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 @p FilePath file was not found due to l= ack of + @retval EFI_OUT_OF_RESOURCES The FilePath file was not found due to lack= of resources. =20 **/ @@ -1658,7 +1873,7 @@ FindFile ( @param[in] Volume UDF volume information structure. @param[in] ParentIcb ICB of the parent file. @param[in] FileEntryData FE/EFE of the parent file. - @param[in out] ReadDirInfo Next read directory listing structure + @param[in, out] ReadDirInfo Next read directory listing structure information. @param[out] FoundFid File Identifier Descriptor pointer. =20 @@ -2043,7 +2258,7 @@ CleanupFileInformation ( @param[in] File File information structure. @param[out] Size Size of the file. =20 - @retval EFI_SUCCESS File size calculated and set in @p Size. + @retval EFI_SUCCESS File size calculated and set in Size. @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. @@ -2089,7 +2304,7 @@ GetFileSize ( @param[in] File File pointer. @param[in] FileSize Size of the file. @param[in] FileName Filename of the file. - @param[in out] BufferSize Size of the returned file infomation. + @param[in, out] BufferSize Size of the returned file infomation. @param[out] Buffer Data of the returned file information. =20 @retval EFI_SUCCESS File information set. @@ -2362,9 +2577,9 @@ GetVolumeSize ( @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. + @param[in, out] FilePosition File position. + @param[in, out] Buffer File data. + @param[in, out] BufferSize Read size. =20 @retval EFI_SUCCESS File seeked and read. @retval EFI_UNSUPPORTED Extended Allocation Descriptors not support= ed. diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h b/MdeModulePkg/Univer= sal/Disk/UdfDxe/Udf.h index 240d420ff5..641e0ae267 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h +++ b/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h @@ -659,7 +659,7 @@ UdfGetInfo ( /** Set information about a file. =20 - @param File Protocol instance pointer. + @param This Protocol instance pointer. @param InformationType Type of information in Buffer. @param BufferSize Size of buffer. @param Buffer The data to write. @@ -783,13 +783,14 @@ FindFileEntry ( @param[in] FilePath File's absolute path. @param[in] Root Root directory file. @param[in] Parent Parent directory file. + @param[in] Icb ICB of Parent. @param[out] File Found file. =20 - @retval EFI_SUCCESS @p FilePath was found. + @retval EFI_SUCCESS FilePath was found. @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 @p FilePath file was not found due to l= ack of + @retval EFI_OUT_OF_RESOURCES The FilePath file was not found due to lack= of resources. =20 **/ @@ -813,7 +814,7 @@ FindFile ( @param[in] Volume UDF volume information structure. @param[in] ParentIcb ICB of the parent file. @param[in] FileEntryData FE/EFE of the parent file. - @param[in out] ReadDirInfo Next read directory listing structure + @param[in, out] ReadDirInfo Next read directory listing structure information. @param[out] FoundFid File Identifier Descriptor pointer. =20 @@ -913,7 +914,7 @@ CleanupFileInformation ( @param[in] File File information structure. @param[out] Size Size of the file. =20 - @retval EFI_SUCCESS File size calculated and set in @p Size. + @retval EFI_SUCCESS File size calculated and set in Size. @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. @@ -937,7 +938,7 @@ GetFileSize ( @param[in] File File pointer. @param[in] FileSize Size of the file. @param[in] FileName Filename of the file. - @param[in out] BufferSize Size of the returned file infomation. + @param[in, out] BufferSize Size of the returned file infomation. @param[out] Buffer Data of the returned file information. =20 @retval EFI_SUCCESS File information set. @@ -991,9 +992,9 @@ GetVolumeSize ( @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. + @param[in, out] FilePosition File position. + @param[in, out] Buffer File data. + @param[in, out] BufferSize Read size. =20 @retval EFI_SUCCESS File seeked and read. @retval EFI_UNSUPPORTED Extended Allocation Descriptors not support= ed. @@ -1037,7 +1038,7 @@ SupportUdfFileSystem ( =20 @param[in] FileName Filename. =20 - @retval @p FileName Filename mangled. + @retval The mangled Filename. =20 **/ CHAR16 * --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu Dec 26 01:50:15 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 1505451492768854.3565029051092; Thu, 14 Sep 2017 21:58:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2158121EA35AB; Thu, 14 Sep 2017 21:55:06 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 A562121E97811 for ; Thu, 14 Sep 2017 21:55:04 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:58:04 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:58:03 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114486" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:51 +0800 Message-Id: <20170915045753.588-6-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 5/7] MdeModulePkg/UdfDxe: Avoid short (single character) variable name 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: Ruiyu Ni , Eric Dong , Hao Wu , Dandan Bi , 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" In ResolveSymlink(), replace the following variable: CHAR16 *C; with: CHAR16 *Char; Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 14 +++++++----= --- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 8fcc508c41..90862932fd 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -2045,7 +2045,7 @@ ResolveSymlink ( UDF_PATH_COMPONENT *PathComp; UINT8 PathCompLength; CHAR16 FileName[UDF_FILENAME_LENGTH]; - CHAR16 *C; + CHAR16 *Char; UINTN Index; UINT8 CompressionId; UDF_FILE_INFO PreviousFile; @@ -2122,24 +2122,24 @@ ResolveSymlink ( return EFI_VOLUME_CORRUPTED; } =20 - C =3D FileName; + Char =3D FileName; for (Index =3D 1; Index < PathCompLength; Index++) { if (CompressionId =3D=3D 16) { - *C =3D *(UINT8 *)((UINT8 *)PathComp->ComponentIdentifier + + *Char =3D *(UINT8 *)((UINT8 *)PathComp->ComponentIdentifier + Index) << 8; Index++; } else { - *C =3D 0; + *Char =3D 0; } =20 if (Index < Length) { - *C |=3D (CHAR16)(*(UINT8 *)((UINT8 *)PathComp->ComponentIdentifi= er + Index)); + *Char |=3D (CHAR16)(*(UINT8 *)((UINT8 *)PathComp->ComponentIdent= ifier + Index)); } =20 - C++; + Char++; } =20 - *C =3D L'\0'; + *Char =3D L'\0'; break; } =20 --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu Dec 26 01:50:15 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 1505451495551370.20455510890577; Thu, 14 Sep 2017 21:58:15 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5CAB621EA35AF; Thu, 14 Sep 2017 21:55:07 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 4ADA921EA35AF for ; Thu, 14 Sep 2017 21:55:06 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:58:05 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:58:04 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114498" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:52 +0800 Message-Id: <20170915045753.588-7-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 6/7] MdeModulePkg/Udf: Avoid declaring and initializing local GUID variable 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: Ruiyu Ni , Eric Dong , Hao Wu , Dandan Bi , 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" The local GUID variable 'UdfDevPathGuid', it has been initialized during its declaration. For better coding style, this commit uses a global variable instead. Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c | 8 ++++++-- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/= Universal/Disk/PartitionDxe/Udf.c index c566bfc594..609f56cef6 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c @@ -28,6 +28,11 @@ typedef struct { } UDF_DEVICE_PATH; =20 // +// Vendor-Defined Device Path GUID for UDF file system +// +EFI_GUID gUdfDevPathGuid =3D EFI_UDF_DEVICE_PATH_GUID; + +// // Vendor-Defined Media Device Path for UDF file system // UDF_DEVICE_PATH gUdfDevicePath =3D { @@ -260,7 +265,6 @@ PartitionInstallUdfChildHandles ( EFI_BLOCK_IO_MEDIA *Media; EFI_DEVICE_PATH_PROTOCOL *DevicePathNode; EFI_GUID *VendorDefinedGuid; - EFI_GUID UdfDevPathGuid =3D EFI_UDF_DEVICE_PATH_GUID; EFI_PARTITION_INFO_PROTOCOL PartitionInfo; =20 Media =3D BlockIo->Media; @@ -291,7 +295,7 @@ PartitionInstallUdfChildHandles ( if (DevicePathSubType (DevicePathNode) =3D=3D MEDIA_VENDOR_DP) { VendorDefinedGuid =3D (EFI_GUID *)((UINTN)DevicePathNode + OFFSET_OF (VENDOR_DEVICE_PATH, Gu= id)); - if (CompareGuid (VendorDefinedGuid, &UdfDevPathGuid)) { + if (CompareGuid (VendorDefinedGuid, &gUdfDevPathGuid)) { return EFI_NOT_FOUND; } } diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 90862932fd..dfbf6b3f95 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -14,6 +14,11 @@ =20 #include "Udf.h" =20 +// +// Vendor-Defined Device Path GUID for UDF file system +// +EFI_GUID gUdfDevPathGuid =3D EFI_UDF_DEVICE_PATH_GUID; + /** Find the anchor volume descriptor pointer. =20 @@ -2650,7 +2655,6 @@ SupportUdfFileSystem ( EFI_DEVICE_PATH_PROTOCOL *DevicePathNode; EFI_DEVICE_PATH_PROTOCOL *LastDevicePathNode; EFI_GUID *VendorDefinedGuid; - EFI_GUID UdfDevPathGuid =3D EFI_UDF_DEVICE_PATH_GUID; =20 // // Open Device Path protocol on ControllerHandle @@ -2687,7 +2691,7 @@ SupportUdfFileSystem ( DevicePathSubType (LastDevicePathNode) =3D=3D MEDIA_VENDOR_DP) { VendorDefinedGuid =3D (EFI_GUID *)((UINTN)LastDevicePathNode + OFFSET_OF (VENDOR_DEVICE_PATH, Guid)); - if (CompareGuid (VendorDefinedGuid, &UdfDevPathGuid)) { + if (CompareGuid (VendorDefinedGuid, &gUdfDevPathGuid)) { Status =3D EFI_SUCCESS; } } --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Thu Dec 26 01:50:15 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 1505451498143630.614097084; Thu, 14 Sep 2017 21:58:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9923A21EA35BC; Thu, 14 Sep 2017 21:55:08 -0700 (PDT) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 B657E21E977FF for ; Thu, 14 Sep 2017 21:55:07 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Sep 2017 21:58:07 -0700 Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga006.fm.intel.com with ESMTP; 14 Sep 2017 21:58:06 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,396,1500966000"; d="scan'208";a="152114505" From: Hao Wu To: edk2-devel@lists.01.org Date: Fri, 15 Sep 2017 12:57:53 +0800 Message-Id: <20170915045753.588-8-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20170915045753.588-1-hao.a.wu@intel.com> References: <20170915045753.588-1-hao.a.wu@intel.com> Subject: [edk2] [PATCH 7/7] MdeModulePkg/UdfDxe: Refine enum member naming style 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: Ruiyu Ni , Eric Dong , Hao Wu , Dandan Bi , 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" Similar to the naming style for variables, it's better for the name of members in a enum type to avoid using only upper-case letters. Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Cc: Dandan Bi Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu Reviewed-by: Paulo Alcantara Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 62 ++++++++++-= --------- MdeModulePkg/Universal/Disk/UdfDxe/Udf.h | 28 ++++----- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/Md= eModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index dfbf6b3f95..5df267761f 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -710,9 +710,9 @@ GetLongAdFromAds ( // If it's either an indirect AD (Extended Alllocation Descriptor) or = an // allocated AD, then return it. // - ExtentFlags =3D GET_EXTENT_FLAGS (LONG_ADS_SEQUENCE, LongAd); - if (ExtentFlags =3D=3D EXTENT_IS_NEXT_EXTENT || - ExtentFlags =3D=3D EXTENT_RECORDED_AND_ALLOCATED) { + ExtentFlags =3D GET_EXTENT_FLAGS (LongAdsSequence, LongAd); + if (ExtentFlags =3D=3D ExtentIsNextExtent || + ExtentFlags =3D=3D ExtentRecordedAndAllocated) { break; } =20 @@ -720,7 +720,7 @@ GetLongAdFromAds ( // This AD is either not recorded but allocated, or not recorded and n= ot // allocated. Skip it. // - *Offset +=3D AD_LENGTH (LONG_ADS_SEQUENCE); + *Offset +=3D AD_LENGTH (LongAdsSequence); } =20 *FoundLongAd =3D LongAd; @@ -766,9 +766,9 @@ GetShortAdFromAds ( // If it's either an indirect AD (Extended Alllocation Descriptor) or = an // allocated AD, then return it. // - ExtentFlags =3D GET_EXTENT_FLAGS (SHORT_ADS_SEQUENCE, ShortAd); - if (ExtentFlags =3D=3D EXTENT_IS_NEXT_EXTENT || - ExtentFlags =3D=3D EXTENT_RECORDED_AND_ALLOCATED) { + ExtentFlags =3D GET_EXTENT_FLAGS (ShortAdsSequence, ShortAd); + if (ExtentFlags =3D=3D ExtentIsNextExtent || + ExtentFlags =3D=3D ExtentRecordedAndAllocated) { break; } =20 @@ -776,7 +776,7 @@ GetShortAdFromAds ( // This AD is either not recorded but allocated, or not recorded and n= ot // allocated. Skip it. // - *Offset +=3D AD_LENGTH (SHORT_ADS_SEQUENCE); + *Offset +=3D AD_LENGTH (ShortAdsSequence); } =20 *FoundShortAd =3D ShortAd; @@ -808,14 +808,14 @@ GetAllocationDescriptor ( OUT VOID **FoundAd ) { - if (RecordingFlags =3D=3D LONG_ADS_SEQUENCE) { + if (RecordingFlags =3D=3D LongAdsSequence) { return GetLongAdFromAds ( Data, Offset, Length, (UDF_LONG_ALLOCATION_DESCRIPTOR **)FoundAd ); - } else if (RecordingFlags =3D=3D SHORT_ADS_SEQUENCE) { + } else if (RecordingFlags =3D=3D ShortAdsSequence) { return GetShortAdFromAds ( Data, Offset, @@ -846,9 +846,9 @@ GetAllocationDescriptorLsn ( IN VOID *Ad ) { - if (RecordingFlags =3D=3D LONG_ADS_SEQUENCE) { + if (RecordingFlags =3D=3D LongAdsSequence) { return GetLongAdLsn (Volume, (UDF_LONG_ALLOCATION_DESCRIPTOR *)Ad); - } else if (RecordingFlags =3D=3D SHORT_ADS_SEQUENCE) { + } else if (RecordingFlags =3D=3D ShortAdsSequence) { return GetShortAdLsn ( GetPdFromLongAd (Volume, ParentIcb), (UDF_SHORT_ALLOCATION_DESCRIPTOR *)Ad @@ -1115,8 +1115,8 @@ ReadFile ( Data =3D NULL; =20 switch (ReadFileInfo->Flags) { - case READ_FILE_GET_FILESIZE: - case READ_FILE_ALLOCATE_AND_READ: + case ReadFileGetFileSize: + case ReadFileAllocateAndRead: // // Initialise ReadFileInfo structure for either getting file size, or // reading file's recorded data. @@ -1124,7 +1124,7 @@ ReadFile ( ReadFileInfo->ReadLength =3D 0; ReadFileInfo->FileData =3D NULL; break; - case READ_FILE_SEEK_AND_READ: + case ReadFileSeekAndRead: // // About to seek a file and/or read its data. // @@ -1149,15 +1149,15 @@ ReadFile ( =20 RecordingFlags =3D GET_FE_RECORDING_FLAGS (FileEntryData); switch (RecordingFlags) { - case INLINE_DATA: + case InlineData: // // There are no extents for this FE/EFE. All data is inline. // GetFileEntryData (FileEntryData, &Data, &Length); =20 - if (ReadFileInfo->Flags =3D=3D READ_FILE_GET_FILESIZE) { + if (ReadFileInfo->Flags =3D=3D ReadFileGetFileSize) { ReadFileInfo->ReadLength =3D Length; - } else if (ReadFileInfo->Flags =3D=3D READ_FILE_ALLOCATE_AND_READ) { + } else if (ReadFileInfo->Flags =3D=3D ReadFileAllocateAndRead) { // // Allocate buffer for starting read data. // @@ -1171,7 +1171,7 @@ ReadFile ( // CopyMem (ReadFileInfo->FileData, Data, (UINTN) Length); ReadFileInfo->ReadLength =3D Length; - } else if (ReadFileInfo->Flags =3D=3D READ_FILE_SEEK_AND_READ) { + } else if (ReadFileInfo->Flags =3D=3D ReadFileSeekAndRead) { // // If FilePosition is non-zero, seek file to FilePosition, read // FileDataSize bytes and then updates FilePosition. @@ -1191,8 +1191,8 @@ ReadFile ( Status =3D EFI_SUCCESS; break; =20 - case LONG_ADS_SEQUENCE: - case SHORT_ADS_SEQUENCE: + case LongAdsSequence: + case ShortAdsSequence: // // This FE/EFE contains a run of Allocation Descriptors. Get data + si= ze // for start reading them out. @@ -1220,7 +1220,7 @@ ReadFile ( // Check if AD is an indirect AD. If so, read Allocation Extent // Descriptor and its extents (ADs). // - if (GET_EXTENT_FLAGS (RecordingFlags, Ad) =3D=3D EXTENT_IS_NEXT_EXTE= NT) { + if (GET_EXTENT_FLAGS (RecordingFlags, Ad) =3D=3D ExtentIsNextExtent)= { if (!DoFreeAed) { DoFreeAed =3D TRUE; } else { @@ -1254,10 +1254,10 @@ ReadFile ( Ad); =20 switch (ReadFileInfo->Flags) { - case READ_FILE_GET_FILESIZE: + case ReadFileGetFileSize: ReadFileInfo->ReadLength +=3D ExtentLength; break; - case READ_FILE_ALLOCATE_AND_READ: + case ReadFileAllocateAndRead: // // Increase FileData (if necessary) to read next extent. // @@ -1288,7 +1288,7 @@ ReadFile ( =20 ReadFileInfo->ReadLength +=3D ExtentLength; break; - case READ_FILE_SEEK_AND_READ: + case ReadFileSeekAndRead: // // Seek file first before reading in its data. // @@ -1364,7 +1364,7 @@ ReadFile ( } =20 break; - case EXTENDED_ADS_SEQUENCE: + case ExtendedAdsSequence: // FIXME: Not supported. Got no volume with it, yet. ASSERT (FALSE); Status =3D EFI_UNSUPPORTED; @@ -1388,7 +1388,7 @@ Done: =20 Error_Read_Disk_Blk: Error_Alloc_Buffer_To_Next_Ad: - if (ReadFileInfo->Flags !=3D READ_FILE_SEEK_AND_READ) { + if (ReadFileInfo->Flags !=3D ReadFileSeekAndRead) { FreePool (ReadFileInfo->FileData); } =20 @@ -1911,7 +1911,7 @@ ReadDirectoryEntry ( // 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. // - ReadFileInfo.Flags =3D READ_FILE_ALLOCATE_AND_READ; + ReadFileInfo.Flags =3D ReadFileAllocateAndRead; =20 Status =3D ReadFile ( BlockIo, @@ -2061,7 +2061,7 @@ ResolveSymlink ( // all its data here -- usually the data will be inline with the FE/EFE = for // lower filenames. // - ReadFileInfo.Flags =3D READ_FILE_ALLOCATE_AND_READ; + ReadFileInfo.Flags =3D ReadFileAllocateAndRead; =20 Status =3D ReadFile ( BlockIo, @@ -2284,7 +2284,7 @@ GetFileSize ( EFI_STATUS Status; UDF_READ_FILE_INFO ReadFileInfo; =20 - ReadFileInfo.Flags =3D READ_FILE_GET_FILESIZE; + ReadFileInfo.Flags =3D ReadFileGetFileSize; =20 Status =3D ReadFile ( BlockIo, @@ -2610,7 +2610,7 @@ ReadFileData ( EFI_STATUS Status; UDF_READ_FILE_INFO ReadFileInfo; =20 - ReadFileInfo.Flags =3D READ_FILE_SEEK_AND_READ; + ReadFileInfo.Flags =3D ReadFileSeekAndRead; ReadFileInfo.FilePosition =3D *FilePosition; ReadFileInfo.FileData =3D Buffer; ReadFileInfo.FileDataSize =3D *BufferSize; diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h b/MdeModulePkg/Univer= sal/Disk/UdfDxe/Udf.h index 641e0ae267..44c843fd4d 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h +++ b/MdeModulePkg/Universal/Disk/UdfDxe/Udf.h @@ -106,10 +106,10 @@ !IS_FID_PARENT_FILE (_Pointer))) =20 typedef enum { - SHORT_ADS_SEQUENCE, - LONG_ADS_SEQUENCE, - EXTENDED_ADS_SEQUENCE, - INLINE_DATA + ShortAdsSequence, + LongAdsSequence, + ExtendedAdsSequence, + InlineData } UDF_FE_RECORDING_FLAGS; =20 #define GET_FE_RECORDING_FLAGS(_Fe) \ @@ -118,26 +118,26 @@ typedef enum { sizeof (UDF_DESCRIPTOR_TAG)))->Flags & 0x07) =20 typedef enum { - EXTENT_RECORDED_AND_ALLOCATED, - EXTENT_NOT_RECORDED_BUT_ALLOCATED, - EXTENT_NOT_RECORDED_NOT_ALLOCATED, - EXTENT_IS_NEXT_EXTENT, + ExtentRecordedAndAllocated, + ExtentNotRecordedButAllocated, + ExtentNotRecordedNotAllocated, + ExtentIsNextExtent, } UDF_EXTENT_FLAGS; =20 #define AD_LENGTH(_RecFlags) \ - ((_RecFlags) =3D=3D SHORT_ADS_SEQUENCE ? \ + ((_RecFlags) =3D=3D ShortAdsSequence ? \ ((UINT64)(sizeof (UDF_SHORT_ALLOCATION_DESCRIPTOR))) : \ ((UINT64)(sizeof (UDF_LONG_ALLOCATION_DESCRIPTOR)))) =20 #define GET_EXTENT_FLAGS(_RecFlags, _Ad) \ - ((_RecFlags) =3D=3D SHORT_ADS_SEQUENCE ? \ + ((_RecFlags) =3D=3D ShortAdsSequence ? \ ((UDF_EXTENT_FLAGS)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->Extent= Length >> \ 30) & 0x3)) : \ ((UDF_EXTENT_FLAGS)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentL= ength >> \ 30) & 0x3))) =20 #define GET_EXTENT_LENGTH(_RecFlags, _Ad) \ - ((_RecFlags) =3D=3D SHORT_ADS_SEQUENCE ? \ + ((_RecFlags) =3D=3D ShortAdsSequence ? \ ((UINT32)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \ ~0xC0000000UL))) : \ ((UINT32)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \ @@ -169,9 +169,9 @@ typedef struct { #pragma pack() =20 typedef enum { - READ_FILE_GET_FILESIZE, - READ_FILE_ALLOCATE_AND_READ, - READ_FILE_SEEK_AND_READ, + ReadFileGetFileSize, + ReadFileAllocateAndRead, + ReadFileSeekAndRead, } UDF_READ_FILE_FLAGS; =20 typedef struct { --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel