* mount.cc (fs_info::update): Open filesystem with access set to 0.
Explain why.
This commit is contained in:
parent
c9b8019225
commit
d974d420d4
|
@ -1,3 +1,8 @@
|
||||||
|
2009-07-22 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* mount.cc (fs_info::update): Open filesystem with access set to 0.
|
||||||
|
Explain why.
|
||||||
|
|
||||||
2009-07-22 Corinna Vinschen <corinna@vinschen.de>
|
2009-07-22 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* mount.cc: Revert accidental checkin.
|
* mount.cc: Revert accidental checkin.
|
||||||
|
|
|
@ -133,8 +133,11 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
|
||||||
/* Always caseinsensitive. We really just need access to the drive. */
|
/* Always caseinsensitive. We really just need access to the drive. */
|
||||||
InitializeObjectAttributes (&attr, upath, OBJ_CASE_INSENSITIVE, NULL,
|
InitializeObjectAttributes (&attr, upath, OBJ_CASE_INSENSITIVE, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
status = NtOpenFile (&vol, READ_CONTROL, &attr, &io,
|
/* At least one filesystem (HGFS, VMware shared folders) doesn't like
|
||||||
FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
|
to be opened with acces set to just READ_CONTROL. No worries, since
|
||||||
|
filesystem information is available without any access bit set. */
|
||||||
|
status = NtOpenFile (&vol, 0, &attr, &io, FILE_SHARE_VALID_FLAGS,
|
||||||
|
FILE_OPEN_FOR_BACKUP_INTENT);
|
||||||
while (!NT_SUCCESS (status)
|
while (!NT_SUCCESS (status)
|
||||||
&& (attr.ObjectName->Length > 7 * sizeof (WCHAR)
|
&& (attr.ObjectName->Length > 7 * sizeof (WCHAR)
|
||||||
|| status == STATUS_NO_MEDIA_IN_DEVICE))
|
|| status == STATUS_NO_MEDIA_IN_DEVICE))
|
||||||
|
@ -149,8 +152,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
|
||||||
}
|
}
|
||||||
else if (dir.Length > 7 * sizeof (WCHAR))
|
else if (dir.Length > 7 * sizeof (WCHAR))
|
||||||
dir.Length -= sizeof (WCHAR);
|
dir.Length -= sizeof (WCHAR);
|
||||||
status = NtOpenFile (&vol, READ_CONTROL, &attr, &io,
|
status = NtOpenFile (&vol, 0, &attr, &io, FILE_SHARE_VALID_FLAGS,
|
||||||
FILE_SHARE_VALID_FLAGS,
|
|
||||||
FILE_OPEN_FOR_BACKUP_INTENT);
|
FILE_OPEN_FOR_BACKUP_INTENT);
|
||||||
}
|
}
|
||||||
if (!NT_SUCCESS (status))
|
if (!NT_SUCCESS (status))
|
||||||
|
|
Loading…
Reference in New Issue