网站首页  词典首页

请输入您要查询的函数:

 

术语 getdiskfreespace
释义 GetDiskFreeSpace
语法:
C++
BOOL WINAPI GetDiskFreeSpace(
__in LPCTSTR lpRootPathName,
__out LPDWORD lpSectorsPerCluster,
__out LPDWORD lpBytesPerSector,
__out LPDWORD lpNumberOfFreeClusters,
__out LPDWORD lpTotalNumberOfClusters
);
GetDiskFreeSpace函数
获取信息的指定磁盘,包括免费的磁盘空间量。
该GetDiskFreeSpace函数不能报告卷大小是大于2千兆字节(GB)。为确保大容量硬盘的应用程序工程,使用GetDiskFreeSpaceEx函数。
参数
lpRootPathName [in]
该磁盘的信息将返回根目录。如果该参数为NULL,则函数使用当前磁盘的根目录。如果这个参数是一个UNC名称,它必须包括一个尾部反斜杠(例如,\\ \\ myServer的\\ MyShare \\)。此外,驱动器规格必须有一个尾部反斜杠(例如,C:\\)。调用应用程序必须有此目录FILE_LIST_DIRECTORY访问权限。
lpSectorsPerCluster [out]
一个变量,它接收的每簇扇区数的指针。
lpBytesPerSector [out]
一个变量,它接收的每扇区字节数的指针。
lpNumberOfFreeClusters [out]
一个变量,它接收的磁盘上的可用到谁是与调用线程相关的用户免费集群总数的指针。
如果每个用户的磁盘配额使用,则此值可能低于自由组磁盘上的总人数。
lpTotalNumberOfClusters [out]
一个变量,它接收的群集磁盘上的可用到谁是与调用线程相关的用户总数的指针。
如果每个用户的磁盘配额使用,则此值可能低于簇磁盘上的总人数。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
该GetDiskFreeSpaceEx功能让您避免的,这是由GetDiskFreeSpace函数所需的运算部分。
符号链接的行为,如果路径指向一个符号链接,操作上的目标进行。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetDiskFreeSpaceW(Unicode)和GetDiskFreeSpaceA(ANSI)的
参见
磁盘管理功能
GetDiskFreeSpaceEx
GetDriveType
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==GetDiskFreeSpace Function
Retrieves information about the specified disk, including the amount of free space on the disk.
The GetDiskFreeSpace function cannot report volume sizes that are greater than 2 gigabytes (GB). To ensure that your application works with large capacity hard drives, use the GetDiskFreeSpaceEx function.
Syntax
C++
BOOL WINAPI GetDiskFreeSpace(
__in LPCTSTR lpRootPathName,
__out LPDWORD lpSectorsPerCluster,
__out LPDWORD lpBytesPerSector,
__out LPDWORD lpNumberOfFreeClusters,
__out LPDWORD lpTotalNumberOfClusters
);
Parameters
lpRootPathName [in]
The root directory of the disk for which information is to be returned. If this parameter is NULL, the function uses the root of the current disk. If this parameter is a UNC name, it must include a trailing backslash (for example, \\\\MyServer\\MyShare\\). Furthermore, a drive specification must have a trailing backslash (for example, C:\\). The calling application must have FILE_LIST_DIRECTORY access rights for this directory.
lpSectorsPerCluster [out]
A pointer to a variable that receives the number of sectors per cluster.
lpBytesPerSector [out]
A pointer to a variable that receives the number of bytes per sector.
lpNumberOfFreeClusters [out]
A pointer to a variable that receives the total number of free clusters on the disk that are available to the user who is associated with the calling thread.
If per-user disk quotas are in use, this value may be less than the total number of free clusters on the disk.
lpTotalNumberOfClusters [out]
A pointer to a variable that receives the total number of clusters on the disk that are available to the user who is associated with the calling thread.
If per-user disk quotas are in use, this value may be less than the total number of clusters on the disk.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
The GetDiskFreeSpaceEx function lets you avoid some of the arithmetic that is required by the GetDiskFreeSpace function.
Symbolic link behavior—If the path points to a symbolic link, the operation is performed on the target.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetDiskFreeSpaceW (Unicode) and GetDiskFreeSpaceA (ANSI)
See Also
Disk Management Functions
GetDiskFreeSpaceEx
GetDriveType
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364935(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:18