Author: pschweitzer
Date: Sat Jun 27 08:55:34 2015
New Revision: 68285
URL:
http://svn.reactos.org/svn/reactos?rev=68285&view=rev
Log:
[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)
Modified:
trunk/reactos/drivers/filesystems/ntfs/fcb.c
trunk/reactos/drivers/filesystems/ntfs/mft.c
trunk/reactos/drivers/filesystems/ntfs/ntfs.h
Modified: trunk/reactos/drivers/filesystems/ntfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/fcb.c [iso-8859-1] Sat Jun 27 08:55:34 2015
@@ -530,7 +530,6 @@
ULONGLONG CurrentDir;
UNICODE_STRING File;
PFILE_RECORD_HEADER FileRecord;
- PNTFS_ATTR_CONTEXT DataContext;
ULONGLONG MFTIndex;
DPRINT1("NtfsDirFindFile(%p, %p, %S, %p)\n", Vcb, DirectoryFcb, FileToFind,
FoundFCB);
@@ -539,7 +538,7 @@
RtlInitUnicodeString(&File, FileToFind);
CurrentDir = DirectoryFcb->MFTIndex;
- Status = NtfsLookupFileAt(Vcb, &File, &FileRecord, &DataContext,
&MFTIndex, CurrentDir);
+ Status = NtfsLookupFileAt(Vcb, &File, &FileRecord, &MFTIndex,
CurrentDir);
if (!NT_SUCCESS(Status))
{
return Status;
Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] Sat Jun 27 08:55:34 2015
@@ -718,7 +718,6 @@
NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
PUNICODE_STRING PathName,
PFILE_RECORD_HEADER *FileRecord,
- PNTFS_ATTR_CONTEXT *DataContext,
PULONGLONG MFTIndex,
ULONGLONG CurrentMFTIndex)
{
@@ -726,7 +725,7 @@
NTSTATUS Status;
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);
@@ -759,21 +758,6 @@
DPRINT("NtfsLookupFileAt: Can't read MFT record\n");
ExFreePoolWithTag(*FileRecord, TAG_NTFS);
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;
@@ -785,10 +769,9 @@
NtfsLookupFile(PDEVICE_EXTENSION Vcb,
PUNICODE_STRING PathName,
PFILE_RECORD_HEADER *FileRecord,
- PNTFS_ATTR_CONTEXT *DataContext,
PULONGLONG MFTIndex)
{
- return NtfsLookupFileAt(Vcb, PathName, FileRecord, DataContext, MFTIndex,
NTFS_FILE_ROOT);
+ return NtfsLookupFileAt(Vcb, PathName, FileRecord, MFTIndex, NTFS_FILE_ROOT);
}
NTSTATUS
Modified: trunk/reactos/drivers/filesystems/ntfs/ntfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/n…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Sat Jun 27 08:55:34 2015
@@ -723,14 +723,12 @@
NtfsLookupFile(PDEVICE_EXTENSION Vcb,
PUNICODE_STRING PathName,
PFILE_RECORD_HEADER *FileRecord,
- PNTFS_ATTR_CONTEXT *DataContext,
PULONGLONG MFTIndex);
NTSTATUS
NtfsLookupFileAt(PDEVICE_EXTENSION Vcb,
PUNICODE_STRING PathName,
PFILE_RECORD_HEADER *FileRecord,
- PNTFS_ATTR_CONTEXT *DataContext,
PULONGLONG MFTIndex,
ULONGLONG CurrentMFTIndex);