* fhandler_disk_file.cc: Change debugging output througout to print

the NT status consistently.  Use UNICODE path information if available.
This commit is contained in:
Corinna Vinschen 2007-08-21 12:09:38 +00:00
parent 3c527a31f3
commit 66e36b7987
2 changed files with 20 additions and 15 deletions

View File

@ -1,3 +1,8 @@
2007-08-21 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc: Change debugging output througout to print
the NT status consistently. Use UNICODE path information if available.
2007-08-20 Corinna Vinschen <corinna@vinschen.de> 2007-08-20 Corinna Vinschen <corinna@vinschen.de>
* hookapi.cc (ld_preload): Call LoadLibraryW. * hookapi.cc (ld_preload): Call LoadLibraryW.

View File

@ -277,8 +277,8 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
FileFsVolumeInformation); FileFsVolumeInformation);
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
{ {
debug_printf ("%u = NtQueryVolumeInformationFile)", debug_printf ("%p = NtQueryVolumeInformationFile(%S)", status,
RtlNtStatusToDosError (status)); pc.get_nt_native_path ());
pfvi->VolumeSerialNumber = 0; pfvi->VolumeSerialNumber = 0;
} }
status = NtQueryInformationFile (get_handle (), &io, pfai, fai_size, status = NtQueryInformationFile (get_handle (), &io, pfai, fai_size,
@ -305,8 +305,8 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
pfai->StandardInformation.NumberOfLinks, pfai->StandardInformation.NumberOfLinks,
pfai->BasicInformation.FileAttributes); pfai->BasicInformation.FileAttributes);
} }
debug_printf ("%u = NtQueryInformationFile)", debug_printf ("%p = NtQueryInformationFile(%S)",
RtlNtStatusToDosError (status)); status, pc.get_nt_native_path ());
return -1; return -1;
} }
@ -344,7 +344,7 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
| FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_FOR_BACKUP_INTENT
| FILE_DIRECTORY_FILE))) | FILE_DIRECTORY_FILE)))
{ {
debug_printf ("%u = NtOpenFile)", RtlNtStatusToDosError (status)); debug_printf ("%p = NtOpenFile(%S)", status, pc.get_nt_native_path ());
goto too_bad; goto too_bad;
} }
if (wincap.has_fileid_dirinfo () if (wincap.has_fileid_dirinfo ()
@ -360,8 +360,8 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
FileId.QuadPart = 0; /* get_namehash is called in fstat_helper. */ FileId.QuadPart = 0; /* get_namehash is called in fstat_helper. */
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
{ {
debug_printf ("%u = NtQueryDirectoryFile)", debug_printf ("%p = NtQueryDirectoryFile(%S)", status,
RtlNtStatusToDosError (status)); pc.get_nt_native_path ());
NtClose (dir); NtClose (dir);
goto too_bad; goto too_bad;
} }
@ -369,8 +369,8 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
FileFsVolumeInformation); FileFsVolumeInformation);
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
{ {
debug_printf ("%u = NtQueryVolumeInformationFile)", debug_printf ("%p = NtQueryVolumeInformationFile(%S)",
RtlNtStatusToDosError (status)); status, pc.get_nt_native_path ());
pfvi->VolumeSerialNumber = 0; pfvi->VolumeSerialNumber = 0;
} }
NtClose (dir); NtClose (dir);
@ -703,7 +703,8 @@ fhandler_disk_file::fstatvfs (struct statvfs *sfs)
FSCTL_GET_NTFS_VOLUME_DATA, FSCTL_GET_NTFS_VOLUME_DATA,
NULL, 0, &nvdb, sizeof nvdb); NULL, 0, &nvdb, sizeof nvdb);
if (!NT_SUCCESS (status)) if (!NT_SUCCESS (status))
debug_printf ("NtFsControlFile (%s) failed, status %lx", status); debug_printf ("%p = NtFsControlFile(%S,FSCTL_GET_NTFS_VOLUME_DATA)",
status, pc.get_nt_native_path ());
else else
sfs->f_blocks = nvdb.TotalClusters.QuadPart; sfs->f_blocks = nvdb.TotalClusters.QuadPart;
} }
@ -1034,8 +1035,8 @@ fhandler_disk_file::ftruncate (_off64_t length, bool allow_truncate)
{ {
status = NtFsControlFile (get_handle (), NULL, NULL, NULL, &io, status = NtFsControlFile (get_handle (), NULL, NULL, NULL, &io,
FSCTL_SET_SPARSE, NULL, 0, NULL, 0); FSCTL_SET_SPARSE, NULL, 0, NULL, 0);
syscall_printf ("0x%08X = NtFsControlFile (%p, FSCTL_SET_SPARSE)", syscall_printf ("%p = NtFsControlFile(%S,FSCTL_SET_SPARSE)",
status, get_handle ()); status, pc.get_nt_native_path ());
} }
status = NtSetInformationFile (get_handle (), &io, status = NtSetInformationFile (get_handle (), &io,
&feofi, sizeof feofi, &feofi, sizeof feofi,
@ -1988,9 +1989,8 @@ fhandler_disk_file::rewinddir (DIR *dir)
| FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_FOR_BACKUP_INTENT
| FILE_DIRECTORY_FILE); | FILE_DIRECTORY_FILE);
if (!NT_SUCCESS (stat)) if (!NT_SUCCESS (stat))
debug_printf ("Unable to reopen dir %s, NT error: 0x%08x, " debug_printf ("Unable to reopen dir %s, NT error: %p",
"win32: %lu", get_name (), status, get_name (), status);
RtlNtStatusToDosError (status));
else else
{ {
NtClose (get_handle ()); NtClose (get_handle ());