CTypes on a 64-bit machine appears to be truncating pointers to 32 bits: [EMAIL PROTECTED]:~]$ uname -a Linux monster1 2.6.18-6-amd64 #1 SMP Mon Jun 16 22:30:01 UTC 2008 x86_64 GNU/Linux [EMAIL PROTECTED]:~]$ cat foo.c void* foo(void* x) { return x; } [EMAIL PROTECTED]:~]$ gcc -fPIC -shared foo.c -o foo.so [EMAIL PROTECTED]:~]$ file foo.so foo.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped [EMAIL PROTECTED]:~]$ python Python 2.5 (release25-maint, Jul 23 2008, 18:15:29) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> foolib = cdll.LoadLibrary('foo.so') >>> foolib.foo(0xF00000000) 0 >>> sizeof(c_void_p) 8 >>>
I am aware of http://bugs.python.org/issue1703286 but I get the same result in Python2.5.2: [EMAIL PROTECTED]:~]$ py252/bin/python Python 2.5.2 (r252:60911, Sep 18 2008, 10:48:29) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> foolib = cdll.LoadLibrary('foo.so') >>> foolib.foo(0xF00000000) 0 >>> sizeof(c_void_p) 8 >>> -- http://mail.python.org/mailman/listinfo/python-list