kernel32: Fail more gracefully in GetVolumeInformation for fake drive devices.

This commit is contained in:
Alexandre Julliard 2008-01-07 23:17:42 +01:00
parent 47a38c3631
commit c486d8774f
1 changed files with 3 additions and 0 deletions

View File

@ -304,7 +304,10 @@ static enum fs_type VOLUME_ReadFATSuperblock( HANDLE handle, BYTE *buff )
/* try a fixed disk, with a FAT partition */ /* try a fixed disk, with a FAT partition */
if (SetFilePointer( handle, 0, NULL, FILE_BEGIN ) != 0 || if (SetFilePointer( handle, 0, NULL, FILE_BEGIN ) != 0 ||
!ReadFile( handle, buff, SUPERBLOCK_SIZE, &size, NULL )) !ReadFile( handle, buff, SUPERBLOCK_SIZE, &size, NULL ))
{
if (GetLastError() == ERROR_BAD_DEV_TYPE) return FS_UNKNOWN; /* not a real device */
return FS_ERROR; return FS_ERROR;
}
if (size < SUPERBLOCK_SIZE) return FS_UNKNOWN; if (size < SUPERBLOCK_SIZE) return FS_UNKNOWN;