网站首页  词典首页

请输入您要查询的函数:

 

术语 getvolumeinformation
释义 GetVolumeInformation
语法:
C++
BOOL WINAPI GetVolumeInformation(
__in_opt LPCTSTR lpRootPathName,
__out LPTSTR lpVolumeNameBuffer,
__in DWORD nVolumeNameSize,
__out_opt LPDWORD lpVolumeSerialNumber,
__out_opt LPDWORD lpMaximumComponentLength,
__out_opt LPDWORD lpFileSystemFlags,
__out LPTSTR lpFileSystemNameBuffer,
__in DWORD nFileSystemNameSize
);
GetVolumeInformation函数
检索有关该文件系统,并与指定的根目录关联的卷。
要指定一个处理这些信息时,检索,使用GetVolumeInformationByHandleW功能。
要检索一个文件或目录,使用FSCTL_GET_COMPRESSION当前压缩状态。
参数
lpRootPathName [中,可选]
一个字符串,包含卷的根目录指向被描述。
如果该参数为NULL,则当前目录的根使用。一个尾部反斜杠是必需的。例如,您指定\\ \\ myServer的\\ MyShare为“\\ \\ myServer的\\ MyShare \\”,或在C驱动器为“C:\\”。
lpVolumeNameBuffer [out]
阿一个缓冲区,它接收一个指定的卷名的指针。最大缓冲区大小MAX_PATH 1。
nVolumeNameSize [in]
该卷名缓冲区的长度,在TCHARs。最大缓冲区大小MAX_PATH 1。
此参数被忽略,如果卷名缓冲区没有提供。
lpVolumeSerialNumber [指出,可选]
一个变量收卷序列号的指针。
此参数可以是NULL如果序列号是不需要的。
这个函数返回卷序列号,经营系统分配时,硬盘被格式化。要以编程方式获取硬盘的序列号,制造商分配,使用Windows管理规范(WMI)Win32_PhysicalMedia财产周期介绍。
lpMaximumComponentLength [指出,可选]
一个变量,它接收的最大长度,在TCHARs文件名组件指定的文件系统支持,指针。
一个文件名部分是一个反斜杠文件名之间的部分。
即在于,* lpMaximumComponentLength点,用来表示一个指定的文件系统支持长名变量中的值。例如,对于一个FAT文件系统,支持长文件名,存储函数值255,而不是以前的8.3的指标。龙的名字也可以支持系统上使用NTFS文件系统。
lpFileSystemFlags [指出,可选]
一个指针变量,它接收旗与指定的文件系统相关的。
此参数可以是一个或多个以下标志。然而,FS_FILE_COMPRESSION和FS_VOL_IS_COMPRESSED是并行不悖的。
ValueMeaning
FILE_CASE_PRESERVED_NAMES
0x00000002The指定卷支持保存了文件名的大小写的地方时,在磁盘上的名称。
FILE_CASE_SENSITIVE_SEARCH
0x00000001The指定卷支持区分大小写的文件名。
FILE_FILE_COMPRESSION
0x00000010The指定卷支持文件的压缩。
FILE_NAMED_STREAMS
0x00040000The指定卷支持命名流。
FILE_PERSISTENT_ACLS
0x00000008The指定卷保留和执行访问控制列表(ACL)。例如,NTFS文件系统保留并执行ACL和FAT文件系统不。
FILE_READ_ONLY_VOLUME
0x00080000The指定的卷是只读的。
Windows 2000中:此值不支持。
FILE_SEQUENTIAL_WRITE_ONCE
0x00100000The指定卷支持单一顺序写。
Windows 2000中:此值不支持。
FILE_SUPPORTS_ENCRYPTION
0x00020000The指定卷支持加密文件系统(EFS)。有关更多信息,请参阅文件加密。
FILE_SUPPORTS_EXTENDED_ATTRIBUTES
0x00800000The指定卷支持扩展属性。扩展属性是一块的应用特定元数据的应用程序可以与一个文件关联,而不是文件的数据部分。
Windows Server 2008中,Windows Vista中的Windows Server 2003,和Windows XP/2000:此值不支持,直到Windows服务器2008 R2和Windows 7。
FILE_SUPPORTS_HARD_LINKS
0x00400000The指定卷支持硬链接。有关更多信息,请参阅硬链接和路口。
Windows Server 2008中,Windows Vista中的Windows Server 2003,和Windows XP/2000:此值不支持,直到Windows服务器2008 R2和Windows 7。
FILE_SUPPORTS_OBJECT_IDS
0x00010000The指定卷支持对象标识符。
FILE_SUPPORTS_OPEN_BY_FILE_ID
0x01000000The文件系统支持FileID开放。有关更多信息,请参阅FILE_ID_BOTH_DIR_INFO。
Windows Server 2008中,Windows Vista中的Windows Server 2003,和Windows XP/2000:此值不支持,直到Windows服务器2008 R2和Windows 7。
FILE_SUPPORTS_REPARSE_POINTS
0x00000080The指定卷支持重新分析点。
FILE_SUPPORTS_SPARSE_FILES
0x00000040The指定卷支持稀疏文件。
FILE_SUPPORTS_TRANSACTIONS
0x00200000The指定卷支持事务。有关更多信息,请参阅关于天马。
Windows 2000中:此值不支持。
FILE_SUPPORTS_USN_JOURNAL
0x02000000The指定卷支持的更新序列号(USN)期刊。有关更多信息,请参阅更改日志记录。
Windows Server 2008中,Windows Vista中的Windows Server 2003,和Windows XP/2000:此值不支持,直到Windows服务器2008 R2和Windows 7。
FILE_UNICODE_ON_DISK
0x00000004The指定卷支持Unicode文件名称,因为它们在磁盘上出现。
FILE_VOLUME_IS_COMPRESSED
0x00008000The指定的卷是一个压缩体积,例如,DoubleSpace卷。
FILE_VOLUME_QUOTAS
0x00000020The指定卷支持的磁盘配额。
lpFileSystemNameBuffer [out]
阿一个缓冲区,它接收的文件系统的名称的指针,例如,FAT文件系统或NTFS文件系统。最大缓冲区大小MAX_PATH 1。
nFileSystemNameSize [in]
该文件系统的名称缓冲区长度,在TCHARs。最大缓冲区大小MAX_PATH 1。
此参数被忽略如果文件系统的名称缓冲区没有提供。
返回值
如果所有要求的资料检索,则返回值为非零。
如果不是所有的请求的信息检索,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
当用户试图获取有关软盘驱动器没有软盘或CD - ROM驱动器没有光盘的信息,系统会显示一个消息框,用户插入软盘或光盘光盘分别。为了防止显示此消息框,系统调用SEM_FAILCRITICALERRORS的SetErrorMode功能。
该FS_VOL_IS_COMPRESSED标志是唯一的指标数量的压缩。文件系统的名称不会改变表明压缩,例如,这个标志是返回1 DoubleSpace卷集。当压缩量为基础的,整个卷压缩或不压缩。
在FS_FILE_COMPRESSION标志表示文件系统是否支持文件的压缩。当压缩是基于文件,单个文件可以被压缩或不压缩。
在FS_FILE_COMPRESSION和FS_VOL_IS_COMPRESSED标志是互相排斥的。这两个位不能返回。
组件的最大长度值是在lpMaximumComponentLength存储的唯一指标,卷支持更长比正常FAT文件系统(或其他文件系统)文件名。文件系统的名称不会改变显示长文件名支持。
该GetCompressedFileSize函数获取文件的压缩后的大小。该GetFileAttributes函数可以判断一个人是否是压缩文件。
符号链接行为
如果路径指向一个符号链接,该函数返回的目标卷的信息。
交易业务
如果卷支持文件系统进行交易,该函数返回FILE_SUPPORTS_TRANSACTIONS在lpFileSystemFlags。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetVolumeInformationW(Unicode)和GetVolumeInformationA(ANSI)的
参见
关于天马
文件加密
GetCompressedFileSize
GetFileAttributes
GetVolumeInformationByHandleW
SetErrorMode
SetVolumeLabel
卷管理功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==GetVolumeInformation Function
Retrieves information about the file system and volume associated with the specified root directory.
To specify a handle when retrieving this information, use the GetVolumeInformationByHandleW function.
To retrieve the current compression state of a file or directory, use FSCTL_GET_COMPRESSION .
Syntax
C++
BOOL WINAPI GetVolumeInformation(
__in_opt LPCTSTR lpRootPathName,
__out LPTSTR lpVolumeNameBuffer,
__in DWORD nVolumeNameSize,
__out_opt LPDWORD lpVolumeSerialNumber,
__out_opt LPDWORD lpMaximumComponentLength,
__out_opt LPDWORD lpFileSystemFlags,
__out LPTSTR lpFileSystemNameBuffer,
__in DWORD nFileSystemNameSize
);
Parameters
lpRootPathName [in, optional]
A pointer to a string that contains the root directory of the volume to be described.
If this parameter is NULL, the root of the current directory is used. A trailing backslash is required. For example, you specify \\\\MyServer\\MyShare as "\\\\MyServer\\MyShare\\", or the C drive as "C:\\".
lpVolumeNameBuffer [out]
A pointer to a buffer that receives the name of a specified volume. The maximum buffer size is MAX_PATH+1.
nVolumeNameSize [in]
The length of a volume name buffer, in TCHARs. The maximum buffer size is MAX_PATH+1.
This parameter is ignored if the volume name buffer is not supplied.
lpVolumeSerialNumber [out, optional]
A pointer to a variable that receives the volume serial number.
This parameter can be NULL if the serial number is not required.
This function returns the volume serial number that the operating system assigns when a hard disk is formatted. To programmatically obtain the hard disk's serial number that the manufacturer assigns, use the Windows Management Instrumentation (WMI) Win32_PhysicalMedia property SerialNumber.
lpMaximumComponentLength [out, optional]
A pointer to a variable that receives the maximum length, in TCHARs, of a file name component that a specified file system supports.
A file name component is the portion of a file name between backslashes.
The value that is stored in the variable that *lpMaximumComponentLength points to is used to indicate that a specified file system supports long names. For example, for a FAT file system that supports long names, the function stores the value 255, rather than the previous 8.3 indicator. Long names can also be supported on systems that use the NTFS file system.
lpFileSystemFlags [out, optional]
A pointer to a variable that receives flags associated with the specified file system.
This parameter can be one or more of the following flags. However, FS_FILE_COMPRESSION and FS_VOL_IS_COMPRESSED are mutually exclusive.
ValueMeaning
FILE_CASE_PRESERVED_NAMES
0x00000002The specified volume supports preserved case of file names when it places a name on disk.
FILE_CASE_SENSITIVE_SEARCH
0x00000001The specified volume supports case-sensitive file names.
FILE_FILE_COMPRESSION
0x00000010The specified volume supports file-based compression.
FILE_NAMED_STREAMS
0x00040000The specified volume supports named streams.
FILE_PERSISTENT_ACLS
0x00000008The specified volume preserves and enforces access control lists (ACL). For example, the NTFS file system preserves and enforces ACLs, and the FAT file system does not.
FILE_READ_ONLY_VOLUME
0x00080000The specified volume is read-only.
Windows 2000: This value is not supported.
FILE_SEQUENTIAL_WRITE_ONCE
0x00100000The specified volume supports a single sequential write.
Windows 2000: This value is not supported.
FILE_SUPPORTS_ENCRYPTION
0x00020000The specified volume supports the Encrypted File System (EFS). For more information, see File Encryption .
FILE_SUPPORTS_EXTENDED_ATTRIBUTES
0x00800000The specified volume supports extended attributes. An extended attribute is a piece of application-specific metadata that an application can associate with a file and is not part of the file's data.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported until Windows Server 2008 R2 and Windows 7.
FILE_SUPPORTS_HARD_LINKS
0x00400000The specified volume supports hard links. For more information, see Hard Links and Junctions .
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported until Windows Server 2008 R2 and Windows 7.
FILE_SUPPORTS_OBJECT_IDS
0x00010000The specified volume supports object identifiers.
FILE_SUPPORTS_OPEN_BY_FILE_ID
0x01000000The file system supports open by FileID. For more information, see FILE_ID_BOTH_DIR_INFO .
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported until Windows Server 2008 R2 and Windows 7.
FILE_SUPPORTS_REPARSE_POINTS
0x00000080The specified volume supports re-parse points.
FILE_SUPPORTS_SPARSE_FILES
0x00000040The specified volume supports sparse files.
FILE_SUPPORTS_TRANSACTIONS
0x00200000The specified volume supports transactions. For more information, see About KTM .
Windows 2000: This value is not supported.
FILE_SUPPORTS_USN_JOURNAL
0x02000000The specified volume supports update sequence number (USN) journals. For more information, see Change Journal Records .
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000: This value is not supported until Windows Server 2008 R2 and Windows 7.
FILE_UNICODE_ON_DISK
0x00000004The specified volume supports Unicode in file names as they appear on disk.
FILE_VOLUME_IS_COMPRESSED
0x00008000The specified volume is a compressed volume, for example, a DoubleSpace volume.
FILE_VOLUME_QUOTAS
0x00000020The specified volume supports disk quotas.

