[edk2-devel] [PATCH v5 30/38] MdePkg/IndustryStandard: PeImage.h: Import DLL characteristics

Ard Biesheuvel posted 38 patches 1 year, 7 months ago
[edk2-devel] [PATCH v5 30/38] MdePkg/IndustryStandard: PeImage.h: Import DLL characteristics
Posted by Ard Biesheuvel 1 year, 7 months ago
Add the various symbolic constants that the PE/COFF spec v8.3 defines
for the DllCharacteristics field of the PE optional header as
preprocessor macros so we can test for them in C code.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 MdePkg/Include/IndustryStandard/PeImage.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/MdePkg/Include/IndustryStandard/PeImage.h b/MdePkg/Include/IndustryStandard/PeImage.h
index dd4cc25483bc..f8d726b88353 100644
--- a/MdePkg/Include/IndustryStandard/PeImage.h
+++ b/MdePkg/Include/IndustryStandard/PeImage.h
@@ -108,6 +108,21 @@ typedef struct {
 #define EFI_IMAGE_FILE_DLL                  BIT13    ///< 0x2000  File is a DLL.
 #define EFI_IMAGE_FILE_BYTES_REVERSED_HI    BIT15    ///< 0x8000  Bytes of machine word are reversed.
 
+///
+/// DLL Characteristics
+///
+#define EFI_IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA        BIT5   ///< 0x0020 Image can handle a high entropy 64-bit VA space.
+#define EFI_IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE           BIT6   ///< 0x0040 DLL can be relocated at load time.
+#define EFI_IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY        BIT7   ///< 0x0080 Code Integrity checks are enforced.
+#define EFI_IMAGE_DLLCHARACTERISTICS_NX_COMPAT              BIT8   ///< 0x0100 Image is NX compatible.
+#define EFI_IMAGE_DLLCHARACTERISTICS_NO_ISOLATION           BIT9   ///< 0x0200 Isolation aware, but do not isolate the image.
+#define EFI_IMAGE_DLLCHARACTERISTICS_NO_SEH                 BIT10  ///< 0x0400 Does not use structured exception (SE) handling.
+#define EFI_IMAGE_DLLCHARACTERISTICS_NO_BIND                BIT11  ///< 0x0800 Do not bind the image.
+#define EFI_IMAGE_DLLCHARACTERISTICS_APPCONTAINER           BIT12  ///< 0x1000 Image must execute in an AppContainer.
+#define EFI_IMAGE_DLLCHARACTERISTICS_WDM_DRIVER             BIT13  ///< 0x2000 A WDM driver.
+#define EFI_IMAGE_DLLCHARACTERISTICS_GUARD_CF               BIT14  ///< 0x4000 Image supports Control Flow Guard.
+#define EFI_IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE  BIT15  ///< 0x8000 Terminal Server aware.
+
 ///
 /// Header Data Directories.
 ///
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101134): https://edk2.groups.io/g/devel/message/101134
Mute This Topic: https://groups.io/mt/97586047/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-