Windows: remember when a reparse point is opened
[openafs.git] / src / WINNT / afsrdr / kernel / lib / AFSCreate.cpp
index bc1358f..a9b9ac9 100644 (file)
@@ -145,6 +145,7 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
     ULONG               ulParseFlags = 0;
     GUID                stAuthGroup;
     ULONG               ulNameProcessingFlags = 0;
+    BOOLEAN             bOpenedReparsePoint = FALSE;
 
     __Enter
     {
@@ -648,16 +649,22 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
         }
 
         if ( BooleanFlagOn( ulOptions, FILE_OPEN_REPARSE_POINT) &&
-             pDirectoryCB != NULL &&
-             !BooleanFlagOn( pDirectoryCB->ObjectInformation->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT))
+             pDirectoryCB != NULL)
         {
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
-                          AFS_TRACE_LEVEL_VERBOSE,
-                          "AFSCommonCreate (%08lX) Reparse open request but attribute not set for %wZ Type %08lX\n",
-                          Irp,
-                          &uniFileName,
-                          pDirectoryCB->ObjectInformation->FileType);
+            if( !BooleanFlagOn( pDirectoryCB->ObjectInformation->FileAttributes, FILE_ATTRIBUTE_REPARSE_POINT))
+            {
+                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                              AFS_TRACE_LEVEL_VERBOSE,
+                              "AFSCommonCreate (%08lX) Reparse open request but attribute not set for %wZ Type %08lX\n",
+                              Irp,
+                              &uniFileName,
+                              pDirectoryCB->ObjectInformation->FileType);
+            }
+            else
+            {
+                bOpenedReparsePoint = TRUE;
+            }
         }
 
         //
@@ -1052,6 +1059,11 @@ try_exit:
                     }
                 }
 
+                if( bOpenedReparsePoint)
+                {
+                    SetFlag( pCcb->Flags, CCB_FLAG_MASK_OPENED_REPARSE_POINT);
+                }
+
                 AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
                               AFS_TRACE_LEVEL_VERBOSE,
                               "AFSCreate Count on %wZ DE %p Ccb %p Cnt %d\n",