From a22a4040cc7d9aeb0295dc1c94334edef15ba4b4 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Mon, 8 Jan 2007 17:22:15 +0000 Subject: [PATCH] - Add authors' names. svn path=/trunk/; revision=25380 --- reactos/ntoskrnl/fsrtl/dbcsname.c | 2 +- reactos/ntoskrnl/fsrtl/faulttol.c | 2 +- reactos/ntoskrnl/fsrtl/filelock.c | 2 +- reactos/ntoskrnl/fsrtl/fsrtlpc.c | 2 +- reactos/ntoskrnl/fsrtl/largemcb.c | 2 +- reactos/ntoskrnl/fsrtl/name.c | 55 +++++++++++++++++-------------- 6 files changed, 35 insertions(+), 30 deletions(-) diff --git a/reactos/ntoskrnl/fsrtl/dbcsname.c b/reactos/ntoskrnl/fsrtl/dbcsname.c index 34d016cd9c1..f2535d3c6db 100644 --- a/reactos/ntoskrnl/fsrtl/dbcsname.c +++ b/reactos/ntoskrnl/fsrtl/dbcsname.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/fsrtl/name.c * PURPOSE: Provides DBCS parsing and other support routines for FSDs - * PROGRAMMERS: None. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) */ /* INCLUDES ******************************************************************/ diff --git a/reactos/ntoskrnl/fsrtl/faulttol.c b/reactos/ntoskrnl/fsrtl/faulttol.c index 0aceba8c869..7e95a6e6419 100644 --- a/reactos/ntoskrnl/fsrtl/faulttol.c +++ b/reactos/ntoskrnl/fsrtl/faulttol.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/fsrtl/faulttol.c * PURPOSE: Provides Fault Tolerance support for File System Drivers - * PROGRAMMERS: None. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) */ /* INCLUDES ******************************************************************/ diff --git a/reactos/ntoskrnl/fsrtl/filelock.c b/reactos/ntoskrnl/fsrtl/filelock.c index 71360cc0b46..2bbd0dac4ce 100644 --- a/reactos/ntoskrnl/fsrtl/filelock.c +++ b/reactos/ntoskrnl/fsrtl/filelock.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/fsrtl/filelock.c * PURPOSE: File Locking implementation for File System Drivers - * PROGRAMMERS: None. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) */ /* INCLUDES ******************************************************************/ diff --git a/reactos/ntoskrnl/fsrtl/fsrtlpc.c b/reactos/ntoskrnl/fsrtl/fsrtlpc.c index 1fdd15aadc5..3e5f6a44ba1 100644 --- a/reactos/ntoskrnl/fsrtl/fsrtlpc.c +++ b/reactos/ntoskrnl/fsrtl/fsrtlpc.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/fsrtl/fsrtlpc.c * PURPOSE: Contains initialization and support code for the FsRtl - * PROGRAMMERS: None. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) */ /* INCLUDES ******************************************************************/ diff --git a/reactos/ntoskrnl/fsrtl/largemcb.c b/reactos/ntoskrnl/fsrtl/largemcb.c index 6a1b4b37b4f..f0e4c8c1cac 100644 --- a/reactos/ntoskrnl/fsrtl/largemcb.c +++ b/reactos/ntoskrnl/fsrtl/largemcb.c @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/fsrtl/largemcb.c * PURPOSE: Mapping Control Block (MCB) support for File System Drivers - * PROGRAMMERS: None. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) */ /* INCLUDES ******************************************************************/ diff --git a/reactos/ntoskrnl/fsrtl/name.c b/reactos/ntoskrnl/fsrtl/name.c index 1a63945694b..8fe40a1be44 100644 --- a/reactos/ntoskrnl/fsrtl/name.c +++ b/reactos/ntoskrnl/fsrtl/name.c @@ -3,7 +3,8 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: ntoskrnl/fsrtl/name.c * PURPOSE: Provides name parsing and other support routines for FSDs - * PROGRAMMERS: None. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + * Filip Navara (navaraf@reactos.org) */ /* INCLUDES ******************************************************************/ @@ -46,52 +47,56 @@ FsRtlAreNamesEqual(IN PCUNICODE_STRING Name1, { UNICODE_STRING UpcaseName1; UNICODE_STRING UpcaseName2; - BOOLEAN StringsAreEqual; + BOOLEAN StringsAreEqual, MemoryAllocated = FALSE; + ULONG i; /* Well, first check their size */ - if (Name1->Length != Name2->Length) { - /* Not equal! */ - return FALSE; - } + if (Name1->Length != Name2->Length) return FALSE; - /* Turn them into Upcase if we don't have a table */ - if (IgnoreCase && !UpcaseTable) { - RtlUpcaseUnicodeString(&UpcaseName1, Name1, TRUE); + /* Check if the caller didn't give an upcase table */ + if ((IgnoreCase) && !(UpcaseTable)) + { + /* Upcase the string ourselves */ + Status = RtlUpcaseUnicodeString(&UpcaseName1, Name1, TRUE); + if (!NT_SUCCESS(Status)) RtlRaiseStatus(Status); + + /* Upcase the second string too */ RtlUpcaseUnicodeString(&UpcaseName2, Name2, TRUE); Name1 = &UpcaseName1; Name2 = &UpcaseName2; - goto ManualCase; + /* Make sure we go through the path below, but free the strings */ + IgnoreCase = FALSE; + MemoryAllocated = TRUE; } /* Do a case-sensitive search */ - if (!IgnoreCase) { - -ManualCase: + if (!IgnoreCase) + { /* Use a raw memory compare */ StringsAreEqual = RtlEqualMemory(Name1->Buffer, Name2->Buffer, Name1->Length); - /* Clear the strings if we need to */ - if (IgnoreCase) { + /* Check if we allocated strings */ + if (MemoryAllocated) + { + /* Free them */ RtlFreeUnicodeString(&UpcaseName1); RtlFreeUnicodeString(&UpcaseName2); } /* Return the equality */ return StringsAreEqual; - - } else { - + } + else + { /* Case in-sensitive search */ - - LONG i; - - for (i = Name1->Length / sizeof(WCHAR) - 1; i >= 0; i--) { - - if (UpcaseTable[Name1->Buffer[i]] != UpcaseTable[Name2->Buffer[i]]) { - + for (i = 0; i < Name1->Length / sizeof(WCHAR); i++) + { + /* Check if the character matches */ + if (UpcaseTable[Name1->Buffer[i]] != UpcaseTable[Name2->Buffer[i]]) + { /* Non-match found! */ return FALSE; }