SymGetSymbolFile function

Locates a symbol file in the specified symbol path.

Syntax

BOOL IMAGEAPI SymGetSymbolFile(
  HANDLE hProcess,
  PCSTR  SymPath,
  PCSTR  ImageFile,
  DWORD  Type,
  PSTR   SymbolFile,
  size_t cSymbolFile,
  PSTR   DbgFile,
  size_t cDbgFile
);

Parameters

hProcess

A handle to the process that was originally passed to the SymInitialize function.

If this handle is 0, SymPath cannot be NULL. Use this option to load a symbol file without calling SymInitialize or SymCleanup.

SymPath

The symbol path. If this parameter is NULL or an empty string, the function uses the symbol path set using the SymInitialize or SymSetSearchPath function.

ImageFile

The name of the image file.

Type

The type of symbol file. This parameter can be one of the following values.

Value Meaning
sfImage
0
A .exe or .dll file.
sfDbg
1
A .dbg file.
sfPdb
2
A .pdb file.
sfMpd
3
Reserved.

SymbolFile

A pointer to a null-terminated string that receives the name of the symbol file.

cSymbolFile

The size of the SymbolFile buffer, in characters.

DbgFile

A pointer to a buffer that receives the fully qualified path to the symbol file. This buffer must be at least MAX_PATH characters.

cDbgFile

The size of the DbgFile buffer, in characters.

Return Value

If the server locates a valid symbol file, it returns TRUE; otherwise, it returns FALSE and GetLastError returns a value that indicates why the symbol file was not returned.

Remarks

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.

Requirements

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

See Also

DbgHelp Functions

SymInitialize