return STATUS_INSUFFICIENT_RESOURCES;
}
- Status = RtlUpcaseUnicodeString(&Pattern, SearchPattern, FALSE);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("RtlUpcaseUnicodeString('%wZ') failed with status 0x%08lx\n", &Pattern, Status);
- ExFreePoolWithTag(Ccb->DirectorySearchPattern, TAG_NTFS);
- Ccb->DirectorySearchPattern = NULL;
- return Status;
- }
+ memcpy(Ccb->DirectorySearchPattern, SearchPattern->Buffer, SearchPattern->Length);
Ccb->DirectorySearchPattern[SearchPattern->Length / sizeof(WCHAR)] = 0;
}
}
PINDEX_ENTRY_ATTRIBUTE IndexEntry,
BOOLEAN DirSearch)
{
+ BOOLEAN Ret, Alloc = FALSE;
UNICODE_STRING EntryName;
EntryName.Buffer = IndexEntry->FileName.Name;
if (DirSearch)
{
- return FsRtlIsNameInExpression(FileName, &EntryName, (IndexEntry->FileName.NameType != NTFS_FILE_NAME_POSIX), NULL);
+ UNICODE_STRING IntFileName;
+ if (IndexEntry->FileName.NameType != NTFS_FILE_NAME_POSIX)
+ {
+ ASSERT(NT_SUCCESS(RtlUpcaseUnicodeString(&IntFileName, FileName, TRUE)));
+ Alloc = TRUE;
+ }
+ else
+ {
+ IntFileName = *FileName;
+ }
+
+ Ret = FsRtlIsNameInExpression(&IntFileName, &EntryName, (IndexEntry->FileName.NameType != NTFS_FILE_NAME_POSIX), NULL);
+
+ if (Alloc)
+ {
+ RtlFreeUnicodeString(&IntFileName);
+ }
+
+ return Ret;
}
else
{