OSDN Git Service

* path.cc (symlink_info::check): Make sure AllocationSize and EndOfFile
authorcorinna <corinna>
Tue, 14 Sep 2010 14:10:38 +0000 (14:10 +0000)
committercorinna <corinna>
Tue, 14 Sep 2010 14:10:38 +0000 (14:10 +0000)
are stored in the right order when fetching the info from the
NtQueryDirectoryFile result.

winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index 80a7055..01ffad0 100644 (file)
@@ -1,3 +1,9 @@
+2010-09-14  Corinna Vinschen  <corinna@vinschen.de>
+
+       * path.cc (symlink_info::check): Make sure AllocationSize and EndOfFile
+       are stored in the right order when fetching the info from the
+       NtQueryDirectoryFile result.
+
 2010-09-13  Corinna Vinschen  <corinna@vinschen.de>
 
        * fhandler_process.cc (get_mem_values): Simplify code.  Fix
index 4705465..d29aff0 100644 (file)
@@ -2525,6 +2525,14 @@ restart:
                    {
                      fileattr = fdi_buf.fdi.FileAttributes;
                      memcpy (pfnoi, &fdi_buf.fdi.CreationTime, sizeof *pfnoi);
+                     /* Amazing, but true:  The FILE_NETWORK_OPEN_INFORMATION
+                        structure has the AllocationSize and EndOfFile members
+                        interchanged relative to the directory information
+                        classes. */
+                     pfnoi->AllocationSize.QuadPart
+                       = fdi_buf.fdi.AllocationSize.QuadPart;
+                     pfnoi->EndOfFile.QuadPart
+                       = fdi_buf.fdi.EndOfFile.QuadPart;
                    }
                }
              ext_tacked_on = !!*ext_here;