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