- Remove KTSS_NOIOMP from NDK.
authorAlex Ionescu <aionescu@gmail.com>
Sun, 27 Nov 2005 18:24:32 +0000 (18:24 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Sun, 27 Nov 2005 18:24:32 +0000 (18:24 +0000)
- Fix KTSS definition.
- Fix KTRAP_FRAME definition.
- Fix RTL_PROCESS_BACKTRACE_INFORMATION and RTL_PROCESS_BACKTRACES definitions.
- Fix/rename RUNDOWN_DESCRIPTOR definition.
- Rename PPF_ definitions to RTL_USER_PROCESS_PARAMETERS_
- Setup a global _REACTOS_ define when code is compiled.
- #ifdef out the multiboot flags from the NDK so they'll only be available for ReactOS. Dirty 'hack' until we stop using them.
- Update NDK Fixme list, since all major bugs are fixed now.

svn path=/trunk/; revision=19693

18 files changed:
reactos/hal/halx86/mp/apic.c
reactos/include/ndk/extypes.h
reactos/include/ndk/fixmes.txt
reactos/include/ndk/haltypes.h
reactos/include/ndk/i386/ketypes.h
reactos/include/ndk/lpctypes.h
reactos/include/ndk/rtltypes.h
reactos/lib/kernel32/process/create.c
reactos/lib/rtl/ppb.c
reactos/lib/rtl/process.c
reactos/ntoskrnl/ex/init.c
reactos/ntoskrnl/ex/rundown.c
reactos/ntoskrnl/kd/wrappers/gdbstub.c
reactos/ntoskrnl/ke/apc.c
reactos/ntoskrnl/ke/clock.c
reactos/ntoskrnl/ke/usercall.c
reactos/ntoskrnl/mm/pagefile.c
reactos/ntoskrnl/ps/debug.c

index 58e5e2e..8f8310e 100644 (file)
@@ -772,21 +772,21 @@ VOID
 MpsIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame,
                           PKTRAP_FRAME TrapFrame)
 {
-   TrapFrame->Gs     = (USHORT)IrqTrapFrame->Gs;
-   TrapFrame->Fs     = (USHORT)IrqTrapFrame->Fs;
-   TrapFrame->Es     = (USHORT)IrqTrapFrame->Es;
-   TrapFrame->Ds     = (USHORT)IrqTrapFrame->Ds;
+   TrapFrame->SegGs     = (USHORT)IrqTrapFrame->Gs;
+   TrapFrame->SegFs     = (USHORT)IrqTrapFrame->Fs;
+   TrapFrame->SegEs     = (USHORT)IrqTrapFrame->Es;
+   TrapFrame->SegDs     = (USHORT)IrqTrapFrame->Ds;
    TrapFrame->Eax    = IrqTrapFrame->Eax;
    TrapFrame->Ecx    = IrqTrapFrame->Ecx;
    TrapFrame->Edx    = IrqTrapFrame->Edx;
    TrapFrame->Ebx    = IrqTrapFrame->Ebx;
-   TrapFrame->Esp    = IrqTrapFrame->Esp;
+   TrapFrame->HardwareEsp    = IrqTrapFrame->Esp;
    TrapFrame->Ebp    = IrqTrapFrame->Ebp;
    TrapFrame->Esi    = IrqTrapFrame->Esi;
    TrapFrame->Edi    = IrqTrapFrame->Edi;
    TrapFrame->Eip    = IrqTrapFrame->Eip;
-   TrapFrame->Cs     = IrqTrapFrame->Cs;
-   TrapFrame->Eflags = IrqTrapFrame->Eflags;
+   TrapFrame->SegCs     = IrqTrapFrame->Cs;
+   TrapFrame->EFlags = IrqTrapFrame->Eflags;
 }
 
 VOID
index c34808d..be0a6aa 100644 (file)
@@ -271,13 +271,13 @@ typedef struct _EX_FAST_REF
 } EX_FAST_REF, *PEX_FAST_REF;
 
 //
-// FIXME
+// Executive Fast Reference Wait Block
 //
