请教python 调用DLL函数的问题。DLL中函数声明如下:
BOOL WINAPI EnumWdDevPath(UCHAR * nDevNum,char DevPath[32][128]),这是个枚举设备的函数,在Python中,我调用的时候应该如何取出返回的参数值呢?
from ctypes import *
def create_char_table(n, m):
ret = (c_char_p * n)()
for i in range(n):
ret[i] = addressof((c_char * m)())
return ret
#加载API库
dll = windll.LoadLibrary( 'wdkmgr.dll' )
DevNum=c_ubyte(0)
DevPath = create_char_table(32,128)
a= pointer(DevNum)
b= byref(DevPath)
nRst = dll.EnumWdDevPath(a,b)//如何把b的值打印出来???