[issue11835] python (x64) ctypes incorrectly pass structures parameter

Abraham Soedjito report at bugs.python.org
Tue Apr 12 17:39:26 CEST 2011


New submission from Abraham Soedjito <abraham.soedjito at gmail.com>:

void __cdecl foo(unsigned __int32 a,
                 unsigned __int32 b,
                 unsigned __int32 c,
                 unsigned __int32 d,
                 unsigned __int32 e,
                 unsigned __int32 f,
                 unsigned __int32 g);

struct myStruct
{
   unsigned __int32 a;
   unsigned __int32 b;
   unsigned __int32 c;
   unsigned __int32 d;
   unsigned __int32 e;
   unsigned __int32 f;
   unsigned __int32 g;
}
void __cdecl bar(myStruct s);

void __cdecl errorPassingParameter(myStruct s1,
                                   myStruct s2,
                                   unsigned __int32 x);    

Calling foo and bar from python completed successfully, calling errorParsingParameter resulted in stack corruption. It seems that python passed an extra pointer in the stack for s2.

----------
assignee: theller
components: ctypes
messages: 133583
nosy: Abraham.Soedjito, theller
priority: normal
severity: normal
status: open
title: python (x64) ctypes incorrectly pass structures parameter
type: crash
versions: Python 2.6

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


More information about the Python-bugs-list mailing list