- Add authors' names.

svn path=/trunk/; revision=25380
This commit is contained in:
Alex Ionescu 2007-01-08 17:22:15 +00:00
parent cbd8c78730
commit a22a4040cc
6 changed files with 35 additions and 30 deletions

View file

@ -3,7 +3,7 @@
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/fsrtl/name.c * FILE: ntoskrnl/fsrtl/name.c
* PURPOSE: Provides DBCS parsing and other support routines for FSDs * PURPOSE: Provides DBCS parsing and other support routines for FSDs
* PROGRAMMERS: None. * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/ */
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/

View file

@ -3,7 +3,7 @@
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/fsrtl/faulttol.c * FILE: ntoskrnl/fsrtl/faulttol.c
* PURPOSE: Provides Fault Tolerance support for File System Drivers * PURPOSE: Provides Fault Tolerance support for File System Drivers
* PROGRAMMERS: None. * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/ */
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/

View file

@ -3,7 +3,7 @@
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/fsrtl/filelock.c * FILE: ntoskrnl/fsrtl/filelock.c
* PURPOSE: File Locking implementation for File System Drivers * PURPOSE: File Locking implementation for File System Drivers
* PROGRAMMERS: None. * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/ */
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/

View file

@ -3,7 +3,7 @@
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/fsrtl/fsrtlpc.c * FILE: ntoskrnl/fsrtl/fsrtlpc.c
* PURPOSE: Contains initialization and support code for the FsRtl * PURPOSE: Contains initialization and support code for the FsRtl
* PROGRAMMERS: None. * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/ */
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/

View file

@ -3,7 +3,7 @@
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/fsrtl/largemcb.c * FILE: ntoskrnl/fsrtl/largemcb.c
* PURPOSE: Mapping Control Block (MCB) support for File System Drivers * PURPOSE: Mapping Control Block (MCB) support for File System Drivers
* PROGRAMMERS: None. * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/ */
/* INCLUDES ******************************************************************/ /* INCLUDES ******************************************************************/

View file

@ -3,7 +3,8 @@
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/fsrtl/name.c * FILE: ntoskrnl/fsrtl/name.c
* PURPOSE: Provides name parsing and other support routines for FSDs * 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 ******************************************************************/ /* INCLUDES ******************************************************************/
@ -46,52 +47,56 @@ FsRtlAreNamesEqual(IN PCUNICODE_STRING Name1,
{ {
UNICODE_STRING UpcaseName1; UNICODE_STRING UpcaseName1;
UNICODE_STRING UpcaseName2; UNICODE_STRING UpcaseName2;
BOOLEAN StringsAreEqual; BOOLEAN StringsAreEqual, MemoryAllocated = FALSE;
ULONG i;
/* Well, first check their size */ /* Well, first check their size */
if (Name1->Length != Name2->Length) { if (Name1->Length != Name2->Length) return FALSE;
/* Not equal! */
return FALSE;
}
/* Turn them into Upcase if we don't have a table */ /* Check if the caller didn't give an upcase table */
if (IgnoreCase && !UpcaseTable) { if ((IgnoreCase) && !(UpcaseTable))
RtlUpcaseUnicodeString(&UpcaseName1, Name1, TRUE); {
/* Upcase the string ourselves */
Status = RtlUpcaseUnicodeString(&UpcaseName1, Name1, TRUE);
if (!NT_SUCCESS(Status)) RtlRaiseStatus(Status);
/* Upcase the second string too */
RtlUpcaseUnicodeString(&UpcaseName2, Name2, TRUE); RtlUpcaseUnicodeString(&UpcaseName2, Name2, TRUE);
Name1 = &UpcaseName1; Name1 = &UpcaseName1;
Name2 = &UpcaseName2; 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 */ /* Do a case-sensitive search */
if (!IgnoreCase) { if (!IgnoreCase)
{
ManualCase:
/* Use a raw memory compare */ /* Use a raw memory compare */
StringsAreEqual = RtlEqualMemory(Name1->Buffer, StringsAreEqual = RtlEqualMemory(Name1->Buffer,
Name2->Buffer, Name2->Buffer,
Name1->Length); Name1->Length);
/* Clear the strings if we need to */ /* Check if we allocated strings */
if (IgnoreCase) { if (MemoryAllocated)
{
/* Free them */
RtlFreeUnicodeString(&UpcaseName1); RtlFreeUnicodeString(&UpcaseName1);
RtlFreeUnicodeString(&UpcaseName2); RtlFreeUnicodeString(&UpcaseName2);
} }
/* Return the equality */ /* Return the equality */
return StringsAreEqual; return StringsAreEqual;
}
} else { else
{
/* Case in-sensitive search */ /* Case in-sensitive search */
for (i = 0; i < Name1->Length / sizeof(WCHAR); i++)
LONG i; {
/* Check if the character matches */
for (i = Name1->Length / sizeof(WCHAR) - 1; i >= 0; i--) { if (UpcaseTable[Name1->Buffer[i]] != UpcaseTable[Name2->Buffer[i]])
{
if (UpcaseTable[Name1->Buffer[i]] != UpcaseTable[Name2->Buffer[i]]) {
/* Non-match found! */ /* Non-match found! */
return FALSE; return FALSE;
} }