Windows: More specific error values
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 4 Jan 2012 04:35:51 +0000 (23:35 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 11 Jan 2012 03:50:13 +0000 (19:50 -0800)
When a mount point, symlink, or dfslink cannot be resolved
return STATUS_REPARSE_POINT_NOT_RESOLVED.

When an operation fails because the volume is readonly, return
STATUS_MEDIA_WRITE_PROTECTED.

Change-Id: Ib35f0d7851c087bf8aa25d4b0138ee72fb6f3c68
Reviewed-on: http://gerrit.openafs.org/6501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSFSControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp

index 7c3c2d4..e07d8ce 100644 (file)
@@ -1779,7 +1779,7 @@ AFSProcessCreate( IN PIRP               Irp,
                           "AFSProcessCreate Request failed due to read only volume %wZ\n",
                           FullFileName);
 
-            try_return( ntStatus = STATUS_ACCESS_DENIED);
+            try_return( ntStatus = STATUS_MEDIA_WRITE_PROTECTED);
         }
 
         pParentObjectInfo = ParentDirCB->ObjectInformation;
@@ -3006,7 +3006,7 @@ AFSProcessOverwriteSupersede( IN PDEVICE_OBJECT DeviceObject,
                           Irp,
                           &DirectoryCB->NameInformation.FileName);
 
-            try_return( ntStatus = STATUS_ACCESS_DENIED);
+            try_return( ntStatus = STATUS_MEDIA_WRITE_PROTECTED);
         }
 
         pParentObjectInfo = ParentDirCB->ObjectInformation;
index 825f886..2354043 100644 (file)
@@ -412,7 +412,7 @@ AFSProcessUserFsRequest( IN PIRP Irp)
                         if( pCcb->DirectoryCB->NameInformation.TargetName.Length == 0)
                         {
 
-                            ntStatus = STATUS_ACCESS_DENIED;
+                            ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
 
                             break;
                         }
@@ -451,7 +451,7 @@ AFSProcessUserFsRequest( IN PIRP Irp)
 
                         if( pCcb->DirectoryCB->NameInformation.TargetName.Length == 0)
                         {
-                            ntStatus = STATUS_ACCESS_DENIED;
+                            ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
 
                             break;
                         }
@@ -505,7 +505,7 @@ AFSProcessUserFsRequest( IN PIRP Irp)
                         if( pCcb->DirectoryCB->NameInformation.TargetName.Length == 0)
                         {
 
-                            ntStatus = STATUS_ACCESS_DENIED;
+                            ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
 
                             break;
                         }
index 36fe3ac..760e0a5 100644 (file)
@@ -565,7 +565,7 @@ AFSSetFileInfo( IN PDEVICE_OBJECT LibDeviceObject,
                           "AFSSetFileInfo Request failed due to read only volume\n",
                           Irp);
 
-            try_return( ntStatus = STATUS_ACCESS_DENIED);
+            try_return( ntStatus = STATUS_MEDIA_WRITE_PROTECTED);
         }
 
         if( pFcb->Header.NodeTypeCode == AFS_INVALID_FCB &&
index f47bec2..fc0bd8b 100644 (file)
@@ -5658,7 +5658,7 @@ AFSRetrieveFileAttributes( IN AFSDirectoryCB *ParentDirectoryCB,
                 if( pDirEntry != NULL)
                 {
 
-                    ntStatus = STATUS_ACCESS_DENIED;
+                    ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
                 }
 
                 try_return( ntStatus);
@@ -6331,7 +6331,7 @@ AFSEvaluateRootEntry( IN AFSDirectoryCB *DirectoryCB,
                 if( pDirEntry != NULL)
                 {
 
-                    ntStatus = STATUS_ACCESS_DENIED;
+                    ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
                 }
 
                 try_return( ntStatus);
index 62447ac..7ce548e 100644 (file)
@@ -361,7 +361,7 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
                     if( pDirEntry->NameInformation.TargetName.Length == 0)
                     {
 
-                        ntStatus = STATUS_ACCESS_DENIED;
+                        ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
 
                         AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
                                       AFS_TRACE_LEVEL_ERROR,
@@ -845,7 +845,7 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
 
                         bReleaseCurrentVolume = FALSE;
 
-                        try_return( ntStatus = STATUS_ACCESS_DENIED);
+                        try_return( ntStatus);
                     }
 
                     ASSERT( pCurrentVolume->VolumeReferenceCount > 1);
@@ -3915,7 +3915,7 @@ AFSBuildMountPointTarget( IN GUID *AuthGroup,
                               DirectoryCB->ObjectInformation->FileId.Vnode,
                               DirectoryCB->ObjectInformation->FileId.Unique);
 
-                try_return( ntStatus = STATUS_ACCESS_DENIED);
+                try_return( ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED);
             }
 
             AFSAcquireExcl( &DirectoryCB->NonPaged->Lock,
@@ -4298,7 +4298,7 @@ AFSProcessDFSLink( IN AFSDirectoryCB *DirEntry,
                 if( NT_SUCCESS( ntStatus))
                 {
 
-                    ntStatus = STATUS_ACCESS_DENIED;
+                    ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
                 }
 
                 try_return( ntStatus);