Windows: DirControl Reparse Point to File as File
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 2 Mar 2013 06:06:52 +0000 (01:06 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 8 May 2013 00:39:24 +0000 (17:39 -0700)
Implement the Reparse Point to File as File Policy for directory queries.

Change-Id: I6458ae4721f6d8ddea59e78731893fa7b108de19
Reviewed-on: http://gerrit.openafs.org/9342
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSDirControl.cpp

index 2ef7b71..b01c711 100644 (file)
@@ -734,6 +734,7 @@ AFSQueryDirectory( IN PIRP Irp)
         {
 
             ULONG ulBytesRemainingInBuffer;
+           BOOLEAN bUseFileInfo = FALSE;
 
             //
             // Drop the DirOpenReferenceCount held during a prior
@@ -986,9 +987,18 @@ AFSQueryDirectory( IN PIRP Irp)
 
                                 ulAdditionalAttributes = FILE_ATTRIBUTE_DIRECTORY;
                             }
+                           else if ( AFSIgnoreReparsePointToFile())
+                           {
+
+                               bUseFileInfo = TRUE;
+                           }
                         }
 
-                        ulAdditionalAttributes |= FILE_ATTRIBUTE_REPARSE_POINT;
+                       if ( bUseFileInfo == FALSE)
+                       {
+
+                           ulAdditionalAttributes |= FILE_ATTRIBUTE_REPARSE_POINT;
+                       }
 
                         break;
                     }
@@ -1044,9 +1054,23 @@ AFSQueryDirectory( IN PIRP Irp)
                 }
                 case FileDirectoryInformation:
                 {
+
                     pDirInfo = (PFILE_DIRECTORY_INFORMATION)&pBuffer[ ulNextEntry];
 
-                    if( BooleanFlagOn( pDirEntry->Flags, AFS_DIR_ENTRY_FAKE))
+                   if( bUseFileInfo)
+                   {
+
+                       pDirInfo->CreationTime = stFileInfo.CreationTime;
+                       pDirInfo->LastWriteTime = stFileInfo.LastWriteTime;
+                       pDirInfo->LastAccessTime = stFileInfo.LastAccessTime;
+                       pDirInfo->ChangeTime = stFileInfo.ChangeTime;
+
+                       pDirInfo->EndOfFile = stFileInfo.EndOfFile;
+                       pDirInfo->AllocationSize = stFileInfo.AllocationSize;
+
+                       pDirInfo->FileAttributes = stFileInfo.FileAttributes | ulAdditionalAttributes;
+                   }
+                   else if( BooleanFlagOn( pDirEntry->Flags, AFS_DIR_ENTRY_FAKE))
                     {
 
                         pDirInfo->CreationTime = pFcb->ObjectInformation->CreationTime;