JNA for Windows API function GetVolumePathNamesForVolumeName

后端 未结 3 1646
庸人自扰
庸人自扰 2021-01-19 13:54

I\'ve successfully used JNA to call a couple of Windows API functions but I get stuck at this one

GetVolumePathNamesForVolumeName

The full C declaration is:<

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-19 14:35

    Using my version:

    Change the return value of getPathNames() method, from:

    return Arrays.toString(pathNames);
    

    to

    return new String(pathNames);
    

    In my test application, you can just:

    String[] points = getPathNames().split("\u0000"); //split by Unicode NULL
    
    for(String s: points) System.out.println("mount: " + s);
    

    Edited: this post will be updated into my previous post

提交回复
热议问题