ImageDirectoryEntryToData Function
Obtains access to image-specific data.
This function has been superseded by the ImageDirectoryEntryToDataEx function. Use ImageDirectoryEntryToDataEx to retrieve the section header.
PVOID WINAPI ImageDirectoryEntryToData( __in PVOID Base, __in BOOLEAN MappedAsImage, __in USHORT DirectoryEntry, __out PULONG Size );
Parameters
- Base
-
The base address of the image.
- MappedAsImage
-
If this parameter is TRUE, the file is mapped by the system as an image. If the flag is FALSE, the file is mapped as a data file by the MapViewOfFile function.
- DirectoryEntry
-
The index number of the desired directory entry. This parameter can be one of the following values.
Value Meaning IMAGE_DIRECTORY_ENTRY_ARCHITECTURE
7Architecture-specific data
IMAGE_DIRECTORY_ENTRY_BASERELOC
5Base relocation table
IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT
11Bound import directory
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
14COM descriptor table
IMAGE_DIRECTORY_ENTRY_DEBUG
6Debug directory
IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT
13Delay import table
IMAGE_DIRECTORY_ENTRY_EXCEPTION
3Exception directory
IMAGE_DIRECTORY_ENTRY_EXPORT
0Export directory
IMAGE_DIRECTORY_ENTRY_GLOBALPTR
8The relative virtual address of global pointer
IMAGE_DIRECTORY_ENTRY_IAT
12Import address table
IMAGE_DIRECTORY_ENTRY_IMPORT
1Import directory
IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG
10Load configuration directory
IMAGE_DIRECTORY_ENTRY_RESOURCE
2Resource directory
IMAGE_DIRECTORY_ENTRY_SECURITY
4Security directory
IMAGE_DIRECTORY_ENTRY_TLS
9Thread local storage directory
- Size
-
A pointer to a variable that receives the size of the data for the directory entry, in bytes.
Return Value
If the function succeeds, the return value is a pointer to the directory entry's data.
If the function fails, the return value is NULL. To retrieve extended error information, call GetLastError.
Remarks
The ImageDirectoryEntryToData function is used to obtain access to image-specific data.
All DbgHelp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.
Requirements
Redistributable |
Requires DbgHelp.dll 5.1 or later. |
---|---|
Header |
Declared in Dbghelp.h. |
Library |
Use Dbghelp.lib. |
DLL |
Requires Dbghelp.dll. |
See Also
DbgHelp Functions
ImageDirectoryEntryToDataEx
MapViewOfFile
Send comments about this topic to Microsoft
Build date: 9/25/2007
© 2007 Microsoft Corporation. All rights reserved.