当我尝试从内核库调用任何函数时,在 python 3.4.3 和 2.7.9 中。
在 64 位 Windows 上从 32 位版本的 python 打印错误消息:
from ctypes import *
path=create_string_buffer(256)
rs=cdll.Kernel32.GetModuleFileNameA(0,path,256)
print (path)
错误如下:
Traceback (most recent call last):
File "test-ctypes.py", line 3, in <module>
ValueError: Procedure called with not enough arguments (12 bytes missing) or wrong calling convention