Jump to content

CONTEXTRECORD: Difference between revisions

From EDM2
mNo edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions 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.  


=== Type ===
=== Type ===
  [[ULONG]] ContextFlags
  [[OS2 API:DataType:ULONG|ULONG]] ContextFlags
  ULONG ctx_env[7]
  [[OS2 API:DataType:ULONG|ULONG]] ctx_env[7]
  [[FPREG]] ctx_stack[8]
  [[OS2 API:DataType:FPREG|FPREG]] ctx_stack[8]
  ULONG ctx_SegGs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegGs
  ULONG ctx_SegFs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegFs
  ULONG ctx_SegEs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegEs
  ULONG ctx_SegDs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegDs
  ULONG ctx_RegEdi
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEdi
  ULONG ctx_RegEsi
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEsi
  ULONG ctx_RegEax
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEax
  ULONG ctx_RegEbx
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEbx
  ULONG ctx_RegEcx
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEcx
  ULONG ctx_RegEdx
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEdx
  ULONG ctx_RegEbp
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEbp
  ULONG ctx_RegEip
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEip
  ULONG ctx_SegCs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegCs
  ULONG ctx_EFlags
  [[OS2 API:DataType:ULONG|ULONG]] ctx_EFlags
  ULONG ctx_RegEsp
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEsp
  ULONG ctx_SegSs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegSs


==== C Declaration Method ====
==== C Declaration Method ====
typedef struct
typedef struct
   
   
=== Fields ===
=== Fields ===
 
