Author: fireball
Date: Fri Sep 10 21:13:06 2010
New Revision: 48737
URL: http://svn.reactos.org/svn/reactos?rev=48737&view=rev
Log:
[NTOS]
- Fix a code typo which led to a security issue when the XOR algorithm for the system cookie might actually yield zero. Now it's going to loop as long as the cookie is 0, attempting to generate a non-zero one.
Modified:
trunk/reactos/ntoskrnl/ps/thread.c
Modified: trunk/reactos/ntoskrnl/ps/thread.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=4…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/thread.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/thread.c [iso-8859-1] Fri Sep 10 21:13:06 2010
@@ -91,7 +91,7 @@
}
/* Do we have a cookie set yet? */
- if (!SharedUserData->Cookie)
+ while (!SharedUserData->Cookie)
{
LARGE_INTEGER SystemTime;
ULONG NewCookie;
Author: fireball
Date: Fri Sep 10 21:01:59 2010
New Revision: 48735
URL: http://svn.reactos.org/svn/reactos?rev=48735&view=rev
Log:
[NTOS]
- Fix a strange bug where we were only setting SharedUserData->TestRetInstruction conditionally only if lookup failed - it should be set on success. Also, bail out if the lookups failed.
Modified:
trunk/reactos/ntoskrnl/ps/psmgr.c
Modified: trunk/reactos/ntoskrnl/ps/psmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/psmgr.c?rev=48…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/psmgr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/psmgr.c [iso-8859-1] Fri Sep 10 21:01:59 2010
@@ -200,6 +200,7 @@
Status = PspLookupSystemDllEntryPoint("KiFastSystemCallRet",
(PVOID)&SharedUserData->
SystemCallReturn);
+ if (!NT_SUCCESS(Status)) return Status;
}
else
{
@@ -207,10 +208,11 @@
Status = PspLookupSystemDllEntryPoint("KiIntSystemCall",
(PVOID)&SharedUserData->
SystemCall);
+ if (!NT_SUCCESS(Status)) return Status;
}
/* Set the test instruction */
- if (!NT_SUCCESS(Status)) SharedUserData->TestRetInstruction = 0xC3;
+ SharedUserData->TestRetInstruction = 0xC3;
/* Return the status */
return Status;
Author: fireball
Date: Fri Sep 10 18:13:02 2010
New Revision: 48732
URL: http://svn.reactos.org/svn/reactos?rev=48732&view=rev
Log:
[WIN32K]
- Giannis Adamopoulos: Only dereference a class if it's valid, should fix Heroes 3 crash.
See issue #5606 for more details.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Fri Sep 10 18:13:02 2010
@@ -2184,7 +2184,7 @@
/* If the window was created, the class will be dereferenced by co_UserDestroyWindow */
if (Window)
co_UserDestroyWindow(Window);
- else
+ else if (Class)
IntDereferenceClass(Class, pti->pDeskInfo, pti->ppi);
}
Author: fireball
Date: Fri Sep 10 13:15:51 2010
New Revision: 48731
URL: http://svn.reactos.org/svn/reactos?rev=48731&view=rev
Log:
[HAL]
- Stub support for future timer latency watchdog.
- Change older-style comments to standard ReactOS commenting style.
Modified:
trunk/reactos/hal/halx86/generic/i386/systimer.S
trunk/reactos/hal/halx86/generic/timer.c
Modified: trunk/reactos/hal/halx86/generic/i386/systimer.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/i386/sy…
==============================================================================
--- trunk/reactos/hal/halx86/generic/i386/systimer.S [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/i386/systimer.S [iso-8859-1] Fri Sep 10 13:15:51 2010
@@ -20,9 +20,6 @@
_HalpPerfCounterHigh: .long 0
_HalpSystemHardwareFlags: .long 0
-_UnhandledMsg:
- .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n"
-
/* FUNCTIONS *****************************************************************/
.global _HalpCalibrateStallExecution@0
@@ -389,6 +386,9 @@
/* Read 8254 timer */
mov al, 0
out 0x43, al
+ in al, 0x92
+ or al, _HalpPerfCounterCutoff
+ out 0x92, al
jmp $+2
in al, 0x40
jmp $+2
Modified: trunk/reactos/hal/halx86/generic/timer.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/timer.c…
==============================================================================
--- trunk/reactos/hal/halx86/generic/timer.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/timer.c [iso-8859-1] Fri Sep 10 13:15:51 2010
@@ -14,6 +14,7 @@
/* GLOBALS *******************************************************************/
+ULONG HalpPerfCounterCutoff;
BOOLEAN HalpClockSetMSRate;
ULONG HalpCurrentTimeIncrement;
ULONG HalpCurrentRollOver;
@@ -71,34 +72,26 @@
Flags = __readeflags();
_disable();
- //
- // Program the PIT for binary mode
- //
+ /* Program the PIT for binary mode */
TimerControl.BcdMode = FALSE;
- //
- // Program the PIT to generate a normal rate wave (Mode 3) on channel 0.
- // Channel 0 is used for the IRQ0 clock interval timer, and channel
- // 1 is used for DRAM refresh.
- //
- // Mode 2 gives much better accuracy than Mode 3.
- //
+ /*
+ * Program the PIT to generate a normal rate wave (Mode 3) on channel 0.
+ * Channel 0 is used for the IRQ0 clock interval timer, and channel
+ * 1 is used for DRAM refresh.
+ *
+ * Mode 2 gives much better accuracy than Mode 3.
+ */
TimerControl.OperatingMode = PitOperatingMode2;
TimerControl.Channel = PitChannel0;
- //
- // Set the access mode that we'll use to program the reload value.
- //
+ /* Set the access mode that we'll use to program the reload value */
TimerControl.AccessMode = PitAccessModeLowHigh;
- //
- // Now write the programming bits
- //
+ /* Now write the programming bits */
__outbyte(TIMER_CONTROL_PORT, TimerControl.Bits);
- //
- // Next we write the reload value for channel 0
- //
+ /* Next we write the reload value for channel 0 */
__outbyte(TIMER_CHANNEL0_DATA_PORT, RollOver & 0xFF);
__outbyte(TIMER_CHANNEL0_DATA_PORT, RollOver >> 8);
@@ -125,6 +118,7 @@
{
/* Update the performance counter */
HalpPerfCounter.QuadPart += HalpCurrentRollOver;
+ HalpPerfCounterCutoff = KiEnableTimerWatchdog;
/* Check if someone changed the time rate */
if (HalpClockSetMSRate)