extracting null pointer address from PyCObject with ctypes
Gordon Allott
gordallott at gmail.com
Fri Oct 10 17:16:01 EDT 2008
Aaron "Castironpi" Brady wrote:
> I see. If I understand, you have a PyCObject in a dictionary.
>
> Look at the 'ctypes' module and try calling PyCObject_AsVoidPtr. Its
> return type should be 'c_void_p', and you can use 'result.value' to
> get the original pointer.
> --
> http://mail.python.org/mailman/listinfo/python-list
I have a hard time following that, if using ctypes you used PyDLL to
call PyCObject_AsVoidPtr on the PyCObject I already have surely it would
give me back a pointer (void for sake of simplicity) but it would be a
pointer to a new PyCObject and thus calling result.value on it would
only return the memory address of the new PyCObject?
--
Gord Allott (gordallott at gmail.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20081010/71b25c15/attachment-0001.sig>
More information about the Python-list
mailing list