[issue20160] broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

mattip report at bugs.python.org
Wed May 14 10:30:14 CEST 2014


mattip added the comment:

Here is a fix for arguments and return values, based on the support in cffi, for python2.7
I added a test in test_win32, removed the too-early attempt to fix in callproc.c, and merged in most of the changes in lib_msvc from cffi's code base.

These changes handle the following (in addition to callproc change):
- fix rtype handling by converting a return-by-value struct to a pointer-sized int
- fix stack byte-size calculation by checking for large pass-by-value structs, incrementing bytes by sizeof(void*) in this case
- fix avalue copying by checking for large pass-by-value structs and copying the pointer not the value
- fix bogus check for stack buffer < 40 bytes

A similar patch for 3.4 will be posted soon.

Other related issues: http://bugs.python.org/issue11835

----------
keywords: +patch
nosy: +mattip
Added file: http://bugs.python.org/file35248/issue_20160_python2_7.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20160>
_______________________________________


More information about the Python-bugs-list mailing list