IDebugSymbols::SetScope method (dbgeng.h)

The SetScope method sets the current scope.

Syntax

HRESULT SetScope(
  [in]           ULONG64            InstructionOffset,
  [in, optional] PDEBUG_STACK_FRAME ScopeFrame,
  [in, optional] PVOID              ScopeContext,
  [in]           ULONG              ScopeContextSize
);

Parameters

[in] InstructionOffset

Specifies the location in the process's virtual address space for the scope's current instruction. This is only used if both ScopeFrame and ScopeContext are NULL; otherwise, it is ignored.

[in, optional] ScopeFrame

Specifies the scope's stack frame. For information about this structure, see DEBUG_STACK_FRAME.

[in, optional] ScopeContext

Specifies the scope's thread context. The type of the thread context is the CONTEXT structure for the target's effective processor. The buffer ScopeContext must be large enough to hold this structure. If ScopeContext is NULL, the current register context is used instead.

[in] ScopeContextSize

Specifies the size of the buffer ScopeContext.

Return value

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

Return code Description
S_OK
The scope identified by InstructionOffset, ScopeFrame, and ScopeContext is the same as the old scope.
S_FALSE
The scope has changed.

Remarks

If only InstructionOffset is provided, the scope can be used to look up symbol names; however, the values of these symbols will not be available.

To set the scope to a previous state, ScopeContext must be provided. This is not always necessary (for example, if you only wish to access the symbols and not the registers). To set the scope to a frame on the current stack, SetScopeFrameByIndex can be used.

For more information about scopes, see Scopes and Symbol Groups.

Requirements

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

See also

GetScope

IDebugSymbols

IDebugSymbols2

IDebugSymbols3

ResetScope

SetScopeFrameByIndex