[Bug 43947] Disk size in Wine is not correct

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Nov 3 13:33:16 CDT 2017


https://bugs.winehq.org/show_bug.cgi?id=43947

--- Comment #6 from Christoph Heilmann <christoph.heilmann at gmx.de> ---
This seems to be the corresponding Linux statfs() call for
NtQueryVolumeInformationFile():

                3197 #if !defined(linux) || !defined(HAVE_FSTATFS)
                3198                 struct statvfs stfs;
                3199 
                3200                 if (fstatvfs( fd, &stfs ) < 0)
                3201                 {
                3202                     io->u.Status = FILE_GetNtStatus();
                3203                     break;
                3204                 }
b0192cfed Alexa*3205                 bsize = stfs.f_frsize;
3058548eb Rein *3206 #else
                3207                 struct statfs stfs;
                3208                 if (fstatfs( fd, &stfs ) < 0)
                3209                 {
                3210                     io->u.Status = FILE_GetNtStatus();
                3211                     break;
                3212                 }
b0192cfed Alexa*3213                 bsize = stfs.f_bsize;
3058548eb Rein *3214 #endif
4d958a1cb Alexa*3215                 if (bsize == 2048)  /* assume CD-ROM */
                3216                 {
                3217                     info->BytesPerSector = 2048;
                3218                     info->SectorsPerAllocationUnit = 1;
                3219                 }
                3220                 else
                3221                 {
                3222                     info->BytesPerSector = 512;
                3223                     info->SectorsPerAllocationUnit = 8;
                3224                 }
                3225                 info->TotalAllocationUnits.QuadPart =
bsize * stfs.f_blocks / (info->BytesPerSector *
info->SectorsPerAllocationUnit);
                3226                 info->AvailableAllocationUnits.QuadPart =
bsize * stfs.f_bavail / (info->BytesPerSector *
info->SectorsPerAllocationUnit);
01c5ef37c Alexa*3227                 io->Information = sizeof(*info);
                3228                 io->u.Status = STATUS_SUCCESS;
                3229             }
                3230         }

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list