fixed code to determine file inode - should work now
authorKJK::Hyperion <hackbunny@reactos.org>
Thu, 21 Mar 2002 22:38:13 +0000 (22:38 +0000)
committerKJK::Hyperion <hackbunny@reactos.org>
Thu, 21 Mar 2002 22:38:13 +0000 (22:38 +0000)
svn path=/trunk/; revision=2749

posix/lib/psxdll/dirent/readdir.c

index c2331e8..f01aab2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: readdir.c,v 1.2 2002/02/20 09:17:56 hyperion Exp $
+/* $Id: readdir.c,v 1.3 2002/03/21 22:38:13 hyperion Exp $
  */
 /*
  * COPYRIGHT:   See COPYING in the top level directory
  */
 /*
  * COPYRIGHT:   See COPYING in the top level directory
@@ -136,7 +136,6 @@ struct _Wdirent *_Wreaddir(DIR *dirp)
 
  INFO("this entry: %ls", pidData->info.FileName);
 
 
  INFO("this entry: %ls", pidData->info.FileName);
 
-#if 0
  /* file inodes are not returned by NtQueryDirectoryFile, we have to open every file */
  /* set file's object attributes */
  wstrFileName.Length = pidData->info.FileNameLength;
  /* file inodes are not returned by NtQueryDirectoryFile, we have to open every file */
  /* set file's object attributes */
  wstrFileName.Length = pidData->info.FileNameLength;
@@ -144,7 +143,7 @@ struct _Wdirent *_Wreaddir(DIR *dirp)
  wstrFileName.Buffer = &pidData->info.FileName[0];
 
  oaFileAttribs.Length = sizeof(OBJECT_ATTRIBUTES);
  wstrFileName.Buffer = &pidData->info.FileName[0];
 
  oaFileAttribs.Length = sizeof(OBJECT_ATTRIBUTES);
- oaFileAttribs.RootDirectory = pidData->dirhandle;
+ oaFileAttribs.RootDirectory = hDir;
  oaFileAttribs.ObjectName = &wstrFileName;
  oaFileAttribs.Attributes = 0;
  oaFileAttribs.SecurityDescriptor = NULL;
  oaFileAttribs.ObjectName = &wstrFileName;
  oaFileAttribs.Attributes = 0;
  oaFileAttribs.SecurityDescriptor = NULL;
@@ -154,7 +153,7 @@ struct _Wdirent *_Wreaddir(DIR *dirp)
  nErrCode = NtOpenFile
  (
   &hFile,
  nErrCode = NtOpenFile
  (
   &hFile,
-  FILE_READ_ATTRIBUTES,
+  FILE_READ_ATTRIBUTES | SYNCHRONIZE,
   &oaFileAttribs,
   &isbStatus,
   0,
   &oaFileAttribs,
   &isbStatus,
   0,
@@ -192,10 +191,6 @@ struct _Wdirent *_Wreaddir(DIR *dirp)
 
  /* return file inode */
  pidData->ent.de_unicode.d_ino = (ino_t)fiiInfo.IndexNumber.QuadPart;
 
  /* return file inode */
  pidData->ent.de_unicode.d_ino = (ino_t)fiiInfo.IndexNumber.QuadPart;
-#endif
-
- FIXME("file inodes currently hardcoded to 0");
- pidData->ent.de_unicode.d_ino = 0;
 
  /* return file name */
  pidData->ent.de_unicode.d_name = &pidData->info.FileName[0];
 
  /* return file name */
  pidData->ent.de_unicode.d_name = &pidData->info.FileName[0];