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

Alexandre Julliard julliard at winehq.org
Mon Jan 7 16:25:09 CST 2008


Module: wine
Branch: master
Commit: c486d8774f9c1e9849b42d22e69d98be71596a36
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c486d8774f9c1e9849b42d22e69d98be71596a36

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jan  7 23:17:42 2008 +0100

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

---

 dlls/kernel32/volume.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index 4948ef4..df9180f 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;
 




More information about the wine-cvs mailing list