大网数据广告活动
磁盘与文件系统

Enumerating Mounted Folders

· 52CE 我爱测

Functions to use to enumerate mounted folders on a volume.

The following functions are used to enumerate the mounted folders on a specified NTFS volume:

These functions operate in a manner very similar to the FindFirstFile, FindNextFile, and FindClose functions.

To enumerate mounted folders on a volume, first find out if the volume supports mounted folders. To do so, use the volume name returned by the FindFirstVolume and FindNextVolume functions to call the GetVolumeInformation function. The names returned include a trailing backslash (\) to be compatible with the GetDriveType function and related functions. For more information on the functions used to scan the volumes on a computer, see Enumerating Volumes. When you call the GetVolumeInformation function, if "NTFS" is returned in the lpFileSystemNameBuffer parameter, the volume is an NTFS volume. The NTFS file system supports mounted folders.

If the volume is an NTFS volume, begin a search for the mounted folders by calling FindFirstVolumeMountPoint. If the search is successful, process the results according to your application's requirements. Then use FindNextVolumeMountPoint in a loop to locate and process the mounted folders one at a time. When there are no more mounted folders to be enumerated, close the search handle by calling FindVolumeMountPointClose. Note that the search will find only the mounted folders that are on the specified volume.

You should not assume any correlation between the order of the mounted folders that are returned by these functions and the order of the mounted folders that are returned by other functions or tools.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。