diff --git a/src/sys/device.c b/src/sys/device.c index ffff8864..4f3d697c 100644 --- a/src/sys/device.c +++ b/src/sys/device.c @@ -631,7 +631,7 @@ PVOID FspFsvolDeviceEnumerateContextByName(PDEVICE_OBJECT DeviceObject, PUNICODE 0, 0, NextFlag, &RestartKey->RestartKey, &RestartKey->DeleteCount, &FileName); if (0 != Result && - RtlPrefixUnicodeString(FileName, Result->FileName, CaseInsensitive) && + FspFileNameIsPrefix(FileName, Result->FileName, CaseInsensitive, 0) && FileName->Length < Result->FileName->Length && '\\' == Result->FileName->Buffer[FileName->Length / sizeof(WCHAR)]) return Result->Context; @@ -699,7 +699,7 @@ static RTL_GENERIC_COMPARE_RESULTS NTAPI FspFsvolDeviceCompareContextByName( PUNICODE_STRING SecondFileName = *(PUNICODE_STRING *)SecondElement; LONG ComparisonResult; - ComparisonResult = RtlCompareUnicodeString(FirstFileName, SecondFileName, CaseInsensitive); + ComparisonResult = FspFileNameCompare(FirstFileName, SecondFileName, CaseInsensitive, 0); if (0 > ComparisonResult) return GenericLessThan; diff --git a/src/sys/driver.h b/src/sys/driver.h index 4b326905..4d05055f 100644 --- a/src/sys/driver.h +++ b/src/sys/driver.h @@ -436,6 +436,21 @@ enum BOOLEAN FspFileNameIsValid(PUNICODE_STRING Path, PUNICODE_STRING StreamPart, PULONG StreamType); BOOLEAN FspFileNameIsValidPattern(PUNICODE_STRING Pattern); VOID FspFileNameSuffix(PUNICODE_STRING Path, PUNICODE_STRING Remain, PUNICODE_STRING Suffix); +#if 0 +LONG FspFileNameCompare( + PUNICODE_STRING Name1, + PUNICODE_STRING Name2, + BOOLEAN IgnoreCase, + PCWCH UpcaseTable); +BOOLEAN FspFileNameIsPrefix( + PCUNICODE_STRING Name1, + PCUNICODE_STRING Name2, + BOOLEAN IgnoreCase, + PCWCH UpcaseTable); +#else +#define FspFileNameCompare(N1,N2,I,U) (ASSERT(0 == (U)), RtlCompareUnicodeString(N1,N2,I)) +#define FspFileNameIsPrefix(N1,N2,I,U) (ASSERT(0 == (U)), RtlPrefixUnicodeString(N1,N2,I)) +#endif NTSTATUS FspFileNameInExpression( PUNICODE_STRING Expression, PUNICODE_STRING Name, diff --git a/src/sys/name.c b/src/sys/name.c index 0c9d38ca..45ecc2b6 100644 --- a/src/sys/name.c +++ b/src/sys/name.c @@ -211,6 +211,9 @@ NTSTATUS FspFileNameInExpression( { PAGED_CODE(); + /* we do not support non-NULL UpcaseTable yet */ + ASSERT(0 == UpcaseTable); + try { *PResult = FsRtlIsNameInExpression(Expression, Name, IgnoreCase, UpcaseTable);