Jump to content

CONTEXTRECORD: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== CONTEXTRECORD ==
Machine specific register contents for the thread at the time of the exception.  
Machine specific register contents for the thread at the time of the exception.  


Line 30: Line 29:
:Flags which control the contents of the context record.
:Flags which control the contents of the context record.
:Possible values are shown in the following list:
:Possible values are shown in the following list:
:* [[CONTEXT_CONTROL]] SS:ESP, CS:EIP, EFLAGS and EBP
:*CONTEXT_CONTROL - SS:ESP, CS:EIP, EFLAGS and EBP
:* [[CONTEXT_INTEGER]] EAX, EBX, ECX, EDX, ESI and EDI
:*CONTEXT_INTEGER - EAX, EBX, ECX, EDX, ESI and EDI
:* [[CONTEXT_SEGMENTS]] DS, ES, FS, and GS  
:*CONTEXT_SEGMENTS - DS, ES, FS, and GS  
:* [[CONTEXT_FLOATING_POINT]] numeric coprocessor state
:*CONTEXT_FLOATING_POINT - numeric coprocessor state
:* [[CONTEXT_FULL]] all the above.
:*CONTEXT_FULL - all the above.
:If the context record is used as an input parameter, then for each portion of the context record controlled by a flag whose value is set, it is assumed that the portion of the context record contains valid context. If the context record is being used to modify a thread's context, then only that portion of the thread's context will be modified.  
:If the context record is used as an input parameter, then for each portion of the context record controlled by a flag whose value is set, it is assumed that the portion of the context record contains valid context. If the context record is being used to modify a thread's context, then only that portion of the thread's context will be modified.  
:If the context record is used as an input/output parameter to capture the context of a thread, then only those portions of the thread's context corresponding to set flags will be returned.
:If the context record is used as an input/output parameter to capture the context of a thread, then only those portions of the thread's context corresponding to set flags will be returned.
;ctx_env[7]
;ctx_env[7]
:This parameter is used only when ContextFlags is set to [[CONTEXT_FLOATING_POINT]].
:This parameter is used only when ContextFlags is set to CONTEXT_FLOATING_POINT.
;ctx_stack[8]
;ctx_stack[8]
:This parameter is used only when ContextFlags is set to CONTEXT_FLOATING_POINT.
:This parameter is used only when ContextFlags is set to CONTEXT_FLOATING_POINT.
;ctx_SegGs
;ctx_SegGs
:GS register.
:GS register.
:This parameter is used only when ContextFlags is set to [[CONTEXT_SEGMENTS]].
:This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
;ctx_SegFs
;ctx_SegFs
:FS register.
:FS register.
Line 55: Line 54:
;ctx_RegEdi
;ctx_RegEdi
:EDI register.
:EDI register.
:This parameter is used only when ContextFlags is set to [[CONTEXT_INTEGER]].
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
;ctx_RegEsi
;ctx_RegEsi
:ESI register.
:ESI register.
Line 71: Line 70:
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
;ctx_RegEbp:EBP register.
;ctx_RegEbp:EBP register.
:This parameter is used only when ContextFlags is set to [[CONTEXT_CONTROL]].
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
;ctx_RegEip:EIP register.
;ctx_RegEip:EIP register.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
Line 78: Line 77:
;ctx_EFlags:EFLAGS register.
;ctx_EFlags:EFLAGS register.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
;ctx_RegEsp:ESP register.
;ctx_RegEsp:ESP register.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.

Latest revision as of 13:55, 24 May 2017

Machine specific register contents for the thread at the time of the exception.

Type

ULONG ContextFlags
ULONG ctx_env[7]
FPREG ctx_stack[8]
ULONG ctx_SegGs
ULONG ctx_SegFs
ULONG ctx_SegEs
ULONG ctx_SegDs
ULONG ctx_RegEdi
ULONG ctx_RegEsi
ULONG ctx_RegEax
ULONG ctx_RegEbx
ULONG ctx_RegEcx
ULONG ctx_RegEdx
ULONG ctx_RegEbp
ULONG ctx_RegEip
ULONG ctx_SegCs
ULONG ctx_EFlags
ULONG ctx_RegEsp
ULONG ctx_SegSs

C Declaration Method

typedef struct

Fields

ContextFlags
Flags which control the contents of the context record.
Possible values are shown in the following list:
  • CONTEXT_CONTROL - SS:ESP, CS:EIP, EFLAGS and EBP
  • CONTEXT_INTEGER - EAX, EBX, ECX, EDX, ESI and EDI
  • CONTEXT_SEGMENTS - DS, ES, FS, and GS
  • CONTEXT_FLOATING_POINT - numeric coprocessor state
  • CONTEXT_FULL - all the above.
If the context record is used as an input parameter, then for each portion of the context record controlled by a flag whose value is set, it is assumed that the portion of the context record contains valid context. If the context record is being used to modify a thread's context, then only that portion of the thread's context will be modified.
If the context record is used as an input/output parameter to capture the context of a thread, then only those portions of the thread's context corresponding to set flags will be returned.
ctx_env[7]
This parameter is used only when ContextFlags is set to CONTEXT_FLOATING_POINT.
ctx_stack[8]
This parameter is used only when ContextFlags is set to CONTEXT_FLOATING_POINT.
ctx_SegGs
GS register.
This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
ctx_SegFs
FS register.
This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
ctx_SegEs
ES register.
This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
ctx_SegDs
DS register.
This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
ctx_RegEdi
EDI register.
This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
ctx_RegEsi
ESI register.
This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
ctx_RegEax
EAX register.
This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
ctx_RegEbx
EBX register.
This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
ctx_RegEcx
ECX register.
This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
ctx_RegEdx
EDX register.
This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
ctx_RegEbp
EBP register.
This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
ctx_RegEip
EIP register.
This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
ctx_SegCs
CS register.
This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
ctx_EFlags
EFLAGS register.
This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
ctx_RegEsp
ESP register.
This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
ctx_SegSs
SS register.
This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.

Comment

Note that only the register sets specified by ContextFlags contain valid data. Conversely, only registers specified in ContextFlags will be restored if an exception is handled.