Platform SDK: Debugging and Error Handling

ImageNtHeader

The ImageNtHeader function locates the IMAGE_NT_HEADERS structure in a PE image and returns a pointer to the data.

PIMAGE_NT_HEADERS ImageNtHeader(
  PVOID ImageBase  
);

Parameters

ImageBase
[in] Specifies the base address of an image that is mapped into memory by a call to the MapViewOfFile function.

Return Values

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

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

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Dbghelp.h.
  Library: Use Dbghelp.lib.

See Also

Debug Help Library Overview, DbgHelp Functions, IMAGE_NT_HEADERS, MapViewOfFile