-typedef struct _RUNDOWN_DESCRIPTOR
+typedef struct _EX_RUNDOWN_WAIT_BLOCK
 {
-    ULONG_PTR References;
+    ULONG_PTR Count;
     KEVENT RundownEvent;
-} RUNDOWN_DESCRIPTOR, *PRUNDOWN_DESCRIPTOR;
+} EX_RUNDOWN_WAIT_BLOCK, *PEX_RUNDOWN_WAIT_BLOCK;
 
 //
 // Callback Object
index 178bb78..a419982 100644 (file)
@@ -2,23 +2,17 @@ Complete list of NDK Fixmes before 1.0 Release (Nov 27th 2005)
 --------------------------------------------------------------\r
 ______________________________________________________________________________________\r
 [CRITICAL]     - Breaking compatibility with official structures.\r
-|pstypes.h     - EPROCESS has ReactOS only fields. Includes ReactOS Internal header.\r
-|pstypes.h     - W32_CALLOUT_DATA has ReactOS only fields.\r
-|obtypes.h     - Object callbacks are ReactOS only definitions.\r
-|obtypes.h     - Object Header includes ReactOS only type.\r
-|mmtypes.h     - _MADDRESS_SPACE is ReactOS only field.\r
-|ketypes.h     - _KPROFILE needs to be updated with new definitions.\r
-|ketypes.h     - _KINTERRUPT needs to be verified with new definitions.\r
-|haltypes.h    - Loader Parameter Block is ReactOS Version, not NT.\r
+|pstypes.h     - EPROCESS has ReactOS only fields. Includes ReactOS Internal header. IFDEF_OUT\r
+|pstypes.h     - W32_CALLOUT_DATA has ReactOS only fields.              IFDEF-OUT\r
+|obtypes.h     - Object callbacks are ReactOS only definitions.         IFDEF-OUT ADDREAL\r
+|obtypes.h     - Object Header includes ReactOS only type.              IFDEF-OUT\r
+|mmtypes.h     - _MADDRESS_SPACE is ReactOS only field.                 IFDEF-OUT\r
+|ketypes.h     - _KPROFILE needs to be updated with new definitions.    FIXFIX\r
+|ketypes.h     - _KINTERRUPT needs to be verified with new definitions. FIXFIX\r
+|haltypes.h    - Loader Parameter Block is ReactOS Version, not NT.     IFDEF-OUT ADDREAL\r
 |\r
 [MAJOR]                - Using incorrect, missing, or invalid names or definitions.\r
-|i386/ketypes.h        - _KTRAP_FRAME definition is broken.\r
-|i386/ketypes.h        - _KTSSNOIOPM is not an official type.\r
-|rtltypes.h    - PPF_ Defines don't seem to be the real names (try to find them).\r
-|rtltypes.h    - _RTL_PROCESS_BACKTRACE_INFORMATION isn't done.\r
-|haltypes.h    - Multi-Boot flags are ReactOS Only.\r
-|extypes.h     - _RUNDOWN_DESCRIPTOR is possibly incorrect/unofficial.\r
-|extypes.h     - Classes 13, 20, 30, 31, 49, 51, 52, 54+ are undefined.\r
+|extypes.h     - Classes 13, 20, 30, 31, 49, 51, 52, 54+ are undefined. WONTFIX\r
 |_____________________________________________________________________________________\r
 \r
 \r
index 009531d..0a060ae 100644 (file)
@@ -27,8 +27,9 @@ Author:
 #ifndef NTOS_MODE_USER
 
 //
-// Multi-Boot Flags (FIXME)
+// Multi-Boot Flags (REMOVE ME)
 //
+#ifdef _REACTOS_
 #define MB_FLAGS_MEM_INFO                   (0x1)
 #define MB_FLAGS_BOOT_DEVICE                (0x2)
 #define MB_FLAGS_COMMAND_LINE               (0x4)
@@ -42,6 +43,7 @@ Author:
 #define MB_FLAGS_APM_TABLE                  (0x400)
 #define MB_FLAGS_GRAPHICS_TABLE             (0x800)
 #define MB_FLAGS_ACPI_TABLE                 (0x1000)
+#endif
 
 //
 // HalShutdownSystem Types
