Jump to content

CONTEXTRECORD: Difference between revisions

From EDM2
Anakor (talk | contribs)
No edit summary
 
Anakor (talk | contribs)
m Format
Line 5: Line 5:
=== Type ===
=== Type ===
   
   
typedef struct _CONTEXTRECORD {
  [[OS2 API:DataType:ULONG|ULONG]] ContextFlags
  [[OS2 API:DataType:ULONG|ULONG]] ContextFlags;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_env[7]
  [[OS2 API:DataType:ULONG|ULONG]] ctx_env[7];
  [[OS2 API:DataType:FPREG|FPREG]] ctx_stack[8]
  [[OS2 API:DataType:FPREG|FPREG]] ctx_stack[8];
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegGs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegGs;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegFs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegFs;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegEs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegEs;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegDs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegDs;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEdi
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEdi;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEsi
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEsi;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEax
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEax;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEbx
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEbx;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEcx
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEcx;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEdx
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEdx;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEbp
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEbp;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEip
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEip;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegCs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegCs;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_EFlags
  [[OS2 API:DataType:ULONG|ULONG]] ctx_EFlags;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEsp
  [[OS2 API:DataType:ULONG|ULONG]] ctx_RegEsp;
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegSs
  [[OS2 API:DataType:ULONG|ULONG]] ctx_SegSs;
 
} CONTEXTRECORD;
==== C Declaration Method ====
 
typedef struct
   
   
=== Fields ===
=== Fields ===

Revision as of 13:35, 27 May 2005

CONTEXTRECORD

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.