Author: tkreuzer
Date: Sat May 1 00:47:44 2010
New Revision: 47066
URL: http://svn.reactos.org/svn/reactos?rev=47066&view=rev
Log:
[NTOSKRNL]
- Fix RtlWalkFrameChain to do usermode back traces for threads that are not system threads. Also use _SEH2_YIELD when leaving the SEH block.
Modified:
trunk/reactos/ntoskrnl/rtl/libsupp.c
Modified: trunk/reactos/ntoskrnl/rtl/libsupp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/rtl/libsupp.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/rtl/libsupp.c [iso-8859-1] Sat May 1 00:47:44 2010
@@ -317,7 +317,7 @@
&StackBegin,
&StackEnd);
if (!Result) return 0;
- }
+ }
/* Use a SEH block for maximum protection */
_SEH2_TRY
@@ -331,12 +331,11 @@
/* Make sure we can trust the TEB and trap frame */
if (!(Teb) ||
- !(Thread->SystemThread) ||
(KeIsAttachedProcess()) ||
(KeGetCurrentIrql() >= DISPATCH_LEVEL))
{
/* Invalid or unsafe attempt to get the stack */
- return 0;
+ _SEH2_YIELD(return 0;)
}
/* Get the stack limits */
Author: mjmartin
Date: Fri Apr 30 13:23:17 2010
New Revision: 47065
URL: http://svn.reactos.org/svn/reactos?rev=47065&view=rev
Log:
[win32k]
- When calling NtUserCallNextHookEx check that the current hook is not the first in the chain. If so don't call the hook proc and just return, as it has already been called and it makes no sense for the NextHook function to call the first hook proc. Fixes bugs #4461 and #4407.
- The previous commit claiming to fix bug #4461 was incorrect, it may have actually fixed bug #5320. Testers please test.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Fri Apr 30 13:23:17 2010
@@ -1050,6 +1050,12 @@
if (!HookObj) RETURN( 0);
+ /* Check that the first hook in the chain is not this hook */
+ NextObj = IntGetFirstHook(IntGetTable(HookObj), HookObj->HookId);
+
+ /* Its the same so it has already been called */
+ if (HookObj == NextObj) RETURN(0);
+
UserReferenceObject(HookObj);
Ansi = HookObj->Ansi;
Author: cgutman
Date: Thu Apr 29 21:20:32 2010
New Revision: 47061
URL: http://svn.reactos.org/svn/reactos?rev=47061&view=rev
Log:
[INF]
- Comment out the service installation for VBE and VGA so the configuration set in first-stage won't get overwritten
- Nasty graphical glitches still remain in VGA mode
- Fixes bug 2073 and bug 4192
Modified:
trunk/reactos/media/inf/display.inf
Modified: trunk/reactos/media/inf/display.inf
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/inf/display.inf?rev=…
==============================================================================
Binary files - no diff available.
Author: tkreuzer
Date: Thu Apr 29 18:39:52 2010
New Revision: 47060
URL: http://svn.reactos.org/svn/reactos?rev=47060&view=rev
Log:
[NTOSKRNL]
- On backtraces, print the address of the call instruction (assumed 5 bytes lentgh) instead of the return address, which in many cases does not make sense. (WinDbg does it this way, too)
- Fix Ke386SaveFpuState to store the fpu state in the buffer, but in the pointer to the buffer
- Anable Ke386SaveFpuState to save the floating point state in KiNpxHandler and KiTrap13Handler, so we know what error we got.
- Disable saving debug registers in the trap frame, as long as the kernel doesn't support this
- Fixes ntdll_winetest exception / OllyDbg freeze/reboot
See issue #5301 for more details.
Modified:
trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h
trunk/reactos/ntoskrnl/kdbg/kdb_cli.c
trunk/reactos/ntoskrnl/ke/i386/exp.c
trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
Modified: trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/intrin_i.h [iso-8859-1] Thu Apr 29 18:39:52 2010
@@ -42,11 +42,11 @@
extern ULONG KeI386FxsrPresent;
if (KeI386FxsrPresent)
{
- __asm__ __volatile__ ("fxsave %0\n" : : "m"(SaveArea));
+ __asm__ __volatile__ ("fxsave %0\n" : : "m"(*SaveArea));
}
else
{
- __asm__ __volatile__ ("fnsave %0\n wait\n" : : "m"(SaveArea));
+ __asm__ __volatile__ ("fnsave %0\n wait\n" : : "m"(*SaveArea));
}
}
Modified: trunk/reactos/ntoskrnl/kdbg/kdb_cli.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb_cli.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] Thu Apr 29 18:39:52 2010
@@ -823,7 +823,8 @@
break;
}
- if (!KdbSymPrintAddress((PVOID)Address))
+ /* Print the location of the call instruction */
+ if (!KdbSymPrintAddress((PVOID)(Address - 5)))
KdbpPrint("<%08x>\n", Address);
else
KdbpPrint("\n");
Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/exp.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/exp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/exp.c [iso-8859-1] Thu Apr 29 18:39:52 2010
@@ -584,7 +584,7 @@
}
/* Handle the Debug Registers */
- if ((ContextFlags & CONTEXT_DEBUG_REGISTERS) == CONTEXT_DEBUG_REGISTERS)
+ if (0 && (ContextFlags & CONTEXT_DEBUG_REGISTERS) == CONTEXT_DEBUG_REGISTERS)
{
/* Loop DR registers */
for (i = 0; i < 4; i++)
Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Thu Apr 29 18:39:52 2010
@@ -240,7 +240,7 @@
}
/* User or kernel trap -- get ready to issue an exception */
- if (Thread->NpxState == NPX_STATE_NOT_LOADED)
+ //if (Thread->NpxState == NPX_STATE_NOT_LOADED)
{
/* Update CR0 */
Cr0 = __readcr0();
@@ -248,7 +248,7 @@
__writecr0(Cr0);
/* Save FPU state */
- //Ke386SaveFpuState(SaveArea);
+ Ke386SaveFpuState(SaveArea);
/* Mark CR0 state dirty */
Cr0 |= NPX_STATE_NOT_LOADED;
@@ -1082,64 +1082,64 @@
* we should probably table this for now since it's not a "real" issue.
*/
- /*
- * NOTE2: Another scenario is the IRET during a V8086 restore (BIOS Call)
- * which will cause a GPF since the trap frame is a total mess (on purpose)
- * as built in KiEnterV86Mode.
- *
- * The idea is to scan for IRET, scan for the known EIP adress, validate CS
- * and then manually issue a jump to the V8086 return EIP.
- */
- Instructions = (PUCHAR)TrapFrame->Eip;
- if (Instructions[0] == 0xCF)
- {
- /*
- * Some evil shit is going on here -- this is not the SS:ESP you're
- * looking for! Instead, this is actually CS:EIP you're looking at!
- * Why? Because part of the trap frame actually corresponds to the IRET
- * stack during the trap exit!
- */
- if ((TrapFrame->HardwareEsp == (ULONG)Ki386BiosCallReturnAddress) &&
- (TrapFrame->HardwareSegSs == (KGDT_R0_CODE | RPL_MASK)))
- {
- /* Exit the V86 trap! */
- Ki386BiosCallReturnAddress(TrapFrame);
- }
- else
- {
- /* Otherwise, this is another kind of IRET fault */
- UNIMPLEMENTED;
- while (TRUE);
- }
- }
+ /*
+ * NOTE2: Another scenario is the IRET during a V8086 restore (BIOS Call)
+ * which will cause a GPF since the trap frame is a total mess (on purpose)
+ * as built in KiEnterV86Mode.
+ *
+ * The idea is to scan for IRET, scan for the known EIP adress, validate CS
+ * and then manually issue a jump to the V8086 return EIP.
+ */
+ Instructions = (PUCHAR)TrapFrame->Eip;
+ if (Instructions[0] == 0xCF)
+ {
+ /*
+ * Some evil shit is going on here -- this is not the SS:ESP you're
+ * looking for! Instead, this is actually CS:EIP you're looking at!
+ * Why? Because part of the trap frame actually corresponds to the IRET
+ * stack during the trap exit!
+ */
+ if ((TrapFrame->HardwareEsp == (ULONG)Ki386BiosCallReturnAddress) &&
+ (TrapFrame->HardwareSegSs == (KGDT_R0_CODE | RPL_MASK)))
+ {
+ /* Exit the V86 trap! */
+ Ki386BiosCallReturnAddress(TrapFrame);
+ }
+ else
+ {
+ /* Otherwise, this is another kind of IRET fault */
+ UNIMPLEMENTED;
+ while (TRUE);
+ }
+ }
/* So since we're not dealing with the above case, check for RDMSR/WRMSR */
- if ((Instructions[0] == 0xF) && // 2-byte opcode
+ if ((Instructions[0] == 0xF) && // 2-byte opcode
(((Instructions[1] >> 8) == 0x30) || // RDMSR
((Instructions[2] >> 8) == 0x32))) // WRMSR
- {
+ {
/* Unknown CPU MSR, so raise an access violation */
KiDispatchException0Args(STATUS_ACCESS_VIOLATION,
TrapFrame->Eip,
TrapFrame);
- }
-
- /* Check for lazy segment load */
- if (TrapFrame->SegDs != (KGDT_R3_DATA | RPL_MASK))
- {
- /* Fix it */
- TrapFrame->SegDs = (KGDT_R3_DATA | RPL_MASK);
- }
- else if (TrapFrame->SegEs != (KGDT_R3_DATA | RPL_MASK))
- {
+ }
+
+ /* Check for lazy segment load */
+ if (TrapFrame->SegDs != (KGDT_R3_DATA | RPL_MASK))
+ {
+ /* Fix it */
+ TrapFrame->SegDs = (KGDT_R3_DATA | RPL_MASK);
+ }
+ else if (TrapFrame->SegEs != (KGDT_R3_DATA | RPL_MASK))
+ {
/* Fix it */
TrapFrame->SegEs = (KGDT_R3_DATA | RPL_MASK);
- }
- else
- {
- /* Whatever it is, we can't handle it */
- KiSystemFatalException(EXCEPTION_GP_FAULT, TrapFrame);
- }
+ }
+ else
+ {
+ /* Whatever it is, we can't handle it */
+ KiSystemFatalException(EXCEPTION_GP_FAULT, TrapFrame);
+ }
/* Return to where we came from */
KiTrapReturn(TrapFrame);
@@ -1353,7 +1353,7 @@
__writecr0(Cr0);
/* Save FPU state */
- //Ke386SaveFpuState(SaveArea);
+ Ke386SaveFpuState(SaveArea);
/* Mark CR0 state dirty */
Cr0 |= NPX_STATE_NOT_LOADED;
@@ -1379,7 +1379,7 @@
FSW_UNDERFLOW |
FSW_PRECISION);
Error &= MxCsrMask;
-
+
/* Now handle any of those legal errors */
if (Error & (FSW_INVALID_OPERATION |
FSW_DENORMAL |
Author: mjmartin
Date: Thu Apr 29 15:41:32 2010
New Revision: 47059
URL: http://svn.reactos.org/svn/reactos?rev=47059&view=rev
Log:
[win32k]
- Fix a problem where application that used WH_CBT hook procedures were receiving destroy window notification on windows that were never created. The window was never created because the application had returned a non zero value when it was notified of window creation, which effectively destroys the window and returns failure for window creation. See CBTProc Function on MSDN. Fixes bug #4461.
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] Thu Apr 29 15:41:32 2010
@@ -2468,7 +2468,23 @@
CLEANUP:
if (!_ret_ && Window && Window->Wnd && ti)
+ {
+ ULONG SavedHooks;
+ /* HACK: co_UserDestroyWindow will call CBT proc with code HCBT_DESTROYWND.
+ Applications can choke on this as a hwnd was never returned from this call */
+ /* Save the flags */
+ SavedHooks = ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks;
+
+ /* Temporary remove the flag */
+ ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks &= ~HOOKID_TO_FLAG(WH_CBT);
+
+ /* Destroy the window */
co_UserDestroyWindow(Window);
+
+ /* Restore the flag */
+ ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks = SavedHooks;
+ }
+
// UserFreeWindowInfo(ti, Window);
if (Window)
{