Remove unnecessary executable bits
[reactos.git] / drivers / filesystems / cdfs_new / workque.c
old mode 100755 (executable)
new mode 100644 (file)
index f242c8c..e3975a8
@@ -35,8 +35,8 @@ Abstract:
 
 VOID
 CdAddToWorkque (
-    IN PIRP_CONTEXT IrpContext,
-    IN PIRP Irp
+    _Inout_ PIRP_CONTEXT IrpContext,
+    _Inout_ PIRP Irp
     );
 
 #ifdef ALLOC_PRAGMA
@@ -46,10 +46,11 @@ CdAddToWorkque (
 #endif
 
 \f
+_Requires_lock_held_(_Global_critical_region_)
 NTSTATUS
 CdFsdPostRequest (
-    IN PIRP_CONTEXT IrpContext,
-    IN PIRP Irp
+    _Inout_ PIRP_CONTEXT IrpContext,
+    _Inout_ PIRP Irp
     )
 
 /*++
@@ -96,18 +97,20 @@ Return Value:
 }
 
 \f
+    
+_Requires_lock_held_(_Global_critical_region_)
 VOID
 NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
 CdPrePostIrp (
-    IN PIRP_CONTEXT IrpContext,
-    IN PIRP Irp
+    _Inout_ PIRP_CONTEXT IrpContext,
+    _Inout_ PIRP Irp
     )
 
 /*++
 
 Routine Description:
 
-    This routine performs any necessary work before STATUS_PENDING is
+    This routine performs any neccessary work before STATUS_PENDING is
     returned with the Fsd thread.  This routine is called within the
     filesystem and by the oplock package.
 
@@ -155,6 +158,7 @@ Return Value:
 
             if (!RemovedFcb) {
 
+                _Analysis_assume_lock_held_((*IrpContext->TeardownFcb)->FcbNonpaged->FcbResource);
                 CdReleaseFcb( IrpContext, *(IrpContext->TeardownFcb) );
             }
 
@@ -165,7 +169,7 @@ Return Value:
         break;
 
     //
-    //  We need to lock the user's buffer, unless this is an MDL-read,
+    //  We need to lock the user's buffer, unless this is an MDL read/write,
     //  in which case there is no user buffer.
     //
 
@@ -173,7 +177,16 @@ Return Value:
 
         if (!FlagOn( IrpContext->MinorFunction, IRP_MN_MDL )) {
 
-            CdLockUserBuffer( IrpContext, IrpSp->Parameters.Read.Length );
+            CdLockUserBuffer( IrpContext, IrpSp->Parameters.Read.Length, IoWriteAccess );
+        }
+
+        break;
+
+    case IRP_MJ_WRITE :
+
+        if (!FlagOn( IrpContext->MinorFunction, IRP_MN_MDL )) {
+
+            CdLockUserBuffer( IrpContext, IrpSp->Parameters.Read.Length, IoReadAccess );
         }
 
         break;
@@ -186,7 +199,7 @@ Return Value:
 
         if (IrpContext->MinorFunction == IRP_MN_QUERY_DIRECTORY) {
 
-            CdLockUserBuffer( IrpContext, IrpSp->Parameters.QueryDirectory.Length );
+            CdLockUserBuffer( IrpContext, IrpSp->Parameters.QueryDirectory.Length, IoWriteAccess );
         }
 
         break;
@@ -209,11 +222,13 @@ Return Value:
 }
 
 \f
+
+_Requires_lock_held_(_Global_critical_region_)
 VOID
 NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
 CdOplockComplete (
-    IN PIRP_CONTEXT IrpContext,
-    IN PIRP Irp
+    _Inout_ PIRP_CONTEXT IrpContext,
+    _Inout_ PIRP Irp
     )
 
 /*++
@@ -272,6 +287,7 @@ Return Value:
 
                 if (!RemovedFcb) {
 
+                    _Analysis_assume_lock_held_((*IrpContext->TeardownFcb)->FcbNonpaged->FcbResource);
                     CdReleaseFcb( IrpContext, *(IrpContext->TeardownFcb) );
                 }
 
@@ -307,15 +323,15 @@ Return Value:
 
 VOID
 CdAddToWorkque (
-    IN PIRP_CONTEXT IrpContext,
-    IN PIRP Irp
+    _Inout_ PIRP_CONTEXT IrpContext,
+    _Inout_ PIRP Irp
     )
 
 /*++
 
 Routine Description:
 
-    This routine is called to actually store the posted Irp to the Fsp
+    This routine is called to acually store the posted Irp to the Fsp
     workque.
 
 Arguments:
@@ -387,10 +403,16 @@ Return Value:
     //  Send it off.....
     //
 
+#ifdef _MSC_VER
+#pragma prefast(suppress:28155, "the function prototype is correct")
+#endif
     ExInitializeWorkItem( &IrpContext->WorkQueueItem,
                           (PVOID)CdFspDispatch,/* ReactOS Change: GCC "assignment from incompatible pointer type" */
                           IrpContext );
 
+#ifdef _MSC_VER
+#pragma prefast(suppress: 28159, "prefast believes this routine is obsolete, but it is ok for CDFS to continue using it")
+#endif
     ExQueueWorkItem( &IrpContext->WorkQueueItem, CriticalWorkQueue );
 
     return;