GetLogicalDriveStrings NT/SetupAPI替代
问题描述:
我必须得到一个逻辑驱动器的列表。我知道我可以使用GetLogicalDriveStrings,但我想知道是否有我可以使用的NT API替代方案?甚至是SetupAPI?GetLogicalDriveStrings NT/SetupAPI替代
答
如果您想要正确处理未指定字母的逻辑驱动器,请使用FindFirstVolume
/FindNextVolume
和GetVolumePathNamesForVolumeNameW
。
MSDN中有一个名为Displaying Volume Paths
如果试图从内核模式下访问此信息,请尝试挂载点管理器(\Device\MountPointManager
)样品。