Author: pschweitzer
Date: Sun Aug 31 16:58:44 2008
New Revision: 35846
URL: http://svn.reactos.org/svn/reactos?rev=35846&view=rev
Log:
Reverted r35812 because of unwanted triple fault bug.
See issue #3704,3706 for more details.
Modified:
trunk/reactos/dll/ntdll/dispatch/ (props changed)
trunk/reactos/dll/ntdll/dispatch/dispatch.c
trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S
trunk/reactos/lib/rtl/i386/except.c
trunk/reactos/lib/rtl/rtlp.h
trunk/reactos/lib/rtl/vectoreh.c
Propchange: trunk/reactos/dll/ntdll/dispatch/
------------------------------------------------------------------------------
(empty)
Modified: trunk/reactos/dll/ntdll/dispatch/dispatch.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dispatch/dispatc…
==============================================================================
--- trunk/reactos/dll/ntdll/dispatch/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/dispatch/dispatch.c [iso-8859-1] Sun Aug 31 16:58:44 2008
@@ -15,6 +15,10 @@
typedef NTSTATUS (NTAPI *USER_CALL)(PVOID Argument, ULONG ArgumentLength);
+EXCEPTION_DISPOSITION NTAPI
+RtlpExecuteVectoredExceptionHandlers(IN PEXCEPTION_RECORD ExceptionRecord,
+ IN PCONTEXT Context);
+
/* FUNCTIONS ****************************************************************/
/*
@@ -28,16 +32,26 @@
EXCEPTION_RECORD NestedExceptionRecord;
NTSTATUS Status;
- /* Dispatch the exception and check the result */
- if (RtlDispatchException(ExceptionRecord, Context))
+ /* call the vectored exception handlers */
+ if(RtlpExecuteVectoredExceptionHandlers(ExceptionRecord,
+ Context) != ExceptionContinueExecution)
{
- /* Continue executing */
- Status = NtContinue(Context, FALSE);
+ goto ContinueExecution;
}
else
{
- /* Raise an exception */
- Status = NtRaiseException(ExceptionRecord, Context, FALSE);
+ /* Dispatch the exception and check the result */
+ if(RtlDispatchException(ExceptionRecord, Context))
+ {
+ContinueExecution:
+ /* Continue executing */
+ Status = NtContinue(Context, FALSE);
+ }
+ else
+ {
+ /* Raise an exception */
+ Status = NtRaiseException(ExceptionRecord, Context, FALSE);
+ }
}
/* Setup the Exception record */
Modified: trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dispatch/i386/di…
==============================================================================
--- trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S [iso-8859-1] Sun Aug 31 16:58:44 2008
@@ -183,13 +183,43 @@
.globl _KiUserExceptionDispatcher@8
_KiUserExceptionDispatcher@8:
- /* Clear direction flag */
+ /* clear the direct flag
+ * text from bug 2279
+ * if it not clear it means that if an exception occurs while
+ * the direction flag is set (typically inside memmove), the
+ * exception handlers will be called with the direction flag still
+ * set. The Windows x86-32 and x86-64 ABI requires that the
+ * direction flag be Calling memset() with a compile-time constant
+ * size on both GCC and MSVC will result in inlining a "rep stosd"
+ * instruction. Because of the ABI, they will assume that the
+ * direction flag is clear and not emit a "cld" instruction.
+ * Using memset() in an exception handler therefore will
+ * corrupt memory if the exception occurred during a reverse copy
+ * such as a forward overlapping memmove().
+ *
+ * For reliability and ease of debugging, please add "cld" to the beginning of
+ * KiUserExceptionDispatcher. Note that the same will be true of x86-64 whenever
+ * that happens. This does not affect continuing execution; the CONTEXT of the
+ * exception has the direction flag set and will be restored upon NtContinue.
+ * KiUserApcDispatcher and KiUserCallbackDispatcher need to be evaluated for this
+ * issue.
+ */
+
cld
/* Save the Context and Exception Records */
mov ecx, [esp+4]
mov ebx, [esp]
+ /* Call the vectored exception handler */
+ push ecx
+ push ebx
+ call _RtlpExecuteVectoredExceptionHandlers@8
+
+ /* Check for success */
+ or al, al
+ jnz ContinueExecution
+
/* Dispatch the exception */
sub esp, 8
call _RtlDispatchException@8
@@ -198,6 +228,7 @@
or al, al
jz RaiseException
+ContinueExecution:
/* Pop off the records */
pop ebx
pop ecx
Modified: trunk/reactos/lib/rtl/i386/except.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/except.c?rev=…
==============================================================================
--- trunk/reactos/lib/rtl/i386/except.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/i386/except.c [iso-8859-1] Sun Aug 31 16:58:44 2008
@@ -73,13 +73,6 @@
EXCEPTION_DISPOSITION Disposition;
ULONG_PTR StackLow, StackHigh;
ULONG_PTR RegistrationFrameEnd;
-
- /* Call any registered vectored handlers */
- if (RtlCallVectoredExceptionHandlers(ExceptionRecord, Context))
- {
- /* Exception handled, continue execution */
- return TRUE;
- }
/* Get the current stack limits and registration frame */
RtlpGetStackLimits(&StackLow, &StackHigh);
Modified: trunk/reactos/lib/rtl/rtlp.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtlp.h?rev=35846&r…
==============================================================================
--- trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/rtlp.h [iso-8859-1] Sun Aug 31 16:58:44 2008
@@ -36,13 +36,6 @@
VOID
NTAPI
RtlpSetExceptionList(PEXCEPTION_REGISTRATION_RECORD NewExceptionList);
-
-BOOLEAN
-NTAPI
-RtlCallVectoredExceptionHandlers(
- IN PEXCEPTION_RECORD ExceptionRecord,
- IN PCONTEXT Context
-);
typedef struct _DISPATCHER_CONTEXT
{
Modified: trunk/reactos/lib/rtl/vectoreh.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/vectoreh.c?rev=358…
==============================================================================
--- trunk/reactos/lib/rtl/vectoreh.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/vectoreh.c [iso-8859-1] Sun Aug 31 16:58:44 2008
@@ -28,10 +28,9 @@
/* FUNCTIONS ***************************************************************/
-BOOLEAN
-NTAPI
-RtlCallVectoredExceptionHandlers(IN PEXCEPTION_RECORD ExceptionRecord,
- IN PCONTEXT Context)
+EXCEPTION_DISPOSITION NTAPI
+RtlpExecuteVectoredExceptionHandlers(IN PEXCEPTION_RECORD ExceptionRecord,
+ IN PCONTEXT Context)
{
PLIST_ENTRY CurrentEntry;
PRTL_VECTORED_EXCEPTION_HANDLER veh;
@@ -56,7 +55,7 @@
if(VectoredHandler(&ExceptionInfo) == EXCEPTION_CONTINUE_EXECUTION)
{
- return TRUE;
+ return ExceptionContinueSearch;
}
RtlEnterCriticalSection(&RtlpVectoredExceptionLock);
@@ -64,7 +63,7 @@
RtlLeaveCriticalSection(&RtlpVectoredExceptionLock);
}
- return FALSE;
+ return ExceptionContinueExecution;
}
VOID
Author: pschweitzer
Date: Sun Aug 31 13:50:56 2008
New Revision: 35842
URL: http://svn.reactos.org/svn/reactos?rev=35842&view=rev
Log:
Get back some code that left with r35841...
Code, don't leave us :).
Modified:
branches/pierre-fsd/ntoskrnl/fsrtl/name.c
Modified: branches/pierre-fsd/ntoskrnl/fsrtl/name.c
URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/name.…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/fsrtl/name.c [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/fsrtl/name.c [iso-8859-1] Sun Aug 31 13:50:56 2008
@@ -278,6 +278,8 @@
{
ULONG i, j, k = 0;
+ ASSERT(!FsRtlDoesNameContainWildCards(Name));
+
for (i = 0 ; i < Expression->Length / sizeof(WCHAR) ; i++)
{
if ((FsRtlpUpcaseUnicodeChar(Expression->Buffer[i], IgnoreCase, UpcaseTable) ==
@@ -298,6 +300,7 @@
if (Name->Buffer[j] == '.')
{
k = j;
+ break;
}
}
}
Author: fireball
Date: Sun Aug 31 11:24:29 2008
New Revision: 35836
URL: http://svn.reactos.org/svn/reactos?rev=35836&view=rev
Log:
- Fix two major problems in CmpCleanUpKcbCacheWithLock:
* Accessing (reading and writing - corruption!) freed paged pool memory.
* Lacking a dereference of a parent key.
- Fix a typo in the comment ("reference" -> "dereference").
Modified:
trunk/reactos/ntoskrnl/config/cmkcbncb.c
Modified: trunk/reactos/ntoskrnl/config/cmkcbncb.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmkcbncb.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmkcbncb.c [iso-8859-1] Sun Aug 31 11:24:29 2008
@@ -483,7 +483,7 @@
/* Cleanup the value cache */
CmpCleanUpKcbValueCache(Kcb);
- /* Reference the NCB */
+ /* Dereference the NCB */
CmpDereferenceNameControlBlockWithLock(Kcb->NameBlock);
/* Check if we have an index hint block and free it */
@@ -492,10 +492,10 @@
/* Check if we were already deleted */
Parent = Kcb->ParentKcb;
if (!Kcb->Delete) CmpRemoveKeyControlBlock(Kcb);
-
+
/* Set invalid KCB signature */
Kcb->Signature = CM_KCB_INVALID_SIGNATURE;
-
+
/* Free the KCB as well */
CmpFreeKeyControlBlock(Kcb);
@@ -504,8 +504,8 @@
{
/* Dereference the parent */
LockHeldExclusively ?
- CmpDereferenceKeyControlBlockWithLock(Kcb,LockHeldExclusively) :
- CmpDelayDerefKeyControlBlock(Kcb);
+ CmpDereferenceKeyControlBlockWithLock(Parent,LockHeldExclusively) :
+ CmpDelayDerefKeyControlBlock(Parent);
}
}