CONTEXT structure (winnt.h)

Contains processor-specific register data. The system uses CONTEXT structures to perform various internal operations. Refer to the header file WinNT.h for definitions of this structure for each processor architecture.

Syntax

typedef struct _CONTEXT {
  DWORD64 P1Home;
  DWORD64 P2Home;
  DWORD64 P3Home;
  DWORD64 P4Home;
  DWORD64 P5Home;
  DWORD64 P6Home;
  DWORD   ContextFlags;
  DWORD   MxCsr;
  WORD    SegCs;
  WORD    SegDs;
  WORD    SegEs;
  WORD    SegFs;
  WORD    SegGs;
  WORD    SegSs;
  DWORD   EFlags;
  DWORD64 Dr0;
  DWORD64 Dr1;
  DWORD64 Dr2;
  DWORD64 Dr3;
  DWORD64 Dr6;
  DWORD64 Dr7;
  DWORD64 Rax;
  DWORD64 Rcx;
  DWORD64 Rdx;
  DWORD64 Rbx;
  DWORD64 Rsp;
  DWORD64 Rbp;
  DWORD64 Rsi;
  DWORD64 Rdi;
  DWORD64 R8;
  DWORD64 R9;
  DWORD64 R10;
  DWORD64 R11;
  DWORD64 R12;
  DWORD64 R13;
  DWORD64 R14;
  DWORD64 R15;
  DWORD64 Rip;
  union {
    XMM_SAVE_AREA32 FltSave;
    NEON128         Q[16];
    ULONGLONG       D[32];
    struct {
      M128A Header[2];
      M128A Legacy[8];
      M128A Xmm0;
      M128A Xmm1;
      M128A Xmm2;
      M128A Xmm3;
      M128A Xmm4;
      M128A Xmm5;
      M128A Xmm6;
      M128A Xmm7;
      M128A Xmm8;
      M128A Xmm9;
      M128A Xmm10;
      M128A Xmm11;
      M128A Xmm12;
      M128A Xmm13;
      M128A Xmm14;
      M128A Xmm15;
    } DUMMYSTRUCTNAME;
    DWORD           S[32];
  } DUMMYUNIONNAME;
  M128A   VectorRegister[26];
  DWORD64 VectorControl;
  DWORD64 DebugControl;
  DWORD64 LastBranchToRip;
  DWORD64 LastBranchFromRip;
  DWORD64 LastExceptionToRip;
  DWORD64 LastExceptionFromRip;
} CONTEXT, *PCONTEXT;

Members

P1Home

P2Home

P3Home

P4Home

P5Home

P6Home

ContextFlags

MxCsr

SegCs

SegDs

SegEs

SegFs

SegGs

SegSs

EFlags

Dr0

Dr1

Dr2

Dr3

Dr6

Dr7

Rax

Rcx

Rdx

Rbx

Rsp

Rbp

Rsi

Rdi

R8

R9

R10

R11

R12

R13

R14

R15

Rip

DUMMYUNIONNAME

DUMMYUNIONNAME.FltSave

DUMMYUNIONNAME.Q[16]

DUMMYUNIONNAME.D[32]

DUMMYUNIONNAME.DUMMYSTRUCTNAME

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Header[2]

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Legacy[8]

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm0

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm1

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm2

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm3

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm4

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm5

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm6

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm7

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm8

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm9

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm10

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm11

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm12

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm13

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm14

DUMMYUNIONNAME.DUMMYSTRUCTNAME.Xmm15

DUMMYUNIONNAME.S[32]

VectorRegister[26]

VectorControl

DebugControl

LastBranchToRip

LastBranchFromRip

LastExceptionToRip

LastExceptionFromRip

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header winnt.h (include Windows.h)

See also

Debugging Structures

GetThreadContext

GetXStateFeaturesMask

SetThreadContext

WOW64_CONTEXT