How to correctly pass “pointer-to-pointer” into DLL via ctypes?

2010-11-18 Thread Grigory Petrov
Hello. I have a DLL that allocates memory and returns it. Function in DLL is like this: void Foo( unsigned char** ppMem, int* pSize ) {   * pSize = 4;   * ppMem = malloc( * pSize );   for( int i = 0; i < * pSize; i ++ ) (* pMem)[ i ] = i; } Also, i have a python code that access this function fr

Re: How to correctly pass “pointer-to-pointer” i nto DLL via ctypes?

2010-11-19 Thread Grigory Petrov
Thank you a lot! I have stripped down my production code to the sample - and it worked. Bug was in another part of my code where free() was called for the memory in question. On Fri, Nov 19, 2010 at 3:39 PM, Diez B. Roggisch wrote: > Grigory Petrov writes: > >> Hello. >> &g