itsky2 发表于 2020-4-13 07:38:54

求助 FindFirstVolumeMountPoint 的写法

本帖最后由 itsky2 于 2020-4-13 09:13 编辑

下面是我自己尝试的,无效...
Local $tTag = DllStructCreate("char buffer")
$aRet = DllCall("Kernel32.dll", "int", "FindFirstVolumeMountPoint", "str", $sGUID, "str", $tTag, 'int', DllStructGetSize($tTag))

sGUID这个是设备标识符,用下面的代码可以取到:
$RET = DllCall("Kernel32.dll", "int", "FindFirstVolume", "str", "", "str", 255)
ConsoleWrite($RET & @TAB & DriveGetLabel($RET) & @TAB & DirGetSize($RET) & @CRLF)
$RET = $RET
While 1
      $RET = DllCall("Kernel32.dll", "int", "FindNextVolume", "int", $RET, "str", "", "str", 255)
      If Not $RET Then ExitLoop
      ConsoleWrite($RET & @TAB & DriveGetLabel($RET) & @CRLF)
WEnd

itsky2 发表于 2020-4-13 08:46:25

https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-findfirstvolumemountpointw
补充个文档,顺便如果各位大佬有空的话,再帮忙写个Next的...谢谢

itsky2 发表于 2020-4-15 08:31:24

GetVolumePathNamesForVolumeName解决了,谢谢大家!
页: [1]
查看完整版本: 求助 FindFirstVolumeMountPoint 的写法