GetDiskFreeSpace function kernel32
Retrieves information about the specified disk, including the amount of free space on the disk.
To learn more, see learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-getdiskfreespacew.
Implementation
Win32Result<bool> GetDiskFreeSpace(
PCWSTR? lpRootPathName,
Pointer<Uint32>? lpSectorsPerCluster,
Pointer<Uint32>? lpBytesPerSector,
Pointer<Uint32>? lpNumberOfFreeClusters,
Pointer<Uint32>? lpTotalNumberOfClusters,
) {
final result_ = GetDiskFreeSpaceW_Wrapper(
lpRootPathName ?? nullptr,
lpSectorsPerCluster ?? nullptr,
lpBytesPerSector ?? nullptr,
lpNumberOfFreeClusters ?? nullptr,
lpTotalNumberOfClusters ?? nullptr,
);
return Win32Result(value: result_.value.i32 != FALSE, error: result_.error);
}