Expand Minimize

ImageRvaToSection function

Locates a relative virtual address (RVA) within the image header of a file that is mapped as a file and returns a pointer to the section table entry for that RVA.

Syntax


PIMAGE_SECTION_HEADER WINAPI ImageRvaToSection(
  _In_  PIMAGE_NT_HEADERS NtHeaders,
  _In_  PVOID Base,
  _In_  ULONG Rva
);

Parameters

NtHeaders [in]

A pointer to an IMAGE_NT_HEADERS structure. This structure can be obtained by calling the ImageNtHeader function.

Base [in]

This parameter is reserved.

Rva [in]

The relative virtual address to be located.

Return value

If the function succeeds, the return value is a pointer to an IMAGE_SECTION_HEADER structure.

If the function fails, the return value is NULL. To retrieve extended error information, call GetLastError.

Remarks

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

DbgHelp.dll 5.1 or later

Header

Dbghelp.h

Library

Dbghelp.lib

DLL

Dbghelp.dll

See also

DbgHelp Functions
IMAGE_NT_HEADERS
IMAGE_SECTION_HEADER
ImageNtHeader
MapViewOfFile

 

 

Community Additions

ADD
Show:
© 2014 Microsoft