2

カーネルライブラリから関数を呼び出そうとすると、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
4

1 に答える 1