Debugging Tools for Windows

SetContext

The SetContext function is similar to the Win32 SetThreadContext routine. It sets the context of the process being debugged.

ULONG 
  SetContext (
    ULONG Target,
    PCONTEXT lpContext,
    ULONG cbSizeOfContext
    );

Parameters

Target
User mode: Specifies the thread ID of the thread being debugged.

Kernel Mode: Specifies the processor number of the processor being debugged.

lpContext
Points to the address of a context structure that contains the context to be set for the process being debugged. The context structure is highly machine-specific.
cbSizeOfContext
Specifies the size of the context structure.

Return Value

If the routine succeeds, the return value is TRUE; otherwise, it is FALSE.

Requirements

Headers: Defined in wdbgexts.h. If you are writing a WdbgExts extension, include wdbgexts.h. If you are writing a DbgEng extension that calls this function, include wdbgexts.h before dbgeng.h (see Writing DbgEng Extension Code for details).

Build machine: CAPEBUILD