上下文结构 (winnt.h)

包含特定于处理器的寄存器数据。 系统使用 CONTEXT 结构执行各种内部操作。 有关每个处理器体系结构的此结构的定义,请参阅头文件 WinNT.h。

语法

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;

成员

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

要求

要求
最低受支持的客户端 Windows XP [仅限桌面应用]
最低受支持的服务器 Windows Server 2003 [仅限桌面应用]
标头 winnt.h (包括 Windows.h)

请参阅

调试结构

GetThreadContext

GetXStateFeaturesMask

SetThreadContext

WOW64_CONTEXT