2006-04-18 Thorsten Dahlheimer (dahlheim@users.sf.net>

* include/winnt.h (IMAGE_FILE_MACHINE_IA64): New define.
	(IMAGE_FILE_MACHINE_AMD64): New define.
	(IMAGE_NT_OPTIONAL_HDR{32|64}_MAGIC. New. Map to IMAGE_NT_OPTIONAL_HDR_MAGIC.
	(IMAGE_SUBSYSTEM_NATIVE_WINDOWS): New define.
	(IMAGE_SUBSYSTEM_WINDOWS_CE_GUI): New define.
	(IMAGE_DLLCHARACTERISTICS_WDM_DRIVER): New define.
	(IMAGE_DIRECTORY_ENTRY_*): New defines.
	(IMAGE_SCN_TYPE_*): New defines.
	(IMAGE_SCN_ALIGN_*): New defines.
	(IMAGE_DEBUG_TYPE_BORLAND): New define.
	(IMAGE_OPTIONAL_HEADER{32|64}): New structure definitions and typedefs.  Map to
	IMAGE_OPTIONAL_HEADERS.
	(IMAGE_NT_HEADERS{32|64}): New structure definitions and typedefs.  Map to
	IMAGE_NT_HEADERS.
	(IMAGE_LOAD_CONFIG_DIRECTORY64): New structure definition and typedefs.
	(IMAGE_CE_RUNTIME_FUNCTION_ENTRY): Likewise.
	(IMAGE_FUNCTION_ENTRY64): Likewise.
This commit is contained in:
Danny Smith 2006-04-18 03:58:22 +00:00
parent bcc39a0bfe
commit edf92ad046
2 changed files with 138 additions and 4 deletions

View File

@ -1,3 +1,23 @@
2006-04-18 Thorsten Dahlheimer (dahlheim@users.sf.net>
* include/winnt.h (IMAGE_FILE_MACHINE_IA64): New define.
(IMAGE_FILE_MACHINE_AMD64): New define.
(IMAGE_NT_OPTIONAL_HDR{32|64}_MAGIC. New. Map to IMAGE_NT_OPTIONAL_HDR_MAGIC.
(IMAGE_SUBSYSTEM_NATIVE_WINDOWS): New define.
(IMAGE_SUBSYSTEM_WINDOWS_CE_GUI): New define.
(IMAGE_DLLCHARACTERISTICS_WDM_DRIVER): New define.
(IMAGE_DIRECTORY_ENTRY_*): New defines.
(IMAGE_SCN_TYPE_*): New defines.
(IMAGE_SCN_ALIGN_*): New defines.
(IMAGE_DEBUG_TYPE_BORLAND): New define.
(IMAGE_OPTIONAL_HEADER{32|64}): New structure definitions and typedefs. Map to
IMAGE_OPTIONAL_HEADERS.
(IMAGE_NT_HEADERS{32|64}): New structure definitions and typedefs. Map to
IMAGE_NT_HEADERS.
(IMAGE_LOAD_CONFIG_DIRECTORY64): New structure definition and typedefs.
(IMAGE_CE_RUNTIME_FUNCTION_ENTRY): Likewise.
(IMAGE_FUNCTION_ENTRY64): Likewise.
2006-04-18 Bart Oldeman <bartoldeman@users.sf.net>
* lib/test.c: Fix typo in #inlcude.

View File

@ -874,12 +874,20 @@ typedef DWORD FLONG;
#define IMAGE_FILE_MACHINE_R10000 360
#define IMAGE_FILE_MACHINE_ALPHA 388
#define IMAGE_FILE_MACHINE_POWERPC 496
#define IMAGE_FILE_MACHINE_IA64 512
#define IMAGE_FILE_MACHINE_AMD64 34404
#define IMAGE_DOS_SIGNATURE 0x5A4D
#define IMAGE_OS2_SIGNATURE 0x454E
#define IMAGE_OS2_SIGNATURE_LE 0x454C
#define IMAGE_VXD_SIGNATURE 0x454C
#define IMAGE_NT_SIGNATURE 0x00004550
#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
#ifdef _WIN64
#define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC
#else
#define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR32_MAGIC
#endif
#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
@ -901,7 +909,10 @@ typedef DWORD FLONG;
#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
#define IMAGE_SUBSYSTEM_OS2_CUI 5
#define IMAGE_SUBSYSTEM_POSIX_CUI 7
#define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8
#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
#define IMAGE_SUBSYSTEM_XBOX 14
#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((DWORD)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0
#define IMAGE_DIRECTORY_ENTRY_IMPORT 1
@ -911,17 +922,26 @@ typedef DWORD FLONG;
#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
#define IMAGE_DIRECTORY_ENTRY_DEBUG 6
#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
#define IMAGE_DIRECTORY_ENTRY_ARCHITECTURE 7
#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
#define IMAGE_DIRECTORY_ENTRY_TLS 9
#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
#define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
#define IMAGE_DIRECTORY_ENTRY_IAT 12
#define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
#define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
#define IMAGE_SCN_TYPE_REG 0
#define IMAGE_SCN_TYPE_DSECT 1
#define IMAGE_SCN_TYPE_NOLOAD 2
#define IMAGE_SCN_TYPE_GROUP 4
#define IMAGE_SCN_TYPE_NO_PAD 8
#define IMAGE_SCN_TYPE_COPY 16
#define IMAGE_SCN_CNT_CODE 32
#define IMAGE_SCN_CNT_INITIALIZED_DATA 64
#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 128
#define IMAGE_SCN_LNK_OTHER 256
#define IMAGE_SCN_LNK_INFO 512
#define IMAGE_SCN_TYPE_OVER 1024
#define IMAGE_SCN_LNK_REMOVE 2048
#define IMAGE_SCN_LNK_COMDAT 4096
#define IMAGE_SCN_MEM_FARDATA 0x8000
@ -936,6 +956,13 @@ typedef DWORD FLONG;
#define IMAGE_SCN_ALIGN_16BYTES 0x500000
#define IMAGE_SCN_ALIGN_32BYTES 0x600000
#define IMAGE_SCN_ALIGN_64BYTES 0x700000
#define IMAGE_SCN_ALIGN_128BYTES 0x800000
#define IMAGE_SCN_ALIGN_256BYTES 0x900000
#define IMAGE_SCN_ALIGN_512BYTES 0xa00000
#define IMAGE_SCN_ALIGN_1024BYTES 0xb00000
#define IMAGE_SCN_ALIGN_2048BYTES 0xc00000
#define IMAGE_SCN_ALIGN_4096BYTES 0xd00000
#define IMAGE_SCN_ALIGN_8192BYTES 0xe00000
#define IMAGE_SCN_LNK_NRELOC_OVFL 0x1000000
#define IMAGE_SCN_MEM_DISCARDABLE 0x2000000
#define IMAGE_SCN_MEM_NOT_CACHED 0x4000000
@ -1109,6 +1136,7 @@ typedef DWORD FLONG;
#define IMAGE_DEBUG_TYPE_FIXUP 6
#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
#define IMAGE_DEBUG_TYPE_BORLAND 9
#define FRAME_FPO 0
#define FRAME_TRAP 1
#define FRAME_TSS 2
@ -2476,7 +2504,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER {
WORD MinorImageVersion;
WORD MajorSubsystemVersion;
WORD MinorSubsystemVersion;
DWORD Reserved1;
DWORD Win32VersionValue;
DWORD SizeOfImage;
DWORD SizeOfHeaders;
DWORD CheckSum;
@ -2489,7 +2517,46 @@ typedef struct _IMAGE_OPTIONAL_HEADER {
DWORD LoaderFlags;
DWORD NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
} IMAGE_OPTIONAL_HEADER,*PIMAGE_OPTIONAL_HEADER;
} IMAGE_OPTIONAL_HEADER32,*PIMAGE_OPTIONAL_HEADER32;
typedef struct _IMAGE_OPTIONAL_HEADER64 {
WORD Magic;
BYTE MajorLinkerVersion;
BYTE MinorLinkerVersion;
DWORD SizeOfCode;
DWORD SizeOfInitializedData;
DWORD SizeOfUninitializedData;
DWORD AddressOfEntryPoint;
DWORD BaseOfCode;
ULONGLONG ImageBase;
DWORD SectionAlignment;
DWORD FileAlignment;
WORD MajorOperatingSystemVersion;
WORD MinorOperatingSystemVersion;
WORD MajorImageVersion;
WORD MinorImageVersion;
WORD MajorSubsystemVersion;
WORD MinorSubsystemVersion;
DWORD Win32VersionValue;
DWORD SizeOfImage;
DWORD SizeOfHeaders;
DWORD CheckSum;
WORD Subsystem;
WORD DllCharacteristics;
ULONGLONG SizeOfStackReserve;
ULONGLONG SizeOfStackCommit;
ULONGLONG SizeOfHeapReserve;
ULONGLONG SizeOfHeapCommit;
DWORD LoaderFlags;
DWORD NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
} IMAGE_OPTIONAL_HEADER64,*PIMAGE_OPTIONAL_HEADER64;
#ifdef _WIN64
typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER;
typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER;
#else
typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER;
typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER;
#endif
typedef struct _IMAGE_ROM_OPTIONAL_HEADER {
WORD Magic;
BYTE MajorLinkerVersion;
@ -2566,7 +2633,19 @@ typedef struct _IMAGE_NT_HEADERS {
DWORD Signature;
IMAGE_FILE_HEADER FileHeader;
IMAGE_OPTIONAL_HEADER OptionalHeader;
} IMAGE_NT_HEADERS,*PIMAGE_NT_HEADERS;
} IMAGE_NT_HEADERS32,*PIMAGE_NT_HEADERS32;
typedef struct _IMAGE_NT_HEADERS64 {
DWORD Signature;
IMAGE_FILE_HEADER FileHeader;
IMAGE_OPTIONAL_HEADER OptionalHeader;
} IMAGE_NT_HEADERS64,*PIMAGE_NT_HEADERS64;
#ifdef _WIN64
typedef IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS;
typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS;
#else
typedef IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS;
typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS;
#endif
typedef struct _IMAGE_ROM_HEADERS {
IMAGE_FILE_HEADER FileHeader;
IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
@ -2819,6 +2898,26 @@ typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
DWORD ProcessHeapFlags;
DWORD Reserved[4];
} IMAGE_LOAD_CONFIG_DIRECTORY,*PIMAGE_LOAD_CONFIG_DIRECTORY;
typedef struct {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
DWORD GlobalFlagsClear;
DWORD GlobalFlagsSet;
DWORD CriticalSectionDefaultTimeout;
ULONGLONG DeCommitFreeBlockThreshold;
ULONGLONG DeCommitTotalFreeThreshold;
ULONGLONG LockPrefixTable;
ULONGLONG MaximumAllocationSize;
ULONGLONG VirtualMemoryThreshold;
ULONGLONG ProcessAffinityMask;
DWORD ProcessHeapFlags;
WORD CSDFlags;
WORD Reserved1;
ULONGLONG EditList;
DWORD Reserved[2];
} IMAGE_LOAD_CONFIG_DIRECTORY64,*PIMAGE_LOAD_CONFIG_DIRECTORY64;
typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY {
DWORD BeginAddress;
DWORD EndAddress;
@ -2826,6 +2925,13 @@ typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY {
PVOID HandlerData;
DWORD PrologEndAddress;
} IMAGE_RUNTIME_FUNCTION_ENTRY,*PIMAGE_RUNTIME_FUNCTION_ENTRY;
typedef struct _IMAGE_CE_RUNTIME_FUNCTION_ENTRY {
unsigned int FuncStart:32;
unsigned int PrologLen:8;
unsigned int FuncLen:22;
unsigned int ThirtyTwoBit:1;
unsigned int ExceptionFlag:1;
} IMAGE_CE_RUNTIME_FUNCTION_ENTRY,*PIMAGE_CE_RUNTIME_FUNCTION_ENTRY;
typedef struct _IMAGE_DEBUG_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
@ -2860,6 +2966,14 @@ typedef struct _IMAGE_FUNCTION_ENTRY {
DWORD EndingAddress;
DWORD EndOfPrologue;
} IMAGE_FUNCTION_ENTRY,*PIMAGE_FUNCTION_ENTRY;
typedef struct _IMAGE_FUNCTION_ENTRY64 {
ULONGLONG StartingAddress;
ULONGLONG EndingAddress;
_ANONYMOUS_UNION union {
ULONGLONG EndOfPrologue;
ULONGLONG UnwindInfoAddress;
} DUMMYUNIONNAME;
} IMAGE_FUNCTION_ENTRY64,*PIMAGE_FUNCTION_ENTRY64;
typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
WORD Signature;
WORD Flags;