MapDebugInformation Function

Debug Help Library

MapDebugInformation Function

Obtains 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 SymGetModuleInfo64 and SymLoadModule64 functions.

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

Parameters

FileHandle

A handle to an open executable image or NULL.

FileName

The name of an executable image file or NULL.

SymbolPath

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

The base address for the image or zero.

Return Value

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 obtain 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.

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 FunctionsIMAGE_DEBUG_INFORMATION
SymGetSearchPath
UnmapDebugInformation


Send comments about this topic to Microsoft

Build date: 9/25/2007

© 2007 Microsoft Corporation. All rights reserved.