index 7a63b58..389b7c8 100644 (file)
@@ -90,11 +90,11 @@ typedef struct _FX_SAVE_AREA
 //
 typedef struct _KTRAP_FRAME
 {
-    ULONG DebugEbp;
-    ULONG DebugEip;
-    ULONG DebugArgMark;
-    ULONG DebugPointer;
-    ULONG TempCs;
+    ULONG DbgEbp;
+    ULONG DbgEip;
+    ULONG DbgArgMark;
+    ULONG DbgArgPointer;
+    ULONG TempSegCs;
     ULONG TempEsp;
     ULONG Dr0;
     ULONG Dr1;
@@ -102,29 +102,29 @@ typedef struct _KTRAP_FRAME
     ULONG Dr3;
     ULONG Dr6;
     ULONG Dr7;
-    ULONG Gs;
-    ULONG Es;
-    ULONG Ds;
+    ULONG SegGs;
+    ULONG SegEs;
+    ULONG SegDs;
     ULONG Edx;
     ULONG Ecx;
     ULONG Eax;
-    ULONG PreviousMode;
-    PVOID ExceptionList;
-    ULONG Fs;
+    ULONG PreviousPreviousMode;
+    struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
+    ULONG SegFs;
     ULONG Edi;
     ULONG Esi;
     ULONG Ebx;
     ULONG Ebp;
-    ULONG ErrorCode;
+    ULONG ErrCode;
     ULONG Eip;
-    ULONG Cs;
-    ULONG Eflags;
-    ULONG Esp;
-    ULONG Ss;
-    ULONG V86_Es;
-    ULONG V86_Ds;
-    ULONG V86_Fs;
-    ULONG V86_Gs;
+    ULONG SegCs;
+    ULONG EFlags;
+    ULONG HardwareEsp;
+    ULONG HardwareSegSs;
+    ULONG V86Es;
+    ULONG V86Ds;
+    ULONG V86Fs;
+    ULONG V86Gs;
 } KTRAP_FRAME, *PKTRAP_FRAME;
 
 //
@@ -461,99 +461,45 @@ typedef struct _KIPCR
 #pragma pack(pop)
 
 //
-// FIXME: TSS without I/O Privilege Map
+// TSS Definition
 //
-#include <pshpack1.h>
-typedef struct _KTSSNOIOPM
+typedef struct _KiIoAccessMap
 {
-    USHORT PreviousTask;
-    USHORT Reserved1;
-    ULONG  Esp0;
-    USHORT Ss0;
-    USHORT Reserved2;
-    ULONG  Esp1;
-    USHORT Ss1;
-    USHORT Reserved3;
-    ULONG  Esp2;
-    USHORT Ss2;
-    USHORT Reserved4;
-    ULONG  Cr3;
-    ULONG  Eip;
-    ULONG  Eflags;
-    ULONG  Eax;
-    ULONG  Ecx;
-    ULONG  Edx;
-    ULONG  Ebx;
-    ULONG  Esp;
-    ULONG  Ebp;
-    ULONG  Esi;
-    ULONG  Edi;
-    USHORT Es;
-    USHORT Reserved5;
-    USHORT Cs;
-    USHORT Reserved6;
-    USHORT Ss;
-    USHORT Reserved7;
-    USHORT Ds;
-    USHORT Reserved8;
-    USHORT Fs;
-    USHORT Reserved9;
-    USHORT Gs;
-    USHORT Reserved10;
-    USHORT Ldt;
-    USHORT Reserved11;
-    USHORT Trap;
-    USHORT IoMapBase;
-    /* no interrupt redirection map */
-    UCHAR IoBitmap[1];
-} KTSSNOIOPM;
+    UCHAR DirectionMap[32];
+    UCHAR IoMap[8196];
+} KIIO_ACCESS_MAP;
 
