PNTFS_ATTR_RECORD ListAttrRecord;
PNTFS_ATTR_RECORD ListAttrRecordEnd;
- // Do not handle non-resident yet
- ASSERT(!(AttrRecord->IsNonResident & 1));
-
ListContext = PrepareAttributeContext(AttrRecord);
ListSize = AttributeDataLength(&ListContext->Record);
if (Context != NULL)
{
- DPRINT("Found context = %p\n", Context);
+ if (AttrRecord->IsNonResident) DPRINT("Found context = %p\n", Context);
return Context;
}
}
Status = NtfsReadDisk(Vcb->StorageDevice,
DataRunStartLCN * Vcb->NtfsInfo.BytesPerCluster + Offset - CurrentOffset,
ReadLength,
+ Vcb->NtfsInfo.BytesPerSector,
(PVOID)Buffer,
FALSE);
if (NT_SUCCESS(Status))
Status = NtfsReadDisk(Vcb->StorageDevice,
DataRunStartLCN * Vcb->NtfsInfo.BytesPerCluster,
ReadLength,
+ Vcb->NtfsInfo.BytesPerSector,
(PVOID)Buffer,
FALSE);
if (!NT_SUCCESS(Status))
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)
+ {
+ NT_VERIFY(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
{
ULONGLONG *OutMFTIndex)
{
PFILE_RECORD_HEADER MftRecord;
- //ULONG Magic;
PNTFS_ATTR_CONTEXT IndexRootCtx;
PNTFS_ATTR_CONTEXT IndexBitmapCtx;
PNTFS_ATTR_CONTEXT IndexAllocationCtx;
if (NT_SUCCESS(ReadFileRecord(Vcb, MFTIndex, MftRecord)))
{
- //Magic = MftRecord->Magic;
+ ASSERT(MftRecord->Ntfs.Type == NRH_FILE_TYPE);
Status = FindAttribute(Vcb, MftRecord, AttributeIndexRoot, L"$I30", 4, &IndexRootCtx);
if (!NT_SUCCESS(Status))
while (IndexEntry < IndexEntryEnd &&
!(IndexEntry->Flags & NTFS_INDEX_ENTRY_END))
{
+ UNICODE_STRING EntryName;
+ EntryName.Buffer = IndexEntry->FileName.Name;
+ EntryName.Length =
+ EntryName.MaximumLength = IndexEntry->FileName.NameLength * sizeof(WCHAR);
+
+ if (IndexEntry->Flags & NTFS_INDEX_ENTRY_NODE)
+ DPRINT1("Warning: sub-node browsing unimplemented! (%wZ)\n", &EntryName);
+
if ((IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK) > 0x10 &&
CurrentEntry >= *FirstEntry &&
CompareFileName(FileName, IndexEntry, DirSearch))
}
IndexBuffer = (PINDEX_BUFFER)IndexRecord;
- ASSERT(IndexBuffer->Ntfs.Type == 'XDNI');
+ ASSERT(IndexBuffer->Ntfs.Type == NRH_INDX_TYPE);
ASSERT(IndexBuffer->Header.AllocatedSize + 0x18 == IndexBlockSize);
IndexEntry = (PINDEX_ENTRY_ATTRIBUTE)((ULONG_PTR)&IndexBuffer->Header + IndexBuffer->Header.FirstEntryOffset);
IndexEntryEnd = (PINDEX_ENTRY_ATTRIBUTE)((ULONG_PTR)&IndexBuffer->Header + IndexBuffer->Header.TotalSizeOfEntries);
while (IndexEntry < IndexEntryEnd &&
!(IndexEntry->Flags & NTFS_INDEX_ENTRY_END))
{
+ UNICODE_STRING EntryName;
+ EntryName.Buffer = IndexEntry->FileName.Name;
+ EntryName.Length =
+ EntryName.MaximumLength = IndexEntry->FileName.NameLength * sizeof(WCHAR);
+
+ if (IndexEntry->Flags & NTFS_INDEX_ENTRY_NODE)
+ DPRINT1("Warning: sub-node browsing unimplemented! (%wZ)\n", &EntryName);
+
if ((IndexEntry->Data.Directory.IndexedFile & NTFS_MFT_MASK) > 0x10 &&
CurrentEntry >= *FirstEntry &&
CompareFileName(FileName, IndexEntry, DirSearch))