Platform SDK: Debugging and Error Handling

MapDebugInformation

The MapDebugInformation function gains access to the debugging information for an image.

Note  This function is provided only for backward compatibility. It does not return reliable information. New applications should use the SymGetModuleInfo and SymLoadModule functions. If you need the information provided by this function, the source code is available on the Platform SDK CD-ROM for you to adapt.

PIMAGE_DEBUG_INFORMATION MapDebugInformation(
  HANDLE FileHandle, 
  PSTR FileName,    
  PSTR SymbolPath,  
  DWORD ImageBase    
);

Parameters

FileHandle
[in] Handle to an open executable image or NULL.
FileName
[in] Pointer to a null-terminated string that specifies the name of an executable image file or NULL.
SymbolPath
[in] Pointer to a null-terminated string that specifies the path where symbol files are located. The path can be multiple paths separated by semicolons. To retrieve the symbol path, use the SymGetSearchPath function.
ImageBase
[in] Specifies the base address for the image or zero.

Return Values

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

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

Remarks

The MapDebugInformation function is used to gain access to an image's debugging information. The debugging information is extracted from the image or the symbol file and placed into the IMAGE_DEBUG_INFORMATION structure. This structure is allocated by the library and must be deallocated by using the UnmapDebugInformation function. The memory for the structure is not in the process's default heap, so attempts to free it with a memory deallocation routine will fail.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 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_DEBUG_INFORMATION, SymGetSearchPath, UnmapDebugInformation