Debugging Tools for Windows


The SetScope method sets the current scope.

    IN ULONG64  InstructionOffset,
    IN OPTIONAL PVOID  ScopeContext,
    IN ULONG  ScopeContextSize


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.
Specifies the scope's stack frame. For information about this structure, see DEBUG_STACK_FRAME.
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.
Specifies the size of the buffer ScopeContext.

Return Value

The scope identified by InstructionOffset, ScopeFrame, and ScopeContext is the same as the old scope.
The scope has changed.

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

Interface Version

SetScope is available in all versions of IDebugSymbols.


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.


Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

GetScope, ResetScope, SetScopeFrameByIndex

Build machine: CAPEBUILD