diff --git a/reactos/hal/halx86/mp/apic.c b/reactos/hal/halx86/mp/apic.c index 58e5e2e66be..8f8310ebba4 100644 --- a/reactos/hal/halx86/mp/apic.c +++ b/reactos/hal/halx86/mp/apic.c @@ -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 diff --git a/reactos/include/ndk/extypes.h b/reactos/include/ndk/extypes.h index c34808d2c2a..be0a6aa9695 100644 --- a/reactos/include/ndk/extypes.h +++ b/reactos/include/ndk/extypes.h @@ -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 diff --git a/reactos/include/ndk/fixmes.txt b/reactos/include/ndk/fixmes.txt index 178bb7885ca..a419982f150 100644 --- a/reactos/include/ndk/fixmes.txt +++ b/reactos/include/ndk/fixmes.txt @@ -2,23 +2,17 @@ Complete list of NDK Fixmes before 1.0 Release (Nov 27th 2005) -------------------------------------------------------------- ______________________________________________________________________________________ [CRITICAL] - Breaking compatibility with official structures. -|pstypes.h - EPROCESS has ReactOS only fields. Includes ReactOS Internal header. -|pstypes.h - W32_CALLOUT_DATA has ReactOS only fields. -|obtypes.h - Object callbacks are ReactOS only definitions. -|obtypes.h - Object Header includes ReactOS only type. -|mmtypes.h - _MADDRESS_SPACE is ReactOS only field. -|ketypes.h - _KPROFILE needs to be updated with new definitions. -|ketypes.h - _KINTERRUPT needs to be verified with new definitions. -|haltypes.h - Loader Parameter Block is ReactOS Version, not NT. +|pstypes.h - EPROCESS has ReactOS only fields. Includes ReactOS Internal header. IFDEF_OUT +|pstypes.h - W32_CALLOUT_DATA has ReactOS only fields. IFDEF-OUT +|obtypes.h - Object callbacks are ReactOS only definitions. IFDEF-OUT ADDREAL +|obtypes.h - Object Header includes ReactOS only type. IFDEF-OUT +|mmtypes.h - _MADDRESS_SPACE is ReactOS only field. IFDEF-OUT +|ketypes.h - _KPROFILE needs to be updated with new definitions. FIXFIX +|ketypes.h - _KINTERRUPT needs to be verified with new definitions. FIXFIX +|haltypes.h - Loader Parameter Block is ReactOS Version, not NT. IFDEF-OUT ADDREAL | [MAJOR] - Using incorrect, missing, or invalid names or definitions. -|i386/ketypes.h - _KTRAP_FRAME definition is broken. -|i386/ketypes.h - _KTSSNOIOPM is not an official type. -|rtltypes.h - PPF_ Defines don't seem to be the real names (try to find them). -|rtltypes.h - _RTL_PROCESS_BACKTRACE_INFORMATION isn't done. -|haltypes.h - Multi-Boot flags are ReactOS Only. -|extypes.h - _RUNDOWN_DESCRIPTOR is possibly incorrect/unofficial. -|extypes.h - Classes 13, 20, 30, 31, 49, 51, 52, 54+ are undefined. +|extypes.h - Classes 13, 20, 30, 31, 49, 51, 52, 54+ are undefined. WONTFIX |_____________________________________________________________________________________ diff --git a/reactos/include/ndk/haltypes.h b/reactos/include/ndk/haltypes.h index 009531d9ff5..0a060aee3ca 100644 --- a/reactos/include/ndk/haltypes.h +++ b/reactos/include/ndk/haltypes.h @@ -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 diff --git a/reactos/include/ndk/i386/ketypes.h b/reactos/include/ndk/i386/ketypes.h index 7a63b589c29..389b7c8f7df 100644 --- a/reactos/include/ndk/i386/ketypes.h +++ b/reactos/include/ndk/i386/ketypes.h @@ -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; // @@ -460,100 +460,46 @@ typedef struct _KIPCR } KIPCR, *PKIPCR; #pragma pack(pop) -// -// FIXME: TSS without I/O Privilege Map -// -#include -typedef struct _KTSSNOIOPM -{ - 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; - // // TSS Definition // +typedef struct _KiIoAccessMap +{ + UCHAR DirectionMap[32]; + UCHAR IoMap[8196]; +} KIIO_ACCESS_MAP; + +#include 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 // diff --git a/reactos/include/ndk/lpctypes.h b/reactos/include/ndk/lpctypes.h index 911e4e8a699..c1fa1bb122e 100644 --- a/reactos/include/ndk/lpctypes.h +++ b/reactos/include/ndk/lpctypes.h @@ -25,6 +25,12 @@ Author: #include #include +// +// 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 diff --git a/reactos/include/ndk/rtltypes.h b/reactos/include/ndk/rtltypes.h index a3c84f4b665..92dc4c958e0 100644 --- a/reactos/include/ndk/rtltypes.h +++ b/reactos/include/ndk/rtltypes.h @@ -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 diff --git a/reactos/lib/kernel32/process/create.c b/reactos/lib/kernel32/process/create.c index 6d4dc4c0b96..d2ca836d56c 100644 --- a/reactos/lib/kernel32/process/create.c +++ b/reactos/lib/kernel32/process/create.c @@ -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, diff --git a/reactos/lib/rtl/ppb.c b/reactos/lib/rtl/ppb.c index 349a361062b..fe7b4bf0a03 100644 --- a/reactos/lib/rtl/ppb.c +++ b/reactos/lib/rtl/ppb.c @@ -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; diff --git a/reactos/lib/rtl/process.c b/reactos/lib/rtl/process.c index c833180fe21..72d35093daf 100644 --- a/reactos/lib/rtl/process.c +++ b/reactos/lib/rtl/process.c @@ -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; diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 59d41fce7ed..642e8579800 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -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); } diff --git a/reactos/ntoskrnl/ex/rundown.c b/reactos/ntoskrnl/ex/rundown.c index c5961d7690e..c24270db9e2 100644 --- a/reactos/ntoskrnl/ex/rundown.c +++ b/reactos/ntoskrnl/ex/rundown.c @@ -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; } } } diff --git a/reactos/ntoskrnl/kd/wrappers/gdbstub.c b/reactos/ntoskrnl/kd/wrappers/gdbstub.c index 0e6fb1b459f..4c583a86b3e 100644 --- a/reactos/ntoskrnl/kd/wrappers/gdbstub.c +++ b/reactos/ntoskrnl/kd/wrappers/gdbstub.c @@ -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; } diff --git a/reactos/ntoskrnl/ke/apc.c b/reactos/ntoskrnl/ke/apc.c index 19b71d6b1c6..fa0edf623f2 100644 --- a/reactos/ntoskrnl/ke/apc.c +++ b/reactos/ntoskrnl/ke/apc.c @@ -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; diff --git a/reactos/ntoskrnl/ke/clock.c b/reactos/ntoskrnl/ke/clock.c index 50f2f8e2c2b..bcb80cf32b6 100644 --- a/reactos/ntoskrnl/ke/clock.c +++ b/reactos/ntoskrnl/ke/clock.c @@ -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); diff --git a/reactos/ntoskrnl/ke/usercall.c b/reactos/ntoskrnl/ke/usercall.c index cdb2d67b0c5..f5185cf3bf8 100644 --- a/reactos/ntoskrnl/ke/usercall.c +++ b/reactos/ntoskrnl/ke/usercall.c @@ -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]; diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index 7af435b0ed1..44d5b950e8d 100644 --- a/reactos/ntoskrnl/mm/pagefile.c +++ b/reactos/ntoskrnl/mm/pagefile.c @@ -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))); diff --git a/reactos/ntoskrnl/ps/debug.c b/reactos/ntoskrnl/ps/debug.c index 742326af44c..99c0b30644e 100644 --- a/reactos/ntoskrnl/ps/debug.c +++ b/reactos/ntoskrnl/ps/debug.c @@ -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; }