Platform SDK: Debugging and Error Handling

FindDebugInfoFileEx

The FindDebugInfoFileEx function locates a debug (.dbg) file.

HANDLE FindDebugInfoFileEx(
  PSTR FileName,
  PSTR SymbolPath,
  PSTR DebugFilePath,
  PFIND_DEBUG_FILE_CALLBACK Callback,
  PVOID CallerData
);

Parameters

FileName
[in] Pointer to a null-terminated string that specifies the name of the .dbg file to locate. You can use a partial path.
SymbolPath
[in] Pointer to a null-terminated string that specifies the path where symbol files are located. This can be multiple paths separated by semicolons. To retrieve the symbol path, use the SymGetSearchPath function.
DebugFilePath
[out] Receives the full path of the .dbg file that is found.
Callback
[in] Pointer to an application-defined callback function that verifies whether the correct file was found or the function should continue its search. For more information, see FindDebugFileProc.

This parameter may be NULL.

CallerData
[in] User-defined data to pass to the callback function. This parameter may be NULL.

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.

Remarks

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 directory tree 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>\Symbols\<ext>\<filename>.sym
  3. <SymbolPath>\<ext>\<filename>.dbg
  4. <SymbolPath>\<ext>\<filename>.sym
  5. <SymbolPath>\<filename>.dbg
  6. <SymbolPath>\<filename>.sym
  7. <FileNamePath>\<filename>.dbg
  8. <FileNamePath>\<filename>.sym

Requirements

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

See Also

Debug Help Library Overview, DbgHelp Functions, FindDebugFileProc, SymGetSearchPath