4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-18 04:19:21 +08:00

* path.cc (fs_info::update): Correctly handle the volume root directory.

This commit is contained in:
Corinna Vinschen 2007-08-14 15:54:45 +00:00
parent 4a971ce403
commit cb8e4b58f5
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2007-08-14 Corinna Vinschen <corinna@vinschen.de>
* path.cc (fs_info::update): Correctly handle the volume root directory.
2007-08-14 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_base::pc): Make public.

View File

@ -393,17 +393,20 @@ fs_info::update (PUNICODE_STRING upath, bool exists)
if (exists)
status = NtOpenFile (&vol, READ_CONTROL, &attr, &io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT);
while (!NT_SUCCESS (status) && attr.ObjectName->Length > 6 * sizeof (WCHAR))
while (!NT_SUCCESS (status)
&& (attr.ObjectName->Length > 7 * sizeof (WCHAR)
|| status == STATUS_NO_MEDIA_IN_DEVICE))
{
UNICODE_STRING dir;
RtlSplitUnicodePath (attr.ObjectName, &dir, NULL);
dir.Length -= sizeof (WCHAR);
attr.ObjectName = &dir;
if (status == STATUS_NO_MEDIA_IN_DEVICE)
{
no_media = true;
dir.Length = 6 * sizeof (WCHAR);
}
else if (dir.Length > 7 * sizeof (WCHAR))
dir.Length -= sizeof (WCHAR);
status = NtOpenFile (&vol, READ_CONTROL, &attr, &io,
FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
}