From: Alfred Agrell floating@muncher.se
--- dlls/kernelbase/volume.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/kernelbase/volume.c b/dlls/kernelbase/volume.c index 944c275460c..9a5deffa922 100644 --- a/dlls/kernelbase/volume.c +++ b/dlls/kernelbase/volume.c @@ -163,6 +163,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label, OBJECT_ATTRIBUTES attr; unsigned int i; BOOL ret = FALSE; + BOOL volume_label_warn = FALSE;
if (!root) root = L"\"; if (!RtlDosPathNameToNtPathName_U( root, &nt_name, NULL, NULL )) @@ -200,7 +201,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label, { TRACE( "cannot open device %s: %lx\n", debugstr_w(nt_name.Buffer), status ); if (status == STATUS_ACCESS_DENIED) - MESSAGE( "wine: Read access denied for device %s, FS volume label and serial are not available.\n", debugstr_w(nt_name.Buffer) ); + volume_label_warn = TRUE; status = NtOpenFile( &handle, SYNCHRONIZE, &attr, &io, 0, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); } @@ -209,6 +210,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetVolumeInformationW( LPCWSTR root, LPWSTR label,
ret = GetVolumeInformationByHandleW( handle, label, label_len, serial, filename_len, flags, fsname, fsname_len ); + + if (volume_label_warn && ERR_ON(volume) && ((label && !*label) || (serial && !*serial))) + { + UINT drive_type = GetDriveTypeW(root); + if (drive_type == DRIVE_REMOVABLE || drive_type == DRIVE_CDROM) + ERR( "wine: Read access denied for device %s, FS volume label and serial are not available.\n", debugstr_w(nt_name.Buffer) ); + } NtClose( handle );
done: