Alistair Leslie-Hughes : mountmgr.sys: Don't attempt to read from invalid media.
Module: wine Branch: stable Commit: bccf125524a01ddb32e34fd981426f325abc18e6 URL: https://gitlab.winehq.org/wine/wine/-/commit/bccf125524a01ddb32e34fd981426f3... Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Thu Jan 19 12:49:28 2023 +1100 mountmgr.sys: Don't attempt to read from invalid media. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49615 (cherry picked from commit 90d50bc611b71688287d0ddf28c5babcb8e84e98) --- dlls/mountmgr.sys/device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 22c17025e87..33ce1f248e5 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -899,6 +899,14 @@ static BOOL get_volume_device_info( struct volume *volume ) } else { + if(GetLastError() == ERROR_NOT_READY) + { + TRACE( "%s: removable drive with no inserted media\n", debugstr_a(unix_device) ); + volume->fs_type = FS_UNKNOWN; + CloseHandle( handle ); + return TRUE; + } + volume->fs_type = VOLUME_ReadFATSuperblock( handle, superblock ); if (volume->fs_type == FS_UNKNOWN) volume->fs_type = VOLUME_ReadCDSuperblock( handle, superblock ); }
participants (1)
-
Alexandre Julliard