mountmgr.sys: Don't attempt to read from invalid media.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49615
This commit is contained in:
Alistair Leslie-Hughes 2023-01-19 12:49:28 +11:00 committed by Alexandre Julliard
parent c38aa80ed4
commit 90d50bc611

View file

@ -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 );
}