Author: pschweitzer
Date: Sun Feb 14 22:44:54 2016
New Revision: 70750
URL:
http://svn.reactos.org/svn/reactos?rev=70750&view=rev
Log:
[NTFS]
Cowardly refuse to continue processing (enumerating/reading) when stumbling upon a
compressed entry.
This avoids infinite loops when enumerating, incorrect files contents when reading.
CORE-10814 #resolve #comment 'Fixed' with r70750
Modified:
trunk/reactos/drivers/filesystems/ntfs/dirctl.c
trunk/reactos/drivers/filesystems/ntfs/fcb.c
trunk/reactos/drivers/filesystems/ntfs/ntfs.h
trunk/reactos/drivers/filesystems/ntfs/rw.c
Modified: trunk/reactos/drivers/filesystems/ntfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/dirctl.c [iso-8859-1] Sun Feb 14 22:44:54 2016
@@ -298,6 +298,13 @@
FileInformationClass = Stack->Parameters.QueryDirectory.FileInformationClass;
FileIndex = Stack->Parameters.QueryDirectory.FileIndex;
+ if (NtfsFCBIsCompressed(Fcb))
+ {
+ DPRINT1("Compressed directory!\n");
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+ }
+
if (SearchPattern != NULL)
{
if (!Ccb->DirectorySearchPattern)
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] Sun Feb 14 22:44:54 2016
@@ -138,6 +138,12 @@
BOOLEAN
+NtfsFCBIsCompressed(PNTFS_FCB Fcb)
+{
+ return ((Fcb->Entry.FileAttributes & NTFS_FILE_TYPE_COMPRESSED) ==
NTFS_FILE_TYPE_COMPRESSED);
+}
+
+BOOLEAN
NtfsFCBIsRoot(PNTFS_FCB Fcb)
{
return (wcscmp(Fcb->PathName, L"\\") == 0);
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] Sun Feb 14 22:44:54 2016
@@ -643,6 +643,9 @@
NtfsFCBIsReparsePoint(PNTFS_FCB Fcb);
BOOLEAN
+NtfsFCBIsCompressed(PNTFS_FCB Fcb);
+
+BOOLEAN
NtfsFCBIsRoot(PNTFS_FCB Fcb);
VOID
Modified: trunk/reactos/drivers/filesystems/ntfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] Sun Feb 14 22:44:54 2016
@@ -71,6 +71,13 @@
Fcb = (PNTFS_FCB)FileObject->FsContext;
+ if (NtfsFCBIsCompressed(Fcb))
+ {
+ DPRINT1("Compressed file!\n");
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+ }
+
FileRecord = ExAllocatePoolWithTag(NonPagedPool,
DeviceExt->NtfsInfo.BytesPerFileRecord, TAG_NTFS);
if (FileRecord == NULL)
{