[FASTFAT]
authorPierre Schweitzer <pierre@reactos.org>
Mon, 25 May 2015 17:30:01 +0000 (17:30 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 25 May 2015 17:30:01 +0000 (17:30 +0000)
[NTFS]
Remove useless cast and use appropriate macro.
Spotted by Thomas

svn path=/trunk/; revision=67911

reactos/drivers/filesystems/fastfat/cleanup.c
reactos/drivers/filesystems/fastfat/dir.c
reactos/drivers/filesystems/fastfat/finfo.c
reactos/drivers/filesystems/fastfat/rw.c
reactos/drivers/filesystems/fastfat/volume.c
reactos/drivers/filesystems/ntfs/finfo.c

index c844ded..69e3281 100644 (file)
@@ -47,12 +47,12 @@ VfatCleanupFile(
     else
     {
         if(!ExAcquireResourceExclusiveLite(&pFcb->MainResource,
-                                           (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                           BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
         {
             return STATUS_PENDING;
         }
         if(!ExAcquireResourceExclusiveLite(&pFcb->PagingIoResource,
-                                           (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                           BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
         {
             ExReleaseResourceLite(&pFcb->MainResource);
             return STATUS_PENDING;
@@ -157,7 +157,7 @@ VfatCleanup(
     }
 
     if (!ExAcquireResourceExclusiveLite(&IrpContext->DeviceExt->DirResource,
-                                        (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                        BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
     {
         return VfatMarkIrpContextForQueue(IrpContext);
     }
index 41bcf37..61e44cd 100644 (file)
@@ -422,7 +422,7 @@ DoQuery(
     Buffer = VfatGetUserBuffer(IrpContext->Irp, FALSE);
 
     if (!ExAcquireResourceSharedLite(&pFcb->MainResource,
-                                     (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                     BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
     {
         Status = VfatLockUserBuffer(IrpContext->Irp, BufferLength, IoWriteAccess);
         if (NT_SUCCESS(Status))
@@ -505,7 +505,7 @@ DoQuery(
     DirContext.ShortNameU.MaximumLength = sizeof(ShortNameBuffer);
 
     if (!ExAcquireResourceExclusiveLite(&IrpContext->DeviceExt->DirResource,
-                                        (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                        BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
     {
         ExReleaseResourceLite(&pFcb->MainResource);
         return VfatMarkIrpContextForQueue(IrpContext);
index 9a35991..66d172f 100644 (file)
@@ -1377,7 +1377,7 @@ VfatQueryInformation(
     if (!(FCB->Flags & FCB_IS_PAGE_FILE))
     {
         if (!ExAcquireResourceSharedLite(&FCB->MainResource,
-                                         (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                         BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
         {
             return VfatMarkIrpContextForQueue(IrpContext);
         }
@@ -1514,7 +1514,7 @@ VfatSetInformation(
     if (FileInformationClass == FileRenameInformation)
     {
         if (!ExAcquireResourceExclusiveLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource,
-                                            (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                            BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
         {
             return VfatMarkIrpContextForQueue(IrpContext);
         }
@@ -1523,7 +1523,7 @@ VfatSetInformation(
     if (!(FCB->Flags & FCB_IS_PAGE_FILE))
     {
         if (!ExAcquireResourceExclusiveLite(&FCB->MainResource,
-                                            (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                            BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
         {
             if (FileInformationClass == FileRenameInformation)
             {
index 7a3d610..c3f8e95 100644 (file)
@@ -887,7 +887,7 @@ VfatWrite(
     if (Fcb->Flags & FCB_IS_PAGE_FILE)
     {
         if (!ExAcquireResourceSharedLite(Resource,
-                                         (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                         BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
         {
             Resource = NULL;
             Status = STATUS_PENDING;
@@ -897,7 +897,7 @@ VfatWrite(
     else
     {
         if (!ExAcquireResourceExclusiveLite(Resource,
-                                            (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                            BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
         {
             Resource = NULL;
             Status = STATUS_PENDING;
index 27584af..a0a297b 100644 (file)
@@ -361,7 +361,7 @@ VfatQueryVolumeInformation(
     DPRINT("VfatQueryVolumeInformation(IrpContext %p)\n", IrpContext);
 
     if (!ExAcquireResourceSharedLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource,
-                                     (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                     BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
     {
         DPRINT1("DirResource failed!\n");
         return VfatMarkIrpContextForQueue(IrpContext);
@@ -436,7 +436,7 @@ VfatSetVolumeInformation(
     DPRINT("VfatSetVolumeInformation(IrpContext %p)\n", IrpContext);
 
     if (!ExAcquireResourceExclusiveLite(&((PDEVICE_EXTENSION)IrpContext->DeviceObject->DeviceExtension)->DirResource,
-                                        (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                        BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
     {
         return VfatMarkIrpContextForQueue(IrpContext);
     }
index 03bc72d..8ebff44 100644 (file)
@@ -247,7 +247,7 @@ NtfsQueryInformation(PNTFS_IRP_CONTEXT IrpContext)
     BufferLength = Stack->Parameters.QueryFile.Length;
 
     if (!ExAcquireResourceSharedLite(&Fcb->MainResource,
-                                     (BOOLEAN)(IrpContext->Flags & IRPCONTEXT_CANWAIT)))
+                                     BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
     {
         return NtfsMarkIrpContextForQueue(IrpContext);
     }