How do I set an IronPython ctypes c_char_p pointer to an absolute address manually?
问题 I need to set the address to which a character pointer points to as an absolute value. In many Python implementations (CPyhton 2.x, CPython 3.x, PyPy & ActivePython, ...) this can be done using: >>> c_char_p(0xcafebabe) c_char_p(3405691582) >>> in IronPython: >>> c_char_p(0xcafebabe) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: expected char pointer, got long >>> IronPython does not attempt to set the address of the pointer, but treats the argument as