get the root fcb when creating a file and no parent fcb is returned
authorThomas Bluemel <thomas@reactsoft.com>
Sat, 3 Dec 2005 18:16:02 +0000 (18:16 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Sat, 3 Dec 2005 18:16:02 +0000 (18:16 +0000)
svn path=/trunk/; revision=19842

reactos/drivers/fs/vfat/create.c

index 117721c..c702a30 100644 (file)
@@ -564,6 +564,11 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
                    RequestedDisposition == FILE_SUPERSEDE)
                {
                        ULONG Attributes;
+                       if (ParentFcb == NULL)
+                       {
+                               ParentFcb = vfatOpenRootFCB (DeviceExt);
+                               ASSERT(ParentFcb != NULL);
+                       }
                        Attributes = Stack->Parameters.Create.FileAttributes;
 
                        vfatSplitPathName(&PathNameU, NULL, &FileNameU);
@@ -600,7 +605,10 @@ VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp )
                }
                else
                {
-                       vfatReleaseFCB (DeviceExt, ParentFcb);
+                       if (ParentFcb)
+                       {
+                               vfatReleaseFCB (DeviceExt, ParentFcb);
+                       }
                        return(Status);
                }
        }