;ContextFlags
ContextFlags 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:
              * [[OS2 API:Constant:CONTEXT#CONTEXT_CONTROL|CONTEXT_CONTROL]] SS:ESP, CS:EIP, EFLAGS and EBP  
:*CONTEXT_CONTROL - SS:ESP, CS:EIP, EFLAGS and EBP
              * [[OS2 API:Constant:CONTEXT#CONTEXT_INTEGER|CONTEXT_INTEGER]] EAX, EBX, ECX, EDX, ESI and EDI  
:*CONTEXT_INTEGER - EAX, EBX, ECX, EDX, ESI and EDI
              * [[OS2 API:Constant:CONTEXT#CONTEXT_SEGMENTS|CONTEXT_SEGMENTS]] DS, ES, FS, and GS  
:*CONTEXT_SEGMENTS - DS, ES, FS, and GS  
              * [[OS2 API:Constant:CONTEXT#CONTEXT_FLOATING_POINT|CONTEXT_FLOATING_POINT]] numeric coprocessor state
:*CONTEXT_FLOATING_POINT - numeric coprocessor state
              * [[OS2 API:Constant:CONTEXT#CONTEXT_FULL|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    
: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.
              portion of the context record controlled by a flag whose value is
;ctx_env[7]
              set, it is assumed that the portion of the context record contains
:This parameter is used only when ContextFlags is set to CONTEXT_FLOATING_POINT.
              valid context. If the context record is being used to modify a
;ctx_stack[8]
              thread's context, then only that portion of the thread's context
:This parameter is used only when ContextFlags is set to CONTEXT_FLOATING_POINT.
              will be modified.  
;ctx_SegGs
 
:GS register.
              If the context record is used as an input/output parameter to
:This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
              capture the context of a thread, then only those portions of the
;ctx_SegFs
              thread's context corresponding to set flags will be returned.
:FS register.
 
:This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
ctx_env[7]   This parameter is used only when ContextFlags is set to
;ctx_SegEs
              [[API:Constant:CONTEXT#CONTEXT_FLOATING_POINT|CONTEXT_FLOATING_POINT]].
:ES register.
 
:This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
ctx_stack[8] This parameter is used only when ContextFlags is set to  
;ctx_SegDs
              [[API:Constant:CONTEXT#CONTEXT_FLOATING_POINT|CONTEXT_FLOATING_POINT]].  
:DS register.
 
:This parameter is used only when ContextFlags is set to CONTEXT_SEGMENTS.
ctx_SegGs    GS register.
;ctx_RegEdi
              This parameter is used only when ContextFlags is set to  
:EDI register.
              [[OS2 API:Constant:CONTEXT#CONTEXT_SEGMENTS|CONTEXT_SEGMENTS]].
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
 
;ctx_RegEsi
ctx_SegFs    FS register.
:ESI register.
              This parameter is used only when ContextFlags is set to
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
              [[OS2 API:Constant:CONTEXT#CONTEXT_SEGMENTS|CONTEXT_SEGMENTS]].
;ctx_RegEax
 
:EAX register.
ctx_SegEs    ES register.
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
              This parameter is used only when ContextFlags is set to
;ctx_RegEbx
              [[OS2 API:Constant:CONTEXT#CONTEXT_SEGMENTS|CONTEXT_SEGMENTS]].
:EBX register.
 
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
ctx_SegDs    DS register.
;ctx_RegEcx
              This parameter is used only when ContextFlags is set to
:ECX register.
              [[OS2 API:Constant:CONTEXT#CONTEXT_SEGMENTS|CONTEXT_SEGMENTS]].  
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
 
;ctx_RegEdx:EDX register.
ctx_RegEdi  EDI register.
:This parameter is used only when ContextFlags is set to CONTEXT_INTEGER.
              This parameter is used only when ContextFlags is set to  
;ctx_RegEbp:EBP register.
              [[OS2 API:Constant:CONTEXT#CONTEXT_INTEGER|CONTEXT_INTEGER]].
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
 
;ctx_RegEip:EIP register.
ctx_RegEsi  ESI register.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
              This parameter is used only when ContextFlags is set to
;ctx_SegCs:CS register.
              [[OS2 API:Constant:CONTEXT#CONTEXT_INTEGER|CONTEXT_INTEGER]].
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
 
;ctx_EFlags:EFLAGS register.
ctx_RegEax  EAX register.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
              This parameter is used only when ContextFlags is set to
;ctx_RegEsp:ESP register.
              [[OS2 API:Constant:CONTEXT#CONTEXT_INTEGER|CONTEXT_INTEGER]].
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
 
;ctx_SegSs:SS register.
ctx_RegEbx  EBX register.
:This parameter is used only when ContextFlags is set to CONTEXT_CONTROL.
              This parameter is used only when ContextFlags is set to
              [[OS2 API:Constant:CONTEXT#CONTEXT_INTEGER|CONTEXT_INTEGER]].
 
ctx_RegEcx  ECX register.
              This parameter is used only when ContextFlags is set to
              [[OS2 API:Constant:CONTEXT#CONTEXT_INTEGER|CONTEXT_INTEGER]].  
 
ctx_RegEdx   EDX register.
              This parameter is used only when ContextFlags is set to  
              [[OS2 API:Constant:CONTEXT#CONTEXT_INTEGER|CONTEXT_INTEGER]].
 
ctx_RegEbp   EBP register.
              This parameter is used only when ContextFlags is set to  
              [[OS2 API:Constant:CONTEXT#CONTEXT_CONTROL|CONTEXT_CONTROL]].
 
ctx_RegEip   EIP register.
              This parameter is used only when ContextFlags is set to
              [[OS2 API:Constant:CONTEXT#CONTEXT_CONTROL|CONTEXT_CONTROL]].  
 
ctx_SegCs   CS register.
              This parameter is used only when ContextFlags is set to  
              [[OS2 API:Constant:CONTEXT#CONTEXT_CONTROL|CONTEXT_CONTROL]].
 
ctx_EFlags   EFLAGS register.
              This parameter is used only when ContextFlags is set to  
              [[OS2 API:Constant:CONTEXT#CONTEXT_CONTROL|CONTEXT_CONTROL]].
 
ctx_RegEsp   ESP register.
              This parameter is used only when ContextFlags is set to  
              [[OS2 API:Constant:CONTEXT#CONTEXT_CONTROL|CONTEXT_CONTROL]].
 
ctx_SegSs   SS register.
              This parameter is used only when ContextFlags is set to  
              [[OS2 API:Constant:CONTEXT#CONTEXT_CONTROL|CONTEXT_CONTROL]].


=== Comment ===
=== 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.
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.


 
[[Category:Data type]]
[[Category:The OS/2 API Project]]

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.