共用方式為


Using the EmulateGetDiskFreeSpace Fix

This section includes information about using the EmulateGetDiskFreeSpace compatibility fix, including usage and API information.

EmulateGetDiskFreeSpace

This compatibility fix addresses an issue where an application reports the incorrect amount of available hard disk space during installation and use. This compatibility fix intercepts the GetDiskFreeSpace API call and determines the amount of free space on FAT 32 and NTFS systems. If the amount of free space is larger than 2 GB, the compatibility fix returns a value of 2 GB. If the amount of free space is smaller than 2 GB, the compatibility fix returns the actual amount of free space.

Investigating the Issue

The issues that can be resolved by applying the EmulateGetDiskFreeSpace compatibility fix typically appear as error messages that state you do not have enough free disk space to install or use the application, even though there is enough free disk space to meet the application requirements.

Intercepted APIs

The following APIs are intercepted by the EmulateGetDiskFreeSpace compatibility fix.

API Description

GetDiskFreeSpaceA (ANSI)

Used to retrieve information about the specified disk, including the amount of free space available. For more information, see GetDiskFreeSpace.

GetDiskFreeSpaceW (Unicode)

Used to retrieve information about the specified disk, including the amount of free space available. For more information, see GetDiskFreeSpace.

Fixing Your Code

To retrieve volume sizes greater than 2 GB, modify your applications to use the GetDiskFreeSpaceEx function. The GetDiskFreeSpaceEx function retrieves the free disk space information regardless of the size of the hard drive.

See Also

Concepts

Windows Vista and Windows 7 Operating Systems