main
main copied to clipboard
ctypes.addressof incorrect for funcptr objects
import ctypes
msvcrt = ctypes.cdll.LoadLibrary("msvcrt")
systemfn = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system))
systemfn.value = ctypes.c_int.from_address
from_address should return the address of where we store the function pointer address, not the function pointer address.
Work Item Details
Original CodePlex Issue: Issue 26185 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Feb 11, 2010 at 6:39 PM Reported by: dinov Updated on: Feb 22, 2013 at 2:10 AM Updated by: jdhardy Thanks: Lepisto, Stephen P
On 2010-12-23 06:51:20 UTC, rjnienaber commented:
Still an issue in IronPython 2.7 Beta 1 (2.7.0.10) on .NET 4.0.30319.1.