I have set the above struct using from_buffer_copy with a value of b'\x01\x0f\x00\xe0' (Binary representation of C struct, with the underneath values).
This should set the following values
f1: 1
f2: 15
f3: -1 (3, overflow makes it -1)
f4: -1 (1, overflow makes it -1)
Manual setting, or from_buffer_copy, achieve nothing; f3, and f4 remain 0.
Could someone help me set f3, and f4 to corresponding values (-1 in this example). Also how would I access these fields in bit form of their corresponding size.
So it seems that we still need to find a way to get bitfields working right. I also don’t assume bug in core python module, so we’re on the same page here.
I will try to search my resources in order to find bitfield related ctypes structures to show, because we deal with vxlapi.dll
Okay, I found something. ctypes-bitfield uses pack attribute and few other things to achieve bitfields with ctypes. Plus, here’s more sophisticated usage of ctypes, for Windows: pyWinAPI. I hope that helps!