-//
-// TSS Definition
-//
+#include <pshpack1.h>
 typedef struct _KTSS
 {
-    USHORT PreviousTask;
-    USHORT Reserved1;
+    USHORT Backlink;
+    USHORT Reserved0;
     ULONG Esp0;
     USHORT Ss0;
-    USHORT Reserved2;
-    ULONG Esp1;
-    USHORT Ss1;
-    USHORT Reserved3;
-    ULONG Esp2;
-    USHORT Ss2;
-    USHORT Reserved4;
-    ULONG Cr3;
+    USHORT Reserved1;
+    ULONG NotUsed1[4];
+    ULONG CR3;
     ULONG Eip;
-    ULONG Eflags;
-    ULONG Eax;
-    ULONG Ecx;
-    ULONG Edx;
-    ULONG Ebx;
-    ULONG Esp;
-    ULONG Ebp;
-    ULONG Esi;
-    ULONG Edi;
+    ULONG NotUsed2[9];
     USHORT Es;
-    USHORT Reserved5;
+    USHORT Reserved2;
     USHORT Cs;
-    USHORT Reserved6;
+    USHORT Reserved3;
     USHORT Ss;
-    USHORT Reserved7;
+    USHORT Reserved4;
     USHORT Ds;
-    USHORT Reserved8;
+    USHORT Reserved5;
     USHORT Fs;
-    USHORT Reserved9;
+    USHORT Reserved6;
     USHORT Gs;
-    USHORT Reserved10;
-    USHORT Ldt;
-    USHORT Reserved11;
-    USHORT Trap;
+    USHORT Reserved7;
+    USHORT LDT;
+    USHORT Reserved8;
+    USHORT Flags;
     USHORT IoMapBase;
-    /* no interrupt redirection map */
-    UCHAR IoBitmap[8193];
-} KTSS;
+    KIIO_ACCESS_MAP IoMaps[1];
+    UCHAR IntDirectionMap[32];
+} KTSS, *PKTSS;
 #include <poppack.h>
 
 //
index 911e4e8..c1fa1bb 100644 (file)
@@ -25,6 +25,12 @@ Author:
 #include <umtypes.h>
 #include <pstypes.h>
 
+//
+// Internal helper macro
+//
+#define N_ROUND_UP(x,s) \
+    (((ULONG)(x)+(s)-1) & ~((ULONG)(s)-1))
+
 //
 // Maximum message size that can be sent through an LPC Port without a section
 //
@@ -234,9 +240,9 @@ typedef struct _CLIENT_DIED_MSG
 // Maximum total Kernel-Mode LPC Message Structure Size
 //
 #define LPCP_MAX_MESSAGE_SIZE \
-    ALIGN_UP(PORT_MAXIMUM_MESSAGE_LENGTH + \
+    N_ROUND_UP(PORT_MAXIMUM_MESSAGE_LENGTH + \
     sizeof(LPCP_MESSAGE) + \
-    sizeof(LPCP_CONNECTION_MESSAGE), sizeof(ULONGLONG) * 2)
+    sizeof(LPCP_CONNECTION_MESSAGE), 16)
 
 //
 // Maximum actual LPC Message Length
index a3c84f4..92dc4c9 100644 (file)
@@ -31,17 +31,17 @@ Author:
 #define RTL_MAXIMUM_ATOM_LENGTH                              255
 
 //
-// Process Parameters Flags (FIXME: Rename)
+// Process Parameters Flags
 //
-#define PPF_NORMALIZED                                       0x01
-#define PPF_PROFILE_USER                                     0x02
-#define PPF_PROFILE_SERVER                                   0x04
-#define PPF_PROFILE_KERNEL                                   0x08
-#define PPF_UNKNOWN                                          0x10
-#define PPF_RESERVE_1MB                                      0x20
-#define PPF_DISABLE_HEAP_CHECKS                              0x100
-#define PPF_PROCESS_OR_1                                     0x200
-#define PPF_PROCESS_OR_2                                     0x400
+#define RTL_USER_PROCESS_PARAMETERS_NORMALIZED               0x01
+#define RTL_USER_PROCESS_PARAMETERS_PROFILE_USER             0x02
+#define RTL_USER_PROCESS_PARAMETERS_PROFILE_SERVER           0x04
+#define RTL_USER_PROCESS_PARAMETERS_PROFILE_KERNEL           0x08
+#define RTL_USER_PROCESS_PARAMETERS_UNKNOWN                  0x10
+#define RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB              0x20
+#define RTL_USER_PROCESS_PARAMETERS_DISABLE_HEAP_CHECKS      0x100
+#define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_1             0x200
+#define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_2             0x400
 
 //
 // Exception Flags
