* fhandler_disk_file.cc (is_volume_mountpoint): Align check with

symlink_info::check_reparse_point().
	* path.cc (symlink_info::check_reparse_point): Rearrange slightly.
	Add code path for unrecognized repare point types.  Add comment.
This commit is contained in:
Corinna Vinschen
2009-11-10 08:54:24 +00:00
parent 6e22c002ff
commit 3aec0f00b1
3 changed files with 31 additions and 15 deletions

View File

@@ -154,6 +154,7 @@ is_volume_mountpoint (POBJECT_ATTRIBUTES attr)
bool ret = false;
IO_STATUS_BLOCK io;
HANDLE reph;
UNICODE_STRING subst;
if (NT_SUCCESS (NtOpenFile (&reph, READ_CONTROL, attr, &io,
FILE_SHARE_VALID_FLAGS,
@@ -166,7 +167,11 @@ is_volume_mountpoint (POBJECT_ATTRIBUTES attr)
&io, FSCTL_GET_REPARSE_POINT, NULL, 0,
(LPVOID) rp, MAXIMUM_REPARSE_DATA_BUFFER_SIZE))
&& rp->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT
&& rp->SymbolicLinkReparseBuffer.PrintNameLength == 0)
&& (RtlInitCountedUnicodeString (&subst,
(WCHAR *)((char *)rp->MountPointReparseBuffer.PathBuffer
+ rp->MountPointReparseBuffer.SubstituteNameOffset),
rp->MountPointReparseBuffer.SubstituteNameLength),
RtlEqualUnicodePathPrefix (&subst, &ro_u_volume, TRUE)))
ret = true;
NtClose (reph);
}