I have a C function in a DLL which is calling back to a Python function via ctypes.
The C function calls the function with the following prototype:
void GetData(u8 Buffer[], u16 Length);
Note that the buffer points to a static data array which is held in the DLL.
I've generated a Python function type for this as the following:
CFUNCTYPE(None, c_char_p, c_int)
And my Python callback function is being called without any obvious problems.
My problem is, I can't work out how to get ctypes to add raw data to a buffer which is external to Python. Is there a way to define a ctypes string buffer and give it the address of the DLL's buffer?