lpFileSystemNameBuffer [out]
A pointer to a buffer that receives the name of the file system, for example, the FAT file system or the NTFS file system. The maximum buffer size is MAX_PATH+1.
nFileSystemNameSize [in]
The length of the file system name buffer, in TCHARs. The maximum buffer size is MAX_PATH+1.
This parameter is ignored if the file system name buffer is not supplied.
Return Value
If all the requested information is retrieved, the return value is nonzero.
If not all the requested information is retrieved, the return value is zero. To get extended error information, call GetLastError .
Remarks
When a user attempts to get information about a floppy drive that does not have a floppy disk, or a CD-ROM drive that does not have a compact disc, the system displays a message box for the user to insert a floppy disk or a compact disc, respectively. To prevent the system from displaying this message box, call the SetErrorMode function with SEM_FAILCRITICALERRORS.
The FS_VOL_IS_COMPRESSED flag is the only indicator of volume-based compression. The file system name is not altered to indicate compression, for example, this flag is returned set on a DoubleSpace volume. When compression is volume-based, an entire volume is compressed or not compressed.
The FS_FILE_COMPRESSION flag indicates whether a file system supports file-based compression. When compression is file-based, individual files can be compressed or not compressed.
The FS_FILE_COMPRESSION and FS_VOL_IS_COMPRESSED flags are mutually exclusive. Both bits cannot be returned set.
The maximum component length value that is stored in lpMaximumComponentLength is the only indicator that a volume supports longer-than-normal FAT file system (or other file system) file names. The file system name is not altered to indicate support for long file names.
The GetCompressedFileSize function obtains the compressed size of a file. The GetFileAttributes function can determine whether an individual file is compressed.
Symbolic link behavior—
If the path points to a symbolic link, the function returns volume information for the target.
Transacted Operations
If the volume supports file system transactions, the function returns FILE_SUPPORTS_TRANSACTIONS in lpFileSystemFlags.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetVolumeInformationW (Unicode) and GetVolumeInformationA (ANSI)
See Also
About KTM
File Encryption
GetCompressedFileSize
GetFileAttributes
GetVolumeInformationByHandleW
SetErrorMode
SetVolumeLabel
Volume Management Functions
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364993(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 13:16:31