ImageDirectoryEntryToDataEx function (dbghelp.h)
Locates a directory entry within the image header and returns the address of the data for the directory entry. This function returns the section header for the data located, if one exists.
Syntax
PVOID IMAGEAPI ImageDirectoryEntryToDataEx(
[in] PVOID Base,
[in] BOOLEAN MappedAsImage,
[in] USHORT DirectoryEntry,
[out] PULONG Size,
[out, optional] PIMAGE_SECTION_HEADER *FoundHeader
);
Parameters
[in] Base
The base address of the image or data file.
[in] MappedAsImage
If the flag is TRUE, the file is mapped by the system as an image. If this flag is FALSE, the file is mapped as a data file by the MapViewOfFile function.
[in] DirectoryEntry
The directory entry to be located. The value must be one of the following values.
[out] Size
A pointer to a variable that receives the size of the data for the directory entry that is located.
[out, optional] FoundHeader
A pointer to an IMAGE_SECTION_HEADER structure that receives the data. If the section header does not exist, this parameter is NULL.
Return value
If the function succeeds, the return value is a pointer to the data for the directory entry.
If the function fails, the return value is NULL. To retrieve extended error information, call GetLastError.
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
Requirement | Value |
---|---|
Target Platform | Windows |
Header | dbghelp.h |
Library | Dbghelp.lib |
DLL | Dbghelp.dll |
Redistributable | DbgHelp.dll 5.1 or later |