eryksun added the comment:
c_void_p's getfunc returns the address as an integer. In turn, an integer
argument gets converted to a C int. This mean you need to a create a new
c_void_p from the address for _as_parameter_, e.g.
self._as_parameter_ = c_void_p(self.g)
Or set restype to a subclass of c_void_p. ctypes won't call the getfunc in this
case, e.g.
class my_void_p(c_void_p):
pass
mylib.my_gizmo_create.restype = my_void_p
ConvParam
https://hg.python.org/cpython/file/ee879c0ffa11/Modules/_ctypes/callproc.c#l613
GetResult
https://hg.python.org/cpython/file/ee879c0ffa11/Modules/_ctypes/callproc.c#l903
----------
nosy: +eryksun
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue22945>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com