@@ -613,14 +613,20 @@ typedef struct _RTL_PROCESS_LOCKS
 
 typedef struct _RTL_PROCESS_BACKTRACE_INFORMATION
 {
-    /* FIXME */
-    ULONG Unknown;
+    PVOID SymbolicBackTrace;
+    ULONG TraceCount;
+    USHORT Index;
+    USHORT Depth;
+    PVOID BackTrace[16];
 } RTL_PROCESS_BACKTRACE_INFORMATION, *PRTL_PROCESS_BACKTRACE_INFORMATION;
 
 typedef struct _RTL_PROCESS_BACKTRACES
 {
-    ULONG BackTraceCount;
-    RTL_PROCESS_BACKTRACE_INFORMATION BackTraceEntry[1];
+    ULONG CommittedMemory;
+    ULONG ReservedMemory;
+    ULONG NumberOfBackTraceLookups;
+    ULONG NumberOfBackTraces;
+    RTL_PROCESS_BACKTRACE_INFORMATION BackTraces[1];
 } RTL_PROCESS_BACKTRACES, *PRTL_PROCESS_BACKTRACES;
 
 typedef struct _RTL_DEBUG_BUFFER
index 6d4dc4c..d2ca836 100644 (file)
@@ -580,13 +580,13 @@ BasepInitializeEnvironment(HANDLE ProcessHandle,
     /* Handle some Parameter Flags */
     ProcessParameters->ConsoleFlags = (CreationFlags & CREATE_NEW_PROCESS_GROUP);
     ProcessParameters->Flags |= (CreationFlags & PROFILE_USER) ?
-                                 PPF_PROFILE_USER : 0;
+                                 RTL_USER_PROCESS_PARAMETERS_PROFILE_USER : 0;
     ProcessParameters->Flags |= (CreationFlags & PROFILE_KERNEL) ? 
-                                 PPF_PROFILE_KERNEL : 0;    
+                                 RTL_USER_PROCESS_PARAMETERS_PROFILE_KERNEL : 0;    
     ProcessParameters->Flags |= (CreationFlags & PROFILE_SERVER) ?
-                                 PPF_PROFILE_SERVER : 0;
+                                 RTL_USER_PROCESS_PARAMETERS_PROFILE_SERVER : 0;
     ProcessParameters->Flags |= (NtCurrentPeb()->ProcessParameters->Flags &
-                                 PPF_DISABLE_HEAP_CHECKS);
+                                 RTL_USER_PROCESS_PARAMETERS_DISABLE_HEAP_CHECKS);
     
     /* Write the Parameter Block */
     Status = NtWriteVirtualMemory(ProcessHandle,
index 349a361..fe7b4bf 100644 (file)
@@ -139,7 +139,7 @@ RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *ProcessParameters,
 
    Param->MaximumLength = RegionSize;
    Param->Length = Length;
-   Param->Flags = PPF_NORMALIZED;
+   Param->Flags = RTL_USER_PROCESS_PARAMETERS_NORMALIZED;
    Param->Environment = Environment;
    Param->CurrentDirectory.Handle = CurrentDirectoryHandle;
    Param->ConsoleHandle = ConsoleHandle;
@@ -238,7 +238,7 @@ RtlDestroyProcessParameters(PRTL_USER_PROCESS_PARAMETERS ProcessParameters)
 PRTL_USER_PROCESS_PARAMETERS NTAPI
 RtlDeNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params)
 {
-   if (Params && (Params->Flags & PPF_NORMALIZED))
+   if (Params && (Params->Flags & RTL_USER_PROCESS_PARAMETERS_NORMALIZED))
      {
        DENORMALIZE(Params->CurrentDirectory.DosPath.Buffer, Params);
        DENORMALIZE(Params->DllPath.Buffer, Params);
@@ -249,7 +249,7 @@ RtlDeNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params)
        DENORMALIZE(Params->ShellInfo.Buffer, Params);
        DENORMALIZE(Params->RuntimeData.Buffer, Params);
 
-       Params->Flags &= ~PPF_NORMALIZED;
+       Params->Flags &= ~RTL_USER_PROCESS_PARAMETERS_NORMALIZED;
      }
 
    return Params;
