IDebugSymbols3::GetLineByOffset method (dbgeng.h)

The GetLineByOffset method returns the source filename and the line number within the source file of an instruction in the target.

Syntax

HRESULT GetLineByOffset(
  [in]            ULONG64  Offset,
  [out, optional] PULONG   Line,
  [out, optional] PSTR     FileBuffer,
  [in]            ULONG    FileBufferSize,
  [out, optional] PULONG   FileSize,
  [out, optional] PULONG64 Displacement
);

Parameters

[in] Offset

Specifies the location in the target's virtual address space of the instruction for which to return the source file and line number.

[out, optional] Line

Receives the line number within the source file of the instruction specified by Offset. If Line is NULL, this information is not returned.

[out, optional] FileBuffer

Receives the file name of the file that contains the instruction specified by Offset. If FileBuffer is NULL, this information is not returned.

[in] FileBufferSize

Specifies the size, in characters, of the FileBuffer buffer.

[out, optional] FileSize

Specifies the size, in characters, of the source filename. If FileSize is NULL, this information is not returned.

[out, optional] Displacement

Receives the difference between the location specified in Offset and the location of the first instruction of the returned line. If Displacement is NULL, this information is not returned.

Return value

This method may also return other error values. See Return Values for more details.

Return code Description
S_OK
The method was successful.
S_FALSE
The method was successful. However, the buffer was not large enough to hold the name of the source file and the name was truncated.

Remarks

For more information about source files, see Using Source Files.

Requirements

Requirement Value
Target Platform Desktop
Header dbgeng.h (include Dbgeng.h)

See also

GetOffsetByLine

IDebugSymbols

IDebugSymbols2

IDebugSymbols3