SymGetLineFromName64 Function

Debug Help Library

SymGetLineFromName64 Function

Locates a source line for the specified module, file name, and line number.

This function supersedes the SymGetLineFromName function. For more information, see Updated Platform Support.

BOOL WINAPI SymGetLineFromName64(
  __in          HANDLE hProcess,
  __in          PCTSTR ModuleName,
  __in          PCTSTR FileName,
  __in          DWORD dwLineNumber,
  __out         PLONG lpDisplacement,
  __in_out      PIMAGEHLP_LINE64 Line
);

Parameters

hProcess

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

ModuleName

The name of the module in which a line is to be located.

FileName

The name of the file in which a line is to be located. If the application has more than one source file with this name, be sure to specify a full path.

dwLineNumber

The line number to be located.

lpDisplacement

The displacement from the beginning of the line, or zero.

Line

A pointer to an IMAGEHLP_LINE64 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_LINE64 structure before calling SymGetLineFromName64.

Before calling this function, ensure that the symbols are initialized correctly by first calling SymInitialize, SymSetOptions, and SymLoadModule64.

This function returns a pointer to a buffer that may be reused by another function. Therefore, be sure to copy the data returned to another buffer immediately.

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.

Example Code

For an example, see Retrieving Symbol Information by Name.

Requirements

Redistributable

Requires DbgHelp.dll 5.1 or later.

Header

Declared in Dbghelp.h.

Library

Use Dbghelp.lib.

DLL

Requires Dbghelp.dll.

Unicode

Implemented as SymGetLineFromNameW64 (Unicode) and SymGetLineFromName64 (ANSI).

See Also

DbgHelp FunctionsIMAGEHLP_LINE64
SymGetLineFromAddr64
SymInitialize


Send comments about this topic to Microsoft

Build date: 9/25/2007

© 2007 Microsoft Corporation. All rights reserved.