我有一个包含此功能的DLL文件
signed int __stdcall EncodeInit(unsigned int a1, int a2, int a3, int a4)
{
signed int result; // eax@1
result = 55;
*(_DWORD *)a2 = (signed __int64)((double)a1 / 1.37 - 25.0 - 23.0 - 2.0 - 6.0);
return result;
}
我试图从Python调用这个函数:
import ctypes
from ctypes import cdll
# Load DLL into memory.
hllDll = cdll.LoadLibrary("E:\\sap mobile\\Bin32\\dbencod11.dll")
a1 = ctypes.c_int32(1)
print hllDll.EncodeInit(11, a1, 31, 4)
但是我收到了一个错误:
WindowsError: exception: access violation writing 0x00000001
因为a1
是不变的。我该如何解决这个问题?