[FASTFAT]
authorPierre Schweitzer <pierre@reactos.org>
Thu, 27 Nov 2014 20:28:50 +0000 (20:28 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 27 Nov 2014 20:28:50 +0000 (20:28 +0000)
Properly handle shared accesses on volume open.
No need to add the support for this in cleanup, it was already there.

svn path=/trunk/; revision=65508

reactos/drivers/filesystems/fastfat/create.c

index ede9a75..05069df 100644 (file)
@@ -503,6 +503,27 @@ VfatCreateFile(
         }
 
         pFcb = DeviceExt->VolumeFcb;
+
+        if (pFcb->OpenHandleCount == 0)
+        {
+            IoSetShareAccess(Stack->Parameters.Create.SecurityContext->DesiredAccess,
+                             Stack->Parameters.Create.ShareAccess,
+                             FileObject,
+                             &pFcb->FCBShareAccess);
+        }
+        else
+        {
+            Status = IoCheckShareAccess(Stack->Parameters.Create.SecurityContext->DesiredAccess,
+                                        Stack->Parameters.Create.ShareAccess,
+                                        FileObject,
+                                        &pFcb->FCBShareAccess,
+                                        FALSE);
+            if (!NT_SUCCESS(Status))
+            {
+                return Status;
+            }
+        }
+
         vfatAttachFCBToFileObject(DeviceExt, pFcb, FileObject);
         DeviceExt->OpenHandleCount++;