main icon indicating copy to clipboard operation
main copied to clipboard

ctypes.addressof incorrect for funcptr objects

Open ironpythonbot opened this issue 11 years ago • 1 comments

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

ironpythonbot avatar Dec 09 '14 17:12 ironpythonbot

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.

ironpythonbot avatar Dec 09 '14 17:12 ironpythonbot