@@ -263,7 +263,7 @@ RtlDeNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params)
 PRTL_USER_PROCESS_PARAMETERS NTAPI
 RtlNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params)
 {
-   if (Params && !(Params->Flags & PPF_NORMALIZED))
+   if (Params && !(Params->Flags & RTL_USER_PROCESS_PARAMETERS_NORMALIZED))
      {
        NORMALIZE(Params->CurrentDirectory.DosPath.Buffer, Params);
        NORMALIZE(Params->DllPath.Buffer, Params);
@@ -274,7 +274,7 @@ RtlNormalizeProcessParams(PRTL_USER_PROCESS_PARAMETERS Params)
        NORMALIZE(Params->ShellInfo.Buffer, Params);
        NORMALIZE(Params->RuntimeData.Buffer, Params);
 
-       Params->Flags |= PPF_NORMALIZED;
+       Params->Flags |= RTL_USER_PROCESS_PARAMETERS_NORMALIZED;
      }
 
    return Params;
index c833180..72d3509 100644 (file)
@@ -80,7 +80,7 @@ RtlpInitEnvironment(HANDLE ProcessHandle,
             ProcessHandle, Peb, ProcessParameters);
             
     /* Give the caller 1MB if he requested it */
-    if (ProcessParameters->Flags & PPF_RESERVE_1MB)
+    if (ProcessParameters->Flags & RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB)
     {
         /* Give 1MB starting at 0x4 */
         BaseAddress = (PVOID)4;
index 59d41fc..642e857 100644 (file)
@@ -250,7 +250,6 @@ ExecuteRuntimeAsserts(VOID)
     ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, CurrentThread) == KPCR_CURRENT_THREAD);
     ASSERT(FIELD_OFFSET(KIPCR, PrcbData) + FIELD_OFFSET(KPRCB, NpxThread) == KPCR_NPX_THREAD);
     ASSERT(FIELD_OFFSET(KTSS, Esp0) == KTSS_ESP0);
-    ASSERT(FIELD_OFFSET(KTSS, Eflags) == KTSS_EFLAGS);
     ASSERT(FIELD_OFFSET(KTSS, IoMapBase) == KTSS_IOMAPBASE);
     ASSERT(sizeof(FX_SAVE_AREA) == SIZEOF_FX_SAVE_AREA);
 }
