如何访问通过ctypes定义的C结构体数组中的成员???
我定义了以下的C结构体
from ctypes import *
class IMAGE_IMPORT_DESCRIPTOR(Structure):
_fields_ = [
("OriginalFirstThunk", c_ulong),
("TimeDateStamp", c_ulong),
("ForwarderChain", c_ulong),
("Name", c_ulong),
("FirstThunk", c_ulong)
]
然后使用该结构体数组
iid = IMAGE_IMPORT_DESCRIPTOR * 3
我希望访问结构体数组成员,像下面这样:
iid[iid_idx].OriginalFirstThunk = 0xxxxxxxxx
但是python报错误如下:
TypeError: '_ctypes.ArrayType' object is unindexable.
请问我该如何访问该结构体数组中的成员???
谢谢!!!!