From c486d8774f9c1e9849b42d22e69d98be71596a36 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 7 Jan 2008 23:17:42 +0100 Subject: [PATCH] kernel32: Fail more gracefully in GetVolumeInformation for fake drive devices. --- dlls/kernel32/volume.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 4948ef4f4b3..df9180f6a49 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -304,7 +304,10 @@ static enum fs_type VOLUME_ReadFATSuperblock( HANDLE handle, BYTE *buff ) /* try a fixed disk, with a FAT partition */ if (SetFilePointer( handle, 0, NULL, FILE_BEGIN ) != 0 || !ReadFile( handle, buff, SUPERBLOCK_SIZE, &size, NULL )) + { + if (GetLastError() == ERROR_BAD_DEV_TYPE) return FS_UNKNOWN; /* not a real device */ return FS_ERROR; + } if (size < SUPERBLOCK_SIZE) return FS_UNKNOWN;