mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:55:39 +00:00
[NTFS]
Don't attempt to open the unnamed stream from $DATA attribute on file lookup. It was unused & leaking. It fixes opening files that don't have unnamed stream (even though we cannot read there contents yet as we only support unnamed stream) svn path=/trunk/; revision=68285
This commit is contained in:
parent
78f1c4a361
commit
950f284f09
3 changed files with 3 additions and 23 deletions
|
@ -530,7 +530,6 @@ NtfsDirFindFile(PNTFS_VCB Vcb,
|
||||||
ULONGLONG CurrentDir;
|
ULONGLONG CurrentDir;
|
||||||
UNICODE_STRING File;
|
UNICODE_STRING File;
|
||||||
PFILE_RECORD_HEADER FileRecord;
|
PFILE_RECORD_HEADER FileRecord;
|
||||||
PNTFS_ATTR_CONTEXT DataContext;
|
|
||||||
ULONGLONG MFTIndex;
|
ULONGLONG MFTIndex;
|
||||||
|
|
||||||
DPRINT1("NtfsDirFindFile(%p, %p, %S, %p)\n", Vcb, DirectoryFcb, FileToFind, FoundFCB);
|
DPRINT1("NtfsDirFindFile(%p, %p, %S, %p)\n", Vcb, DirectoryFcb, FileToFind, FoundFCB);
|
||||||
|
@ -539,7 +538,7 @@ NtfsDirFindFile(PNTFS_VCB Vcb,
|
||||||
RtlInitUnicodeString(&File, FileToFind);
|
RtlInitUnicodeString(&File, FileToFind);
|
||||||
CurrentDir = DirectoryFcb->MFTIndex;
|
CurrentDir = DirectoryFcb->MFTIndex;
|
||||||
|
|
||||||
Status = NtfsLookupFileAt(Vcb, &File, &FileRecord, &DataContext, &MFTIndex, CurrentDir);
|
Status = NtfsLookupFileAt(Vcb, &File, &FileRecord, &MFTIndex, CurrentDir);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -718,7 +718,6 @@ NTSTATUS
|
||||||
NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
|
NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
|
||||||
PUNICODE_STRING PathName,
|
PUNICODE_STRING PathName,
|
||||||
PFILE_RECORD_HEADER *FileRecord,
|
PFILE_RECORD_HEADER *FileRecord,
|
||||||
PNTFS_ATTR_CONTEXT *DataContext,
|
|
||||||
PULONGLONG MFTIndex,
|
PULONGLONG MFTIndex,
|
||||||
ULONGLONG CurrentMFTIndex)
|
ULONGLONG CurrentMFTIndex)
|
||||||
{
|
{
|
||||||
|
@ -726,7 +725,7 @@ NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG FirstEntry = 0;
|
ULONG FirstEntry = 0;
|
||||||
|
|
||||||
DPRINT("NtfsLookupFileAt(%p, %wZ, %p, %p, %I64x)\n", Vcb, PathName, FileRecord, DataContext, CurrentMFTIndex);
|
DPRINT("NtfsLookupFileAt(%p, %wZ, %p, %I64x)\n", Vcb, PathName, FileRecord, CurrentMFTIndex);
|
||||||
|
|
||||||
FsRtlDissectName(*PathName, &Current, &Remaining);
|
FsRtlDissectName(*PathName, &Current, &Remaining);
|
||||||
|
|
||||||
|
@ -761,21 +760,6 @@ NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!((*FileRecord)->Flags & FRH_DIRECTORY))
|
|
||||||
{
|
|
||||||
Status = FindAttribute(Vcb, *FileRecord, AttributeData, L"", 0, DataContext);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT("NtfsLookupFileAt: Can't find data attribute\n");
|
|
||||||
ExFreePoolWithTag(*FileRecord, TAG_NTFS);
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*DataContext = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
*MFTIndex = CurrentMFTIndex;
|
*MFTIndex = CurrentMFTIndex;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
@ -785,10 +769,9 @@ NTSTATUS
|
||||||
NtfsLookupFile(PDEVICE_EXTENSION Vcb,
|
NtfsLookupFile(PDEVICE_EXTENSION Vcb,
|
||||||
PUNICODE_STRING PathName,
|
PUNICODE_STRING PathName,
|
||||||
PFILE_RECORD_HEADER *FileRecord,
|
PFILE_RECORD_HEADER *FileRecord,
|
||||||
PNTFS_ATTR_CONTEXT *DataContext,
|
|
||||||
PULONGLONG MFTIndex)
|
PULONGLONG MFTIndex)
|
||||||
{
|
{
|
||||||
return NtfsLookupFileAt(Vcb, PathName, FileRecord, DataContext, MFTIndex, NTFS_FILE_ROOT);
|
return NtfsLookupFileAt(Vcb, PathName, FileRecord, MFTIndex, NTFS_FILE_ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
|
@ -723,14 +723,12 @@ NTSTATUS
|
||||||
NtfsLookupFile(PDEVICE_EXTENSION Vcb,
|
NtfsLookupFile(PDEVICE_EXTENSION Vcb,
|
||||||
PUNICODE_STRING PathName,
|
PUNICODE_STRING PathName,
|
||||||
PFILE_RECORD_HEADER *FileRecord,
|
PFILE_RECORD_HEADER *FileRecord,
|
||||||
PNTFS_ATTR_CONTEXT *DataContext,
|
|
||||||
PULONGLONG MFTIndex);
|
PULONGLONG MFTIndex);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
|
NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
|
||||||
PUNICODE_STRING PathName,
|
PUNICODE_STRING PathName,
|
||||||
PFILE_RECORD_HEADER *FileRecord,
|
PFILE_RECORD_HEADER *FileRecord,
|
||||||
PNTFS_ATTR_CONTEXT *DataContext,
|
|
||||||
PULONGLONG MFTIndex,
|
PULONGLONG MFTIndex,
|
||||||
ULONGLONG CurrentMFTIndex);
|
ULONGLONG CurrentMFTIndex);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue