Santoso Wijaya <santoso.wij...@gmail.com> added the comment: I can reproduce this with 2.7 and 3.2 64-bit builds on Windows:
D:\Temp\cdll\x64\Release>C:\Python32\python.exe Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> libcdll = CDLL('cdll') >>> libcdll.foo(1, 2, 3, 4, 5, 6, 7) a: 1; b: 2; c: 3; d: 4; e: 5; f: 6; g: 7 0 >>> class MyStruct(Structure): ... _fields_ = [ ... ('a', c_int32), ... ('b', c_int32), ... ('c', c_int32), ... ('d', c_int32), ... ('e', c_int32), ... ('f', c_int32), ... ('g', c_int32), ... ] ... >>> s1 = MyStruct(1, 2, 3, 4, 5, 6, 7) >>> s2 = MyStruct(0, 9, 8, 7, 6, 5, 4) >>> libcdll.bar(s2) s.a: 0; s.b: 9; s.c: 8; s.d: 7; s.e: 6; s.f: 5; s.g: 4 0 >>> libcdll.errorPassingParameter(s1, s2, 42) s1.a: 1; s1.b: 2; s1.c: 3; s1.d: 4; s1.e: 5; s1.f: 6; s1.g: 7 s2.a: 28; s2.b: 0; s2.c: 851972; s2.d: 0; s2.e: 31545776; s2.f: 0; s2.g: 0 x: 39805032 0 >>> ---------- versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3 -Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11835> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com