Export (0) Print
Expand All
Expand Minimize

SymGetSymbolFile function

Locates a symbol file in the specified symbol path.

Syntax


BOOL WINAPI SymGetSymbolFile(
  _In_opt_  HANDLE hProcess,
  _In_opt_  PCTSTR SymPath,
  _In_      PCTSTR ImageFile,
  _In_      DWORD Type,
  _Out_     PTSTR SymbolFile,
  _In_      size_t cSymbolFile,
  _Out_     PTSTR DbgFile,
  _In_      size_t cDbgFile
);

Parameters

hProcess [in, optional]

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 [in, optional]

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 [in]

The name of the image file.

Type [in]

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

ValueMeaning
sfImage
0

A .exe or .dll file.

sfDbg
1

A .dbg file.

sfPdb
2

A .pdb file.

sfMpd
3

Reserved.

 

SymbolFile [out]

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

cSymbolFile [in]

The size of the SymbolFile buffer, in characters.

DbgFile [out]

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 [in]

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

Redistributable

DbgHelp.dll 6.3 or later

Header

Dbghelp.h

Library

Dbghelp.lib

DLL

Dbghelp.dll

Unicode and ANSI names

SymGetSymbolFileW (Unicode) and SymGetSymbolFile (ANSI)

See also

DbgHelp Functions
SymInitialize

 

 

Community Additions

ADD
Show:
© 2014 Microsoft