Export (0) Print
Expand All
Expand Minimize

SHGetDiskFreeSpaceEx function

Retrieves disk space information for a disk volume.

Syntax


BOOL SHGetDiskFreeSpaceEx(
  _In_       LPCTSTR pszDirectoryName,
  _Out_opt_  ULARGE_INTEGER *pulFreeBytesAvailableToCaller,
  _Out_opt_  ULARGE_INTEGER *pulTotalNumberOfBytes,
  _Out_opt_  ULARGE_INTEGER *pulTotalNumberOfFreeBytes
);

Parameters

pszDirectoryName [in]

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 [out, optional]

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 [out, optional]

Type: ULARGE_INTEGER*

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

pulTotalNumberOfFreeBytes [out, optional]

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

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Shellapi.h

Library

Shell32.lib

DLL

Shell32.dll (version 5.0 or later)

Unicode and ANSI names

SHGetDiskFreeSpaceExW (Unicode) and SHGetDiskFreeSpaceExA (ANSI)

See also

SHGetDiskFreeSpace
GetDiskFreeSpaceEx

 

 

Community Additions

ADD
Show:
© 2014 Microsoft