[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Mon, 8 Dec 2014 19:55:56 +0000 (19:55 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 8 Dec 2014 19:55:56 +0000 (19:55 +0000)
Fix the implementation of the reparse point handling. This takes into account our $FILE_NAME attribute not being aware it's a reparse point...
We now fully get into Io and fail miserably as it seems I forgot one place where reparse points support has to be added.
D'oh!

svn path=/trunk/; revision=65594

reactos/drivers/filesystems/ntfs/create.c

index 7b293fc..9e1574b 100644 (file)
@@ -254,33 +254,26 @@ NtfsCreateFile(PDEVICE_OBJECT DeviceObject,
         if (NtfsFCBIsReparsePoint(Fcb) &&
             ((RequestedOptions & FILE_OPEN_REPARSE_POINT) != FILE_OPEN_REPARSE_POINT))
         {
-            if (Fcb->Entry.Extended.ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
+            PREPARSE_DATA_BUFFER ReparseData = NULL;
+
+            Status = NtfsReadFCBAttribute(DeviceExt, Fcb,
+                                          AttributeReparsePoint, L"", 0,
+                                          (PVOID *)&Irp->Tail.Overlay.AuxiliaryBuffer);
+            if (NT_SUCCESS(Status))
             {
-                Status = NtfsReadFCBAttribute(DeviceExt, Fcb,
-                                              AttributeReparsePoint, L"", 0,
-                                              (PVOID *)&Irp->Tail.Overlay.AuxiliaryBuffer);
-                if (NT_SUCCESS(Status))
+                ReparseData = (PREPARSE_DATA_BUFFER)Irp->Tail.Overlay.AuxiliaryBuffer;
+                if (ReparseData->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
                 {
-                    PREPARSE_DATA_BUFFER ReparseData;
-
-                    ReparseData = (PREPARSE_DATA_BUFFER)Irp->Tail.Overlay.AuxiliaryBuffer;
-                    if (ReparseData->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
-                    {
-                        Status = STATUS_REPARSE;
-                    }
-                    else
-                    {
-                        Status = STATUS_FILE_CORRUPT_ERROR;
-                        ExFreePoolWithTag(ReparseData, TAG_NTFS);
-                    }
+                    Status = STATUS_REPARSE;
+                }
+                else
+                {
+                    Status = STATUS_NOT_IMPLEMENTED;
+                    ExFreePoolWithTag(ReparseData, TAG_NTFS);
                 }
-            }
-            else
-            {
-                Status = STATUS_NOT_IMPLEMENTED;
             }
 
-            Irp->IoStatus.Information = ((Status == STATUS_REPARSE) ? Fcb->Entry.Extended.ReparseTag : 0);
+            Irp->IoStatus.Information = ((Status == STATUS_REPARSE) ? ReparseData->ReparseTag : 0);
 
             NtfsCloseFile(DeviceExt, FileObject);
             return Status;