SHGetDiskFreeSpaceExA function

Retrieves disk space information for a disk volume.

Syntax

BOOL SHGetDiskFreeSpaceExA(
  LPCSTR         pszDirectoryName,
  ULARGE_INTEGER *pulFreeBytesAvailableToCaller,
  ULARGE_INTEGER *pulTotalNumberOfBytes,
  ULARGE_INTEGER *pulTotalNumberOfFreeBytes
);

Parameters

pszDirectoryName

Type: LPCTSTR

A null-terminated string that specifies the volume for which size information is retrieved. This can be a drive letter, UNC name, or the path of a folder. You cannot use NULL to represent the current drive.

pulFreeBytesAvailableToCaller

Type: ULARGE_INTEGER*

Pointer to a value that receives the number of bytes on the volume available to the calling application. If the operating system implements per-user quotas, this value may be less than the total number of free bytes on the volume.

pulTotalNumberOfBytes

Type: ULARGE_INTEGER*

Pointer to a value that receives the total size of the volume, in bytes.

pulTotalNumberOfFreeBytes

Type: ULARGE_INTEGER*

Pointer to a value that receives the number of bytes of free space on the volume.

Return Value

Type: BOOL

Returns TRUE if successful, FALSE otherwise.

Remarks

The similarly named function SHGetDiskFreeSpace is merely an alias for SHGetDiskFreeSpaceEx. When you call SHGetDiskFreeSpace you actually call this function.

This function calls the GetDiskFreeSpaceEx function if it is available on the operating system. If GetDiskFreeSpaceEx is not available, it is emulated by calling the GetDiskFreeSpace function and manipulating the return values. For additional information, see the documentation for GetDiskFreeSpaceEx.

Requirements

   
Windows version Windows 2000 Professional, Windows XP [desktop apps only] Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shellapi.h
Library Shell32.lib
DLL Shell32.dll (version 5.0 or later)

See Also

GetDiskFreeSpaceEx

SHGetDiskFreeSpace