index c5961d7..c24270d 100644 (file)
@@ -123,7 +123,7 @@ ExReleaseRundownProtectionEx (
         if (Current & EX_RUNDOWN_ACTIVE)
         {
             /* Get Pointer */
-            PRUNDOWN_DESCRIPTOR RundownDescriptor = (PRUNDOWN_DESCRIPTOR)(Current & ~EX_RUNDOWN_ACTIVE);
+            PEX_RUNDOWN_WAIT_BLOCK RundownDescriptor = (PEX_RUNDOWN_WAIT_BLOCK)(Current & ~EX_RUNDOWN_ACTIVE);
 
             if (RundownDescriptor == NULL)
             {
@@ -131,9 +131,9 @@ ExReleaseRundownProtectionEx (
                 break;
             }
 
-            Current = RundownDescriptor->References;
+            Current = RundownDescriptor->Count;
 
-            /* Decrease RundownDescriptor->References by Count references */
+            /* Decrease RundownDescriptor->Count by Count Count */
             for (;;)
             {
                 ULONG_PTR PrevCount, NewCount;
@@ -144,12 +144,12 @@ ExReleaseRundownProtectionEx (
                 }
                 else
                 {
-                    NewCount = ((RundownDescriptor->References - (Count >> EX_RUNDOWN_COUNT_SHIFT)) << EX_RUNDOWN_COUNT_SHIFT) | EX_RUNDOWN_ACTIVE;
+                    NewCount = ((RundownDescriptor->Count - (Count >> EX_RUNDOWN_COUNT_SHIFT)) << EX_RUNDOWN_COUNT_SHIFT) | EX_RUNDOWN_ACTIVE;
                 }
 #ifdef _WIN64
-                PrevCount = (ULONG_PTR)InterlockedCompareExchange64((LONGLONG*)&RundownDescriptor->References, (LONGLONG)NewCount, (LONGLONG)Current);
+                PrevCount = (ULONG_PTR)InterlockedCompareExchange64((LONGLONG*)&RundownDescriptor->Count, (LONGLONG)NewCount, (LONGLONG)Current);
 #else
-                PrevCount = (ULONG_PTR)InterlockedCompareExchange((LONG*)&RundownDescriptor->References, (LONG)NewCount, (LONG)Current);
+                PrevCount = (ULONG_PTR)InterlockedCompareExchange((LONG*)&RundownDescriptor->Count, (LONG)NewCount, (LONG)Current);
 #endif
                 if (PrevCount == Current)
                 {
@@ -227,7 +227,7 @@ ExWaitForRundownProtectionRelease (
     )
 {
     ULONG_PTR PrevCount, NewPtr, PrevPtr;
-    RUNDOWN_DESCRIPTOR RundownDescriptor;
+    EX_RUNDOWN_WAIT_BLOCK RundownDescriptor;
 
     PAGED_CODE();
 
@@ -236,9 +236,9 @@ ExWaitForRundownProtectionRelease (
     if (PrevCount != 0 && !(PrevCount & EX_RUNDOWN_ACTIVE))
     {
         /* save the reference counter */
-        RundownDescriptor.References = PrevCount >> EX_RUNDOWN_COUNT_SHIFT;
+        RundownDescriptor.Count = PrevCount >> EX_RUNDOWN_COUNT_SHIFT;
 
-        /* Pending references... wait on them to be closed with an event */
+        /* Pending Count... wait on them to be closed with an event */
         KeInitializeEvent(&RundownDescriptor.RundownEvent, NotificationEvent, FALSE);
 
         ASSERT(!((ULONG_PTR)&RundownDescriptor & EX_RUNDOWN_ACTIVE));
@@ -267,7 +267,7 @@ ExWaitForRundownProtectionRelease (
             PrevCount = PrevPtr;
 
             /* save the changed reference counter and try again */
-            RundownDescriptor.References = PrevCount >> EX_RUNDOWN_COUNT_SHIFT;
+            RundownDescriptor.Count = PrevCount >> EX_RUNDOWN_COUNT_SHIFT;
         }
     }
 }
index 0e6fb1b..4c583a8 100644 (file)
@@ -133,18 +133,18 @@ static CPU_REGISTER GspRegisters[NUMREGS] =
   { 4, FIELD_OFFSET(KTRAP_FRAME, Ecx), FIELD_OFFSET(CONTEXT, Ecx), TRUE },
   { 4, FIELD_OFFSET(KTRAP_FRAME, Edx), FIELD_OFFSET(CONTEXT, Edx), FALSE },
   { 4, FIELD_OFFSET(KTRAP_FRAME, Ebx), FIELD_OFFSET(CONTEXT, Ebx), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, Esp), FIELD_OFFSET(CONTEXT, Esp), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, DebugEbp), FIELD_OFFSET(CONTEXT, Ebp), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, HardwareEsp ), FIELD_OFFSET(CONTEXT, Esp), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, DbgEbp), FIELD_OFFSET(CONTEXT, Ebp), TRUE },
   { 4, FIELD_OFFSET(KTRAP_FRAME, Esi), FIELD_OFFSET(CONTEXT, Esi), TRUE },
   { 4, FIELD_OFFSET(KTRAP_FRAME, Edi), FIELD_OFFSET(CONTEXT, Edi), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, DebugEip), FIELD_OFFSET(CONTEXT, Eip), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, Eflags), FIELD_OFFSET(CONTEXT, EFlags), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, Cs), FIELD_OFFSET(CONTEXT, SegCs), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, Ss), FIELD_OFFSET(CONTEXT, SegSs), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, Ds), FIELD_OFFSET(CONTEXT, SegDs), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, Es), FIELD_OFFSET(CONTEXT, SegEs), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, Fs), FIELD_OFFSET(CONTEXT, SegFs), TRUE },
-  { 4, FIELD_OFFSET(KTRAP_FRAME, Gs), FIELD_OFFSET(CONTEXT, SegGs), TRUE }
+  { 4, FIELD_OFFSET(KTRAP_FRAME, DbgEip), FIELD_OFFSET(CONTEXT, Eip), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, EFlags), FIELD_OFFSET(CONTEXT, EFlags), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, SegCs), FIELD_OFFSET(CONTEXT, SegCs), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, HardwareSegSs), FIELD_OFFSET(CONTEXT, SegSs), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, SegDs), FIELD_OFFSET(CONTEXT, SegDs), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, SegEs), FIELD_OFFSET(CONTEXT, SegEs), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, SegFs), FIELD_OFFSET(CONTEXT, SegFs), TRUE },
+  { 4, FIELD_OFFSET(KTRAP_FRAME, SegGs), FIELD_OFFSET(CONTEXT, SegGs), TRUE }
 };
 
 static PCHAR GspThreadStates[DeferredReady+1] =
