NtQueryDirectoryFile(): +support FileBothDirInformation; not just FileIdBothDirInform...
[reactos.git] / ntoskrnl / io / dir.c
index f3a2b3f..2c2bccc 100644 (file)
@@ -138,16 +138,24 @@ NtQueryDirectoryFile(
      }
    /* SL_INDEX_SPECIFIED may take precedense over SL_RESTART_SCAN
     * and 'FileInformation' may not be valid if !RestartScan.
+    * ext2fsd.sys-V0.10A requires unspecified SL_INDEX_SPECIFIED
+    * as it would otherwise expect direct pointer to EXT2 directory data block
+    * which we have no information about. FIXME: Why W32 filesystems required
+    * SL_INDEX_SPECIFIED? Is it still valid?
     */
    if (!RestartScan)
      {
-       IoStack->Flags = IoStack->Flags | SL_INDEX_SPECIFIED;
        switch (FileInformationClass) {
           case FileIdBothDirectoryInformation:
              IoStack->Parameters.QueryDirectory.FileIndex = ((FILE_ID_BOTH_DIR_INFORMATION *)FileInformation)->FileIndex;
              break;
+          case FileBothDirectoryInformation:
+             IoStack->Parameters.QueryDirectory.FileIndex = ((FILE_BOTH_DIR_INFORMATION *)FileInformation)->FileIndex;
+             break;
           default: KeBugCheck(0); /* FIXME: such 'FileInformationClass' NOT IMPLEMENTED YET */
           }
+       if (IoStack->Parameters.QueryDirectory.FileIndex)
+          IoStack->Flags = IoStack->Flags | SL_INDEX_SPECIFIED;
      }
    
    IoStack->Parameters.QueryDirectory.FileInformationClass =