Python & Ctypes: Passing a struct to a function as a pointer to get back data

前端 未结 3 466
萌比男神i
萌比男神i 2020-11-28 04:16

I\'ve looked through other answers but can\'t seem to get this to work. I\'m trying to call a function within a DLL for communicating with SMBus devices. This function takes

3条回答
  •  情歌与酒
    2020-11-28 04:56

    Try changing

    ("Data", type(create_string_buffer(SMB_MAX_DATA_SIZE))
    

    to

    ("Data", (c_char * SMB_MAX_DATA_SIZE)]
    

提交回复
热议问题