* Merge in cygwin-64bit-branch.
This commit is contained in:
@@ -224,7 +224,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
|
||||
}
|
||||
if (!NT_SUCCESS (status))
|
||||
{
|
||||
debug_printf ("Cannot access path %S, status %08lx",
|
||||
debug_printf ("Cannot access path %S, status %y",
|
||||
attr.ObjectName, status);
|
||||
return false;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
|
||||
FileFsAttributeInformation);
|
||||
if (no_media || !NT_SUCCESS (status))
|
||||
{
|
||||
debug_printf ("Cannot get volume attributes (%S), %08lx",
|
||||
debug_printf ("Cannot get volume attributes (%S), %y",
|
||||
attr.ObjectName, status);
|
||||
if (!in_vol)
|
||||
NtClose (vol);
|
||||
@@ -306,14 +306,20 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol)
|
||||
| FILE_CASE_PRESERVED_NAMES \
|
||||
| FILE_UNICODE_ON_DISK \
|
||||
| FILE_NAMED_STREAMS)
|
||||
/* These are the minimal flags supported by NTFS since NT4. Every filesystem
|
||||
not supporting these flags is not a native NTFS. We subsume them under
|
||||
the filesystem type "cifs". */
|
||||
/* These are the minimal flags supported by NTFS since Windows 2000. Every
|
||||
filesystem not supporting these flags is not a native NTFS. We subsume
|
||||
them under the filesystem type "cifs". */
|
||||
#define MINIMAL_WIN_NTFS_FLAGS (FILE_CASE_SENSITIVE_SEARCH \
|
||||
| FILE_CASE_PRESERVED_NAMES \
|
||||
| FILE_UNICODE_ON_DISK \
|
||||
| FILE_PERSISTENT_ACLS \
|
||||
| FILE_FILE_COMPRESSION)
|
||||
| FILE_FILE_COMPRESSION \
|
||||
| FILE_VOLUME_QUOTAS \
|
||||
| FILE_SUPPORTS_SPARSE_FILES \
|
||||
| FILE_SUPPORTS_REPARSE_POINTS \
|
||||
| FILE_SUPPORTS_OBJECT_IDS \
|
||||
| FILE_SUPPORTS_ENCRYPTION \
|
||||
| FILE_NAMED_STREAMS)
|
||||
#define FS_IS_WINDOWS_NTFS TEST_GVI(flags () & MINIMAL_WIN_NTFS_FLAGS, \
|
||||
MINIMAL_WIN_NTFS_FLAGS)
|
||||
/* These are the exact flags of a real Windows FAT/FAT32 filesystem.
|
||||
@@ -479,7 +485,7 @@ mount_info::init ()
|
||||
{
|
||||
char native[PATH_MAX];
|
||||
if (root_idx < 0)
|
||||
api_fatal ("root_idx %d, user_shared magic %p, nmounts %d", root_idx, user_shared->version, nmounts);
|
||||
api_fatal ("root_idx %d, user_shared magic %y, nmounts %d", root_idx, user_shared->version, nmounts);
|
||||
char *p = stpcpy (native, mount[root_idx].native_path);
|
||||
if (!got_usr_bin)
|
||||
{
|
||||
@@ -503,12 +509,12 @@ set_flags (unsigned *flags, unsigned val)
|
||||
if (!(*flags & PATH_BINARY))
|
||||
{
|
||||
*flags |= PATH_TEXT;
|
||||
debug_printf ("flags: text (%p)", *flags & (PATH_TEXT | PATH_BINARY));
|
||||
debug_printf ("flags: text (%y)", *flags & (PATH_TEXT | PATH_BINARY));
|
||||
}
|
||||
else
|
||||
{
|
||||
*flags |= PATH_BINARY;
|
||||
debug_printf ("flags: binary (%p)", *flags & (PATH_TEXT | PATH_BINARY));
|
||||
debug_printf ("flags: binary (%y)", *flags & (PATH_TEXT | PATH_BINARY));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,7 +723,7 @@ mount_info::conv_to_win32_path (const char *src_path, char *dst, device& dev,
|
||||
}
|
||||
|
||||
out_no_chroot_check:
|
||||
debug_printf ("src_path %s, dst %s, flags %p, rc %d", src_path, dst, *flags, rc);
|
||||
debug_printf ("src_path %s, dst %s, flags %y, rc %d", src_path, dst, *flags, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1195,7 +1201,7 @@ mount_info::from_fstab (bool user, WCHAR fstab[], PWCHAR fstab_end)
|
||||
| FILE_OPEN_FOR_BACKUP_INTENT);
|
||||
if (!NT_SUCCESS (status))
|
||||
{
|
||||
debug_printf ("NtOpenFile(%S) failed, %p", &upath, status);
|
||||
debug_printf ("NtOpenFile(%S) failed, %y", &upath, status);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1444,7 +1450,7 @@ mount_info::add_item (const char *native, const char *posix,
|
||||
else
|
||||
posixerr = normalize_posix_path (posix, posixtmp, posixtail);
|
||||
|
||||
debug_printf ("%s[%s], %s[%s], %p",
|
||||
debug_printf ("%s[%s], %s[%s], %y",
|
||||
native, nativeerr ? error : nativetmp,
|
||||
posix, posixerr ? error : posixtmp, mountflags);
|
||||
|
||||
@@ -1808,7 +1814,7 @@ mount (const char *win32_path, const char *posix_path, unsigned flags)
|
||||
res = mount_table->add_item (w32_path, posix_path, flags);
|
||||
}
|
||||
|
||||
syscall_printf ("%R = mount(%s, %s, %p)", res, win32_path, posix_path, flags);
|
||||
syscall_printf ("%R = mount(%s, %s, %y)", res, win32_path, posix_path, flags);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1940,41 +1946,6 @@ endmntent (FILE *)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool
|
||||
get_volume_path_names_for_volume_name (LPCWSTR vol, LPWSTR mounts)
|
||||
{
|
||||
DWORD len;
|
||||
if (GetVolumePathNamesForVolumeNameW (vol, mounts, NT_MAX_PATH, &len))
|
||||
return true;
|
||||
|
||||
/* Windows 2000 doesn't have GetVolumePathNamesForVolumeNameW.
|
||||
Just assume that mount points are not longer than MAX_PATH. */
|
||||
WCHAR drives[MAX_PATH], dvol[MAX_PATH], mp[MAX_PATH + 3];
|
||||
if (!GetLogicalDriveStringsW (MAX_PATH, drives))
|
||||
return false;
|
||||
for (PWCHAR drive = drives; *drive; drive = wcschr (drive, '\0') + 1)
|
||||
{
|
||||
if (!GetVolumeNameForVolumeMountPointW (drive, dvol, MAX_PATH))
|
||||
continue;
|
||||
if (!wcscasecmp (vol, dvol))
|
||||
mounts = wcpcpy (mounts, drive) + 1;
|
||||
wcscpy (mp, drive);
|
||||
HANDLE h = FindFirstVolumeMountPointW (dvol, mp + 3, MAX_PATH);
|
||||
if (h == INVALID_HANDLE_VALUE)
|
||||
continue;
|
||||
do
|
||||
{
|
||||
if (GetVolumeNameForVolumeMountPointW (mp, dvol, MAX_PATH))
|
||||
if (!wcscasecmp (vol, dvol))
|
||||
mounts = wcpcpy (mounts, drive) + 1;
|
||||
}
|
||||
while (FindNextVolumeMountPointW (h, mp, MAX_PATH));
|
||||
FindVolumeMountPointClose (h);
|
||||
}
|
||||
*mounts = L'\0';
|
||||
return true;
|
||||
}
|
||||
|
||||
dos_drive_mappings::dos_drive_mappings ()
|
||||
: mappings(0)
|
||||
{
|
||||
@@ -1993,7 +1964,8 @@ dos_drive_mappings::dos_drive_mappings ()
|
||||
do
|
||||
{
|
||||
/* Skip drives which are not mounted. */
|
||||
if (!get_volume_path_names_for_volume_name (vol, mounts)
|
||||
DWORD len;
|
||||
if (!GetVolumePathNamesForVolumeNameW (vol, mounts, NT_MAX_PATH, &len)
|
||||
|| mounts[0] == L'\0')
|
||||
continue;
|
||||
*wcsrchr (vol, L'\\') = L'\0';
|
||||
@@ -2045,7 +2017,7 @@ dos_drive_mappings::dos_drive_mappings ()
|
||||
}
|
||||
else
|
||||
debug_printf ("Unable to determine the native mapping for %ls "
|
||||
"(error %lu)", vol, GetLastError ());
|
||||
"(error %u)", vol, GetLastError ());
|
||||
}
|
||||
while (FindNextVolumeW (sh, vol, 64));
|
||||
FindVolumeClose (sh);
|
||||
|
Reference in New Issue
Block a user