FindDebugInfoFileEx function (dbghelp.h)

Locates the specified debug (.dbg) file.


  [in]           PCSTR                     FileName,
  [in]           PCSTR                     SymbolPath,
  [out]          PSTR                      DebugFilePath,
  [in, optional] PFIND_DEBUG_FILE_CALLBACK Callback,
  [in, optional] PVOID                     CallerData


[in] FileName

The name of the .dbg file to locate. You can use a partial path.

[in] SymbolPath

The path where symbol files are located. This can be multiple paths separated by semicolons. To retrieve the symbol path, use the SymGetSearchPath function.

[out] DebugFilePath

A pointer to a buffer that receives the full path of the .dbg file.

[in, optional] Callback

An application-defined callback function that verifies whether the correct file was found or the function should continue its search. For more information, see FindDebugInfoFileProc.

This parameter may be NULL.

[in, optional] CallerData

Optional user-defined data to pass to the callback function.

Return value

If the function succeeds, the return value is an open handle to the .dbg file.

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


The FindDebugInfoFileEx function is used to locate a .dbg file. This function is provided so the search can be conducted in several different directories through a single function call. The SymbolPath parameter can contain multiple paths, with each separated by a semicolon (;). When multiple paths are specified, the function searches each specified directory for the file. When the file is located, the search stops. Thus, be sure to specify SymbolPath with the paths in the correct order.

If the file name specified does not include a .dbg extension, FindDebugInfoFileEx searches for the file in the following sequence:

  1. SymbolPath\Symbols\ext\filename.dbg
  2. SymbolPath\ext\filename.dbg
  3. SymbolPath\filename.dbg
  4. FileNamePath\filename.dbg
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.

To call the Unicode version of this function, define DBGHELP_TRANSLATE_TCHAR.


Requirement Value
Target Platform Windows
Header dbghelp.h
Library Dbghelp.lib
DLL Dbghelp.dll
Redistributable DbgHelp.dll 5.1 or later

See also

DbgHelp Functions