Windows: FileSystemAttributes = FILE_READ_ONLY_VOLUME
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 31 Mar 2013 00:16:48 +0000 (20:16 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 5 Apr 2013 17:13:38 +0000 (10:13 -0700)
Instead of testing for Characteristics = FILE_READ_ONLY_DEVICE
which applies to the entire device, only return media protected
errors if the volume FileSystemAttributes include FILE_READ_ONLY_VOLUME.

Change-Id: Ice716083c7f0ecb9e80d0ca9e3e143249293d28e
Reviewed-on: http://gerrit.openafs.org/9699
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp

index c306a73..ea0d7bc 100644 (file)
@@ -1706,7 +1706,7 @@ AFSProcessCreate( IN PIRP               Irp,
                       FullFileName,
                       ulAttributes));
 
-        if( BooleanFlagOn( VolumeCB->VolumeInformation.Characteristics, FILE_READ_ONLY_DEVICE))
+        if( BooleanFlagOn( VolumeCB->VolumeInformation.FileSystemAttributes, FILE_READ_ONLY_VOLUME))
         {
 
             AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
@@ -3015,7 +3015,7 @@ AFSProcessOverwriteSupersede( IN PDEVICE_OBJECT DeviceObject,
 
         ulCreateDisposition = (pIrpSp->Parameters.Create.Options >> 24) & 0x000000ff;
 
-        if( BooleanFlagOn( VolumeCB->VolumeInformation.Characteristics, FILE_READ_ONLY_DEVICE))
+        if( BooleanFlagOn( VolumeCB->VolumeInformation.FileSystemAttributes, FILE_READ_ONLY_VOLUME))
         {
 
             AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
index 55a1a31..39103e7 100644 (file)
@@ -583,7 +583,7 @@ AFSSetFileInfo( IN PDEVICE_OBJECT LibDeviceObject,
             try_return( ntStatus);
         }
 
-        if( BooleanFlagOn( pFcb->ObjectInformation->VolumeCB->VolumeInformation.Characteristics, FILE_READ_ONLY_DEVICE))
+        if( BooleanFlagOn( pFcb->ObjectInformation->VolumeCB->VolumeInformation.FileSystemAttributes, FILE_READ_ONLY_VOLUME))
         {
 
             AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
index f8f8c81..97b55a1 100644 (file)
@@ -247,7 +247,7 @@ AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject,
         }
 
         if( pFcb->ObjectInformation->VolumeCB != NULL &&
-            BooleanFlagOn( pFcb->ObjectInformation->VolumeCB->VolumeInformation.Characteristics, FILE_READ_ONLY_DEVICE))
+            BooleanFlagOn( pFcb->ObjectInformation->VolumeCB->VolumeInformation.FileSystemAttributes, FILE_READ_ONLY_VOLUME))
         {
 
             AFSDbgTrace(( AFS_SUBSYSTEM_IO_PROCESSING,