What is the *root* reason for this problem (ok Ive seen in the comment,
paged code and holding spin lock, but it doesnt answer my question)?
Because Ive looked at our code of RtlEqualUnicodeString and I see that it
just calls RtlCompareUnicodeString that in turns just loops over the two
memory buffers, checks their contents (and in case we check for char case,
calls RtlUpcaseUnicodeChar). And RtlCompareMemory does that, too? What Im
missing?
Hermès.
-------------------------------------------------------------------------
Author: tfaber
Date: Thu Oct 16 16:40:13 2014
New Revision: 64762
URL: http://svn.reactos.org/svn/reactos?rev=64762&view=rev
Log:
[NPFS]
- Don't call RtlEqualUnicodeString (paged code) while holding a spin lock.
Powered by Driver Verifier.
Modified:
trunk/reactos/drivers/filesystems/npfs/waitsup.c
Modified: trunk/reactos/drivers/filesystems/npfs/waitsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/wa
itsup.c?rev=64762&r1=64761&r2=64762&view=diff
============================================================================
==
--- trunk/reactos/drivers/filesystems/npfs/waitsup.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/filesystems/npfs/waitsup.c [iso-8859-1] Thu Oct
16 16:40:13 2014
@@ -97,6 +97,22 @@
{
InitializeListHead(&WaitQueue->WaitList);
KeInitializeSpinLock(&WaitQueue->WaitLock);
+}
+
+static
+BOOLEAN
+NpEqualUnicodeString(IN PCUNICODE_STRING String1,
+ IN PCUNICODE_STRING String2)
+{
+ SIZE_T EqualLength;
+
+ if (String1->Length != String2->Length)
+ return FALSE;
+
+ EqualLength = RtlCompareMemory(String1->Buffer,
+ String2->Buffer,
+ String1->Length);
+ return EqualLength == String1->Length;
}
NTSTATUS
@@ -156,7 +172,8 @@
PipeName.MaximumLength = PipeName.Length;
}
- if (RtlEqualUnicodeString(&WaitName, &PipeName, FALSE))
+ /* Can't use RtlEqualUnicodeString with a spinlock held */
+ if (NpEqualUnicodeString(&WaitName, &PipeName))
{
/* Found a matching wait. Cancel it */
RemoveEntryList(&WaitIrp->Tail.Overlay.ListEntry);
On 2014-10-15 22:23, pschweitzer(a)svn.reactos.org wrote:
> +/* See:
> + -> http://msdn.microsoft.com/en-us/library/ms724228
> + -> http://bos.asmhackers.net/docs/filesystems/ntfs/standard.html#layout
> + */
> +VOID
> +NtfsDateTimeToFileTime(ULONGLONG NtfsTime,
> + PLARGE_INTEGER SystemTime)
> +{
> +
> + SystemTime->QuadPart = NtfsTime + 116444736000000000;
> +}
Doesn't NTFS use FILETIME directly? I thought that's the reason it's
called "file time" in the first place. ;)
Wikipedia says
"Date range: 1 January 1601 – 28 May 60056 (File times are 64-bit
numbers counting 100-nanosecond intervals (ten million per second)
since 1601, which is 58,000+ years)"
and your link doesn't seem to disagree.
tfaber(a)svn.reactos.org wrote:
> - DbgPrint(DbgString);
> + OutputDebugStringA(DbgString);
FYI, we had OutputDebugStringA there in the first place, but I changed
it to DbgPrint in r40147.
IIRC, output from DbgPrint was directly sent to the debug port while
OutputDebugStringA buffers the data first. This is especially bad, when
a test crashes the OS and we lose several kilobytes of log data before
they are printed out.
Probably, a DbgPrint("%s", DbgString) is the better alternative here.
- Colin
Windows does. Why shouldn't we? It's a non-documented API.
Best regards,
Alex Ionescu
On Sat, Oct 11, 2014 at 1:52 AM, <tkreuzer(a)svn.reactos.org> wrote:
> Author: tkreuzer
> Date: Sat Oct 11 08:52:33 2014
> New Revision: 64658
>
> URL: http://svn.reactos.org/svn/reactos?rev=64658&view=rev
> Log:
> [NTDLL]
> Don't assert that the caller of exported APIs passes correct parameters.
>
> Modified:
> trunk/reactos/dll/ntdll/ldr/ldrapi.c
>
> Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c
> URL:
> http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
>
> ==============================================================================
> --- trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] (original)
> +++ trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] Sat Oct 11
> 08:52:33 2014
> @@ -209,9 +209,6 @@
> /* A normal failure */
> return STATUS_INVALID_PARAMETER_3;
> }
> -
> - /* Do or Do Not. There is no Try */
> - ASSERT((Disposition != NULL) || !(Flags &
> LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY));
>
> /* If the flag is set, make sure we have a valid pointer to use */
> if ((Flags & LDR_LOCK_LOADER_LOCK_FLAG_TRY_ONLY) && !(Disposition))
>
>
>
The ASSERT is there because of the missing functionality. Please see the
comment just above.
Best regards,
Alex Ionescu
On Sun, Oct 5, 2014 at 2:57 AM, <jgardou(a)svn.reactos.org> wrote:
> Author: jgardou
> Date: Sun Oct 5 09:57:02 2014
> New Revision: 64537
>
> URL: http://svn.reactos.org/svn/reactos?rev=64537&view=rev
> Log:
> [NTOS/MM]
> - Do not assert in case of stack overflow, just let the page fault
> handler raise STATUS_STACK_OVERFLOW
>
> Modified:
> trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
>
> Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c
> URL:
> http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
>
> ==============================================================================
> --- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original)
> +++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Sun Oct 5
> 09:57:02 2014
> @@ -82,7 +82,6 @@
> {
> /* We don't -- Windows would try to make this guard page valid
> now */
> DPRINT1("Close to our death...\n");
> - ASSERT(FALSE);
> return STATUS_STACK_OVERFLOW;
> }
>
>
>
>