Platform SDK: Debugging and Error Handling

SymGetLineFromName

The SymGetLineFromName function locates a source line for the specified module, file name, and line number.

This function is implemented as a wrapper that calls SymGetLineFromName64. For more information, see New 64-bit Functions.

BOOL SymGetLineFromName(
  HANDLE hProcess,
  PSTR ModuleName,
  PSTR FileName,
  DWORD dwLineNumber,
  PLONG lpDisplacement,
  PIMAGEHLP_LINE Line
);

For SymGetLineFromName64, the parameter list is as follows.

BOOL SymGetLineFromName64(
  HANDLE hProcess,
  PSTR ModuleName,
  PSTR FileName,
  DWORD dwLineNumber,
  PLONG lpDisplacement,
  PIMAGEHLP_LINE64 Line
);

Parameters

hProcess
[in] Handle to the process that was originally passed to the SymInitialize function.
ModuleName
[in] Pointer to a null-terminated string that specifies the name of the module in which a line is to be located.
FileName
[in] Pointer to a null-terminated string that specifies the name of the file in which a line is to be located.
dwLineNumber
[in] Specifies the line number to be located.
lpDisplacement
[out] The displacement from the beginning of the line, or zero.
Line
[in/out] Pointer to an IMAGEHLP_LINE structure.

Return Value

If the function succeeds, the return value is TRUE.

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

Remarks

The caller must allocate the Line buffer properly and fill in the required members of the IMAGEHLP_LINE structure before calling SymGetLineFromName.

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, IMAGEHLP_LINE, SymGetLineFromAddr, SymInitialize