Bugfixing... Part 10/X:
- Properly compute entry name length in CompareFileName()
- Also, in CompareFileName() properly handle the return of RtlCompareUnicodeString(); this is not RtlEqualUnicodeString()!
- In NtfsLookupFileAt(), don't return an error when we're done walking the path, it's a normal behavior

All these fixes allow our NTFS to go one step farther: it can open directory/files (reading files data remains untested so far) in root and in its subdirs. Which was broken previously.
The said bugfixes in action (and in image): http://www.heisspiter.net/~Pierre/rostests/NTFS_listing_subdir.png

svn path=/trunk/; revision=65041
This commit is contained in:
Pierre Schweitzer 2014-10-27 12:35:58 +00:00
parent 6af614fb4a
commit 817dfb57e2

View file

@ -469,7 +469,7 @@ CompareFileName(PUNICODE_STRING FileName,
EntryName.Buffer = IndexEntry->FileName.Name;
EntryName.Length =
EntryName.MaximumLength = IndexEntry->FileName.NameLength;
EntryName.MaximumLength = IndexEntry->FileName.NameLength * sizeof(WCHAR);
if (DirSearch)
{
@ -477,7 +477,7 @@ CompareFileName(PUNICODE_STRING FileName,
}
else
{
return (RtlCompareUnicodeString(FileName, &EntryName, (IndexEntry->FileName.NameType != NTFS_FILE_NAME_POSIX)) == TRUE);
return (RtlCompareUnicodeString(FileName, &EntryName, (IndexEntry->FileName.NameType != NTFS_FILE_NAME_POSIX)) == 0);
}
}
@ -702,7 +702,7 @@ NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
}
if (Remaining.Length == 0)
return STATUS_OBJECT_PATH_NOT_FOUND;
break;
FsRtlDissectName(Current, &Current, &Remaining);
}