OSDN Git Service

* globals.cc (ro_u_volume): New R/O unicode string.
authorcorinna <corinna>
Mon, 24 Aug 2009 11:14:29 +0000 (11:14 +0000)
committercorinna <corinna>
Mon, 24 Aug 2009 11:14:29 +0000 (11:14 +0000)
* path.cc (symlink_info::check_reparse_point): Fix check for volume
mount points to work on Vista and later as well.

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

index d5b6c73..fbfa72c 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-24  Corinna Vinschen  <corinna@vinschen.de>
+
+       * globals.cc (ro_u_volume): New R/O unicode string.
+       * path.cc (symlink_info::check_reparse_point): Fix check for volume
+       mount points to work on Vista and later as well.
+
 2009-08-22  Corinna Vinschen  <corinna@vinschen.de>
 
        * strfuncs.cc (__set_charset_from_codepage): Add codepages 20866
index b50bf84..7a408bb 100644 (file)
@@ -100,6 +100,7 @@ UNICODE_STRING _RDATA ro_u_ntfs = _ROU (L"NTFS");
 UNICODE_STRING _RDATA ro_u_sunwnfs = _ROU (L"SUNWNFS");
 UNICODE_STRING _RDATA ro_u_udf = _ROU (L"UDF");
 UNICODE_STRING _RDATA ro_u_unixfs = _ROU (L"UNIXFS");
+UNICODE_STRING _RDATA ro_u_volume = _ROU (L"\\??\\Volume{");
 #undef _RDATA
 #undef _ROU
 
index 4d5424c..e6782f6 100644 (file)
@@ -1865,9 +1865,16 @@ symlink_info::check_reparse_point (HANDLE h)
     }
   else if (rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT)
     {
-      if (rp->SymbolicLinkReparseBuffer.PrintNameLength == 0)
+      UNICODE_STRING subst;
+
+      RtlInitCountedUnicodeString (&subst, 
+                 (WCHAR *)((char *)rp->MountPointReparseBuffer.PathBuffer
+                         + rp->MountPointReparseBuffer.SubstituteNameOffset),
+                 rp->MountPointReparseBuffer.SubstituteNameLength);
+      if (rp->MountPointReparseBuffer.PrintNameLength == 0
+         || RtlEqualUnicodePathPrefix (&subst, &ro_u_volume, TRUE))
        {
-         /* Likely a volume mount point.  Not treated as symlink. */
+         /* Volume mount point.  Not treated as symlink. */
          return 0;
        }
       sys_wcstombs (srcbuf, SYMLINK_MAX + 1,