Maarten Lankhorst : kernel32: Fix GetVolumeInformation for fat32 partitions .
Alexandre Julliard
julliard at winehq.org
Sat Mar 1 06:13:25 CST 2008
Module: wine
Branch: master
Commit: 1032ba6dc3aca18365152ecd10b428deda5c3e83
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1032ba6dc3aca18365152ecd10b428deda5c3e83
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Fri Feb 29 15:12:09 2008 -0800
kernel32: Fix GetVolumeInformation for fat32 partitions.
---
dlls/kernel32/volume.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index df9180f..74397a9 100644
--- a/dlls/kernel32/volume.c
+++ b/dlls/kernel32/volume.c
@@ -339,7 +339,7 @@ static enum fs_type VOLUME_ReadFATSuperblock( HANDLE handle, BYTE *buff )
sectors_per_cluster = buff[0x0d];
/* check if the parameters are reasonable and will not cause
* arithmetic errors in the calculation */
- reasonable = num_boot_sectors < 16 &&
+ reasonable = num_boot_sectors < total_sectors &&
num_fats < 16 &&
bytes_per_sector >= 512 && bytes_per_sector % 512 == 0 &&
sectors_per_cluster > 1;
@@ -516,6 +516,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len,
{
static const WCHAR audiocdW[] = {'A','u','d','i','o',' ','C','D',0};
static const WCHAR fatW[] = {'F','A','T',0};
+ static const WCHAR fat32W[] = {'F','A','T','3','2',0};
static const WCHAR ntfsW[] = {'N','T','F','S',0};
static const WCHAR cdfsW[] = {'C','D','F','S',0};
@@ -611,8 +612,9 @@ fill_fs_info: /* now fill in the information that depends on the file system ty
if (flags) *flags = FILE_READ_ONLY_VOLUME;
break;
case FS_FAT1216:
- case FS_FAT32:
if (fsname) lstrcpynW( fsname, fatW, fsname_len );
+ case FS_FAT32:
+ if (type == FS_FAT32 && fsname) lstrcpynW( fsname, fat32W, fsname_len );
if (filename_len) *filename_len = 255;
if (flags) *flags = FILE_CASE_PRESERVED_NAMES; /* FIXME */
break;
More information about the wine-cvs
mailing list