Re: ctypes free memory which is allocated in C DLL

2012-10-27 Thread zlchen . ken
On Sunday, October 28, 2012 6:26:28 AM UTC+8, Nobody wrote: > On Sat, 27 Oct 2012 07:42:01 -0700, zlchen.ken wrote: > > > > > I have a DLL which written in C language, one of the function is to > > > allocate a structure, fill the members and then return the pointer of > > > the structure. >

ctypes free memory which is allocated in C DLL

2012-10-27 Thread zlchen . ken
Hi Guys, I have a DLL which written in C language, one of the function is to allocate a structure, fill the members and then return the pointer of the structure. After Python called this function, and done with the returned structure, I would like to free the returned structure. How can I achie

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

2012-10-27 Thread zlchen . ken
On Thursday, November 18, 2010 8:03:57 PM UTC+8, Grigory Petrov wrote: > 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 < *