- Update KTHREAD and KUSER_SHARED_DATA to latest versions. This should make 2K3 drive...
[reactos.git] / reactos / include / ndk / asm.h
index 756b5ed..708ebac 100644 (file)
 /*
  * Defines for accessing KPCR and KTHREAD structure members
  */
+#define KTHREAD_DEBUG_ACTIVE            0x03
 #define KTHREAD_INITIAL_STACK           0x18
 #define KTHREAD_STACK_LIMIT             0x1C
-#define KTHREAD_TEB                     0x20
-#define KTHREAD_KERNEL_STACK            0x28
-#define KTHREAD_NPX_STATE               0x31
-#define KTHREAD_STATE                   0x2D
-#define KTHREAD_APCSTATE_PROCESS        0x34 + 0x10
-#define KTHREAD_PENDING_USER_APC        0x34 + 0x16
-#define KTHREAD_PENDING_KERNEL_APC      0x34 + 0x15
-#define KTHREAD_CONTEXT_SWITCHES        0x4C
-#define KTHREAD_WAIT_IRQL               0x54
-#define KTHREAD_SERVICE_TABLE           0xDC
-#define KTHREAD_PREVIOUS_MODE           0x137
-#define KTHREAD_TRAP_FRAME              0x128
-#define KTHREAD_CALLBACK_STACK          0x120
+#define KTHREAD_TEB                     0x74
+#define KTHREAD_KERNEL_STACK            0x20
+#define KTHREAD_NPX_STATE               0x4D
+#define KTHREAD_STATE                   0x4C
+#define KTHREAD_ALERTED                 0x5E
+#define KTHREAD_APCSTATE_PROCESS        0x28 + 0x10
+#define KTHREAD_PENDING_USER_APC        0x28 + 0x16
+#define KTHREAD_PENDING_KERNEL_APC      0x28 + 0x15
+#define KTHREAD_CONTEXT_SWITCHES        0x48
+#define KTHREAD_WAIT_IRQL               0x4E
+#define KTHREAD_SERVICE_TABLE           0x118
+#define KTHREAD_PREVIOUS_MODE           0xD7
+#define KTHREAD_TRAP_FRAME              0x110
+#define KTHREAD_CALLBACK_STACK          0x114
 
 #define KPROCESS_DIRECTORY_TABLE_BASE   0x18
 #define KPROCESS_LDT_DESCRIPTOR0        0x20
@@ -72,6 +74,7 @@
 #define KPCR_EXCEPTION_LIST             0x0
 #define KPCR_INITIAL_STACK              0x4
 #define KPCR_STACK_LIMIT                0x8
+#define KPCR_TEB                        0x18
 #define KPCR_SELF                       0x1C
 #define KPCR_GDT                        0x3C
 #define KPCR_TSS                        0x40
@@ -91,7 +94,7 @@
 #define KTRAP_FRAME_DEBUGEIP            0x4
 #define KTRAP_FRAME_DEBUGARGMARK        0x8
 #define KTRAP_FRAME_DEBUGPOINTER        0xC
-#define KTRAP_FRAME_TEMPSS              0x10
+#define KTRAP_FRAME_TEMPCS              0x10
 #define KTRAP_FRAME_TEMPESP             0x14
 #define KTRAP_FRAME_DR0                 0x18
 #define KTRAP_FRAME_DR1                 0x1C
 #define CONTEXT_FLAGS                   0x0
 #define CONTEXT_DR6                     0x14
 #define CONTEXT_FLOAT_SAVE              0x1C
+#define CONTEXT_SEGGS                   0x8C
+#define CONTEXT_SEGFS                   0x90
+#define CONTEXT_SEGES                   0x94
+#define CONTEXT_SEGDS                   0x98
 #define CONTEXT_EDI                     0x9C
 #define CONTEXT_ESI                     0xA0
 #define CONTEXT_EBX                     0xA4
 #define CONTEXT_EAX                     0xB0
 #define CONTEXT_EBP                     0xB4
 #define CONTEXT_EIP                     0xB8
+#define CONTEXT_SEGCS                   0xBC
+#define CONTEXT_EFLAGS                  0xC0
 #define CONTEXT_ESP                     0xC4
+#define CONTEXT_SEGSS                   0xC8
 #define CONTEXT_FLOAT_SAVE_CONTROL_WORD CONTEXT_FLOAT_SAVE + FN_CONTROL_WORD
 #define CONTEXT_FLOAT_SAVE_STATUS_WORD  CONTEXT_FLOAT_SAVE + FN_STATUS_WORD
 #define CONTEXT_FLOAT_SAVE_TAG_WORD     CONTEXT_FLOAT_SAVE + FN_TAG_WORD
 
+/* EXCEPTION_RECORD Constants */
+#define EXCEPTION_RECORD_EXCEPTION_CODE     0x0
+#define EXCEPTION_RECORD_EXCEPTION_FLAGS    0x4
+#define EXCEPTION_RECORD_EXCEPTION_RECORD   0x8
+#define EXCEPTION_RECORD_EXCEPTION_ADDRESS  0xC
+#define EXCEPTION_RECORD_NUMBER_PARAMETERS  0x10
+#define SIZEOF_EXCEPTION_RECORD             0x14
+
 /* TEB CONSTANTS */
 #define TEB_EXCEPTION_LIST              0x0
 #define TEB_STACK_BASE                  0x4
 #define TEB_STACK_LIMIT                 0x8
 #define TEB_FIBER_DATA                  0x10
+#define TEB_PEB                         0x30
+#define TEB_EXCEPTION_CODE              0x1A4
 #define TEB_ACTIVATION_CONTEXT_STACK_POINTER 0x1A8
 #define TEB_DEALLOCATION_STACK          0xE0C
 #define TEB_GUARANTEED_STACK_BYTES      0xF78
 #define TEB_FLS_DATA                    0xFB4
 
+/* PEB CONSTANTS */
+#define PEB_KERNEL_CALLBACK_TABLE       0x2C
+
 /* FIBER CONSTANTS */
 #define FIBER_PARAMETER                 0x0
 #define FIBER_EXCEPTION_LIST            0x4