📄 winnt.h
字号:
DWORD Psr; // processor status
//
// The flags values within this flag control the contents of
// a CONTEXT record.
//
// 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 that 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 threads context will be modified.
//
// If the context record is used as an IN OUT parameter to capture
// the context of a thread, then only those portions of the thread's
// context corresponding to set flags will be returned.
//
// The context record is never used as an OUT only parameter.
//
DWORD ContextFlags;
DWORD Fill[4]; // padding for 16-byte stack frame alignment
} CONTEXT, *PCONTEXT;
#else
//
// 32-bit Context Frame
//
// This alternate version of the Alpha context structure parallels that
// of MIPS and IX86 in style for the first 64 entries: 32-bit machines
// can operate on the fields, and a value declared as a pointer to an
// array of int's can be used to index into the fields. This makes life
// with windbg and ntsd vastly easier.
//
// There are two parts: the first contains the lower 32-bits of each
// element in the 64-bit definition above. The second part contains
// the upper 32-bits of each 64-bit element above.
//
// The names in the first part are identical to the 64-bit names.
// The second part names are prefixed with "High".
//
// 1st half: at 32 bits each, (containing the low parts of 64-bit values)
// 32 floats, 32 ints, fpcrs, fir, psr, contextflags
// 2nd half: at 32 bits each
// 32 floats, 32 ints, fpcrs, fir, fill
//
// There is no external support for the 32-bit version of the context
// structure. It is only used internally by windbg and ntsd.
//
// This structure must be the same size as the 64-bit version above.
//
typedef struct _CONTEXT {
DWORD FltF0;
DWORD FltF1;
DWORD FltF2;
DWORD FltF3;
DWORD FltF4;
DWORD FltF5;
DWORD FltF6;
DWORD FltF7;
DWORD FltF8;
DWORD FltF9;
DWORD FltF10;
DWORD FltF11;
DWORD FltF12;
DWORD FltF13;
DWORD FltF14;
DWORD FltF15;
DWORD FltF16;
DWORD FltF17;
DWORD FltF18;
DWORD FltF19;
DWORD FltF20;
DWORD FltF21;
DWORD FltF22;
DWORD FltF23;
DWORD FltF24;
DWORD FltF25;
DWORD FltF26;
DWORD FltF27;
DWORD FltF28;
DWORD FltF29;
DWORD FltF30;
DWORD FltF31;
DWORD IntV0; // $0: return value register, v0
DWORD IntT0; // $1: temporary registers, t0 - t7
DWORD IntT1; // $2:
DWORD IntT2; // $3:
DWORD IntT3; // $4:
DWORD IntT4; // $5:
DWORD IntT5; // $6:
DWORD IntT6; // $7:
DWORD IntT7; // $8:
DWORD IntS0; // $9: nonvolatile registers, s0 - s5
DWORD IntS1; // $10:
DWORD IntS2; // $11:
DWORD IntS3; // $12:
DWORD IntS4; // $13:
DWORD IntS5; // $14:
DWORD IntFp; // $15: frame pointer register, fp/s6
DWORD IntA0; // $16: argument registers, a0 - a5
DWORD IntA1; // $17:
DWORD IntA2; // $18:
DWORD IntA3; // $19:
DWORD IntA4; // $20:
DWORD IntA5; // $21:
DWORD IntT8; // $22: temporary registers, t8 - t11
DWORD IntT9; // $23:
DWORD IntT10; // $24:
DWORD IntT11; // $25:
DWORD IntRa; // $26: return address register, ra
DWORD IntT12; // $27: temporary register, t12
DWORD IntAt; // $28: assembler temp register, at
DWORD IntGp; // $29: global pointer register, gp
DWORD IntSp; // $30: stack pointer register, sp
DWORD IntZero; // $31: zero register, zero
DWORD Fpcr; // floating point control register
DWORD SoftFpcr; // software extension to FPCR
DWORD Fir; // (fault instruction) continuation address
DWORD Psr; // processor status
DWORD ContextFlags;
//
// Beginning of the "second half".
// The name "High" parallels the HighPart of a LargeInteger.
//
DWORD HighFltF0;
DWORD HighFltF1;
DWORD HighFltF2;
DWORD HighFltF3;
DWORD HighFltF4;
DWORD HighFltF5;
DWORD HighFltF6;
DWORD HighFltF7;
DWORD HighFltF8;
DWORD HighFltF9;
DWORD HighFltF10;
DWORD HighFltF11;
DWORD HighFltF12;
DWORD HighFltF13;
DWORD HighFltF14;
DWORD HighFltF15;
DWORD HighFltF16;
DWORD HighFltF17;
DWORD HighFltF18;
DWORD HighFltF19;
DWORD HighFltF20;
DWORD HighFltF21;
DWORD HighFltF22;
DWORD HighFltF23;
DWORD HighFltF24;
DWORD HighFltF25;
DWORD HighFltF26;
DWORD HighFltF27;
DWORD HighFltF28;
DWORD HighFltF29;
DWORD HighFltF30;
DWORD HighFltF31;
DWORD HighIntV0; // $0: return value register, v0
DWORD HighIntT0; // $1: temporary registers, t0 - t7
DWORD HighIntT1; // $2:
DWORD HighIntT2; // $3:
DWORD HighIntT3; // $4:
DWORD HighIntT4; // $5:
DWORD HighIntT5; // $6:
DWORD HighIntT6; // $7:
DWORD HighIntT7; // $8:
DWORD HighIntS0; // $9: nonvolatile registers, s0 - s5
DWORD HighIntS1; // $10:
DWORD HighIntS2; // $11:
DWORD HighIntS3; // $12:
DWORD HighIntS4; // $13:
DWORD HighIntS5; // $14:
DWORD HighIntFp; // $15: frame pointer register, fp/s6
DWORD HighIntA0; // $16: argument registers, a0 - a5
DWORD HighIntA1; // $17:
DWORD HighIntA2; // $18:
DWORD HighIntA3; // $19:
DWORD HighIntA4; // $20:
DWORD HighIntA5; // $21:
DWORD HighIntT8; // $22: temporary registers, t8 - t11
DWORD HighIntT9; // $23:
DWORD HighIntT10; // $24:
DWORD HighIntT11; // $25:
DWORD HighIntRa; // $26: return address register, ra
DWORD HighIntT12; // $27: temporary register, t12
DWORD HighIntAt; // $28: assembler temp register, at
DWORD HighIntGp; // $29: global pointer register, gp
DWORD HighIntSp; // $30: stack pointer register, sp
DWORD HighIntZero; // $31: zero register, zero
DWORD HighFpcr; // floating point control register
DWORD HighSoftFpcr; // software extension to FPCR
DWORD HighFir; // processor status
double DoNotUseThisField; // to force quadword structure alignment
DWORD HighFill[2]; // padding for 16-byte stack frame alignment
} CONTEXT, *PCONTEXT;
//
// These should name the fields in the _PORTABLE_32BIT structure
// that overlay the Psr and ContextFlags in the normal structure.
//
#define _QUAD_PSR_OFFSET HighSoftFpcr
#define _QUAD_FLAGS_OFFSET HighFir
#endif // _PORTABLE_32BIT_CONTEXT
// end_ntddk end_nthal
#endif // _ALPHA_
#ifdef _ALPHA_
VOID
__jump_unwind (
PVOID VirtualFramePointer,
PVOID TargetPc
);
#endif // _ALPHA_
#ifdef _X86_
//
// Disable these two pramas that evaluate to "sti" "cli" on x86 so that driver
// writers to not leave them inadvertantly in their code.
//
#if !defined(MIDL_PASS)
#if !defined(RC_INVOKED)
#pragma warning(disable:4164) // disable C4164 warning so that apps that
// build with /Od don't get weird errors !
#ifdef _M_IX86
#pragma function(_enable)
#pragma function(_disable)
#endif
#pragma warning(default:4164) // reenable C4164 warning
#endif
#endif
#if !defined(MIDL_PASS) && defined(_M_IX86)
#pragma warning (disable:4035) // disable 4035 (function must return something)
_inline PVOID GetFiberData( void ) { __asm {
mov eax, fs:[0x10]
mov eax,[eax]
}
}
_inline PVOID GetCurrentFiber( void ) { __asm mov eax, fs:[0x10] }
#pragma warning (default:4035) // Reenable it
#endif
// begin_ntddk begin_wx86
//
// Define the size of the 80387 save area, which is in the context frame.
//
#define SIZE_OF_80387_REGISTERS 80
//
// The following flags control the contents of the CONTEXT structure.
//
#if !defined(RC_INVOKED)
#define CONTEXT_i386 0x00010000 // this assumes that i386 and
#define CONTEXT_i486 0x00010000 // i486 have identical context records
// end_wx86
#define CONTEXT_CONTROL (CONTEXT_i386 | 0x00000001L) // SS:SP, CS:IP, FLAGS, BP
#define CONTEXT_INTEGER (CONTEXT_i386 | 0x00000002L) // AX, BX, CX, DX, SI, DI
#define CONTEXT_SEGMENTS (CONTEXT_i386 | 0x00000004L) // DS, ES, FS, GS
#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 0x00000008L) // 387 state
#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x00000010L) // DB 0-3,6,7
#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386 | 0x00000020L) // cpu specific extensions
#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER |\
CONTEXT_SEGMENTS)
// begin_wx86
#endif
#define MAXIMUM_SUPPORTED_EXTENSION 512
typedef struct _FLOATING_SAVE_AREA {
DWORD ControlWord;
DWORD StatusWord;
DWORD TagWord;
DWORD ErrorOffset;
DWORD ErrorSelector;
DWORD DataOffset;
DWORD DataSelector;
BYTE RegisterArea[SIZE_OF_80387_REGISTERS];
DWORD Cr0NpxState;
} FLOATING_SAVE_AREA;
typedef FLOATING_SAVE_AREA *PFLOATING_SAVE_AREA;
//
// Context Frame
//
// This frame has a several purposes: 1) it is used as an argument to
// NtContinue, 2) is is used to constuct a call frame for APC delivery,
// and 3) it is used in the user level thread creation routines.
//
// The layout of the record conforms to a standard call frame.
//
typedef struct _CONTEXT {
//
// The flags values within this flag control the contents of
// a CONTEXT record.
//
// 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 that portion of the
// context record contains valid context. If the context record
// is being used to modify a threads context, then only that
// portion of the threads context will be modified.
//
// If the context record is used as an IN OUT parameter to capture
// the context of a thread, then only those portions of the thread's
// context corresponding to set flags will be returned.
//
// The context record is never used as an OUT only parameter.
//
DWORD ContextFlags;
//
// This section is specified/returned if CONTEXT_DEBUG_REGISTERS is
// set in ContextFlags. Note that CONTEXT_DEBUG_REGISTERS is NOT
// included in CONTEXT_FULL.
//
DWORD Dr0;
DWORD Dr1;
DWORD Dr2;
DWORD Dr3;
DWORD Dr6;
DWORD Dr7;
//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_FLOATING_POINT.
//
FLOATING_SAVE_AREA FloatSave;
//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_SEGMENTS.
//
DWORD SegGs;
DWORD SegFs;
DWORD SegEs;
DWORD SegDs;
//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_INTEGER.
//
DWORD Edi;
DWORD Esi;
DWORD Ebx;
DWORD Edx;
DWORD Ecx;
DWORD Eax;
//
// This section is specified/returned if the
// ContextFlags word contians the flag CONTEXT_CONTROL.
//
DWORD Ebp;
DWORD Eip;
DWORD SegCs; // MUST BE SANITIZED
DWORD EFlags; // MUST BE SANITIZED
DWORD Esp;
DWORD SegSs;
//
// This section is specified/returned if the ContextFlags word
// contains the flag CONTEXT_EXTENDED_REGISTERS.
// The format and contexts are processor specific
//
BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
} CONTEXT;
typedef CONTEXT *PCONTEXT;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -