Using Python Ctypes to pass struct pointer to a DLL function

后端 未结 2 830
慢半拍i
慢半拍i 2020-12-19 18:10

I am attempting to access a function in a DLL file using Python ctypes. The provided function description is below.



        
2条回答
  •  遥遥无期
    2020-12-19 18:30

    Likely, you're not entering the exact structure fields in the exact same order. If you don't, then you usually get random data or segfaults. To access a library with ctypes, you usually need to look inside the header (.h file) to copy the exact structure definition. Alternatively, use cffi with ffi.verify() if you don't want to depend on the precise layout.

提交回复
热议问题