@@ -564,7 +564,7 @@ static LONG
 GspGetEspFromTrapFrame(PKTRAP_FRAME TrapFrame)
 {
   return KeGetPreviousMode() == KernelMode
-         ? (LONG) &TrapFrame->Esp : (LONG)TrapFrame->Esp;
+         ? (LONG) &TrapFrame->HardwareEsp : (LONG)TrapFrame->HardwareEsp;
 }
 
 
index 19b71d6..fa0edf6 100644 (file)
@@ -906,7 +906,7 @@ KiInitializeUserApc(IN PKEXCEPTION_FRAME ExceptionFrame,
             KeGetCurrentThread()->TrapFrame);
 
     /* Don't deliver APCs in V86 mode */
-    if (TrapFrame->Eflags & X86_EFLAGS_VM) return;
+    if (TrapFrame->EFlags & X86_EFLAGS_VM) return;
 
     /* Save the full context */
     Context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
@@ -927,7 +927,7 @@ KiInitializeUserApc(IN PKEXCEPTION_FRAME ExceptionFrame,
 
         /* Run at APC dispatcher */
         TrapFrame->Eip = (ULONG)KeUserApcDispatcher;
-        TrapFrame->Esp = Stack;
+        TrapFrame->HardwareEsp = Stack;
 
         /* Setup the stack */
         *(PULONG_PTR)(Stack + 0 * sizeof(ULONG_PTR)) = (ULONG_PTR)NormalRoutine;
index 50f2f8e..bcb80cf 100644 (file)
@@ -260,8 +260,8 @@ KeUpdateRunTime(
     * Cs bit 0 is always set for user mode if we are in protected mode.
     * V86 mode is counted as user time.
     */
-   if (TrapFrame->Cs & 0x1 ||
-       TrapFrame->Eflags & X86_EFLAGS_VM)
+   if (TrapFrame->SegCs & MODE_MASK ||
+       TrapFrame->EFlags & X86_EFLAGS_VM)
    {
       InterlockedIncrementUL(&CurrentThread->UserTime);
       InterlockedIncrementUL(&CurrentProcess->UserTime);
index cdb2d67..f5185cf 100644 (file)
@@ -207,9 +207,9 @@ KeUserModeCallback(IN ULONG RoutineIndex,
                 Thread->Tcb.TrapFrame, sizeof(KTRAP_FRAME) - (4 * sizeof(ULONG)));
   NewFrame = (PKTRAP_FRAME)((char*)NewStack + StackSize - sizeof(KTRAP_FRAME) - sizeof(FX_SAVE_AREA));
   /* We need the stack pointer to remain 4-byte aligned */
-  NewFrame->Esp -= (((ArgumentLength + 3) & (~ 0x3)) + (4 * sizeof(ULONG)));
+  NewFrame->HardwareEsp -= (((ArgumentLength + 3) & (~ 0x3)) + (4 * sizeof(ULONG)));
   NewFrame->Eip = (ULONG)KeUserCallbackDispatcher;
-  UserEsp = (PULONG)NewFrame->Esp;
+  UserEsp = (PULONG)NewFrame->HardwareEsp;
   UserEsp[0] = 0;     /* Return address. */
   UserEsp[1] = RoutineIndex;
   UserEsp[2] = (ULONG)&UserEsp[4];
index 7af435b..44d5b95 100644 (file)
@@ -544,7 +544,7 @@ MmDumpToPagingFile(ULONG BugCode,
    Headers->Type = MmCoreDumpType;
    if (TrapFrame != NULL)
    {
-      if (!(TrapFrame->Eflags & (1 << 17)))
+      if (!(TrapFrame->EFlags & (1 << 17)))
       {
          memcpy(&Headers->TrapFrame, TrapFrame,
                 sizeof(KTRAP_FRAME) - (4 * sizeof(DWORD)));
index 742326a..99c0b30 100644 (file)
@@ -56,7 +56,7 @@ PspGetOrSetContextKernelRoutine(PKAPC Apc,
     Event = &GetSetContext->Event;
     Mode = GetSetContext->Mode;
 
-    if (TrapFrame->Cs == KGDT_R0_CODE && Mode != KernelMode)
+    if (TrapFrame->SegCs == KGDT_R0_CODE && Mode != KernelMode)
     {
         GetSetContext->Status = STATUS_ACCESS_DENIED;
     }