Re: comctl32: realloc or free and alloc

2011-05-01 Thread Alexey Fisher
On So, 2011-05-01 at 21:55 +0400, Nikolay Sivov wrote: > On 5/1/2011 21:49, Alexey Fisher wrote: > > On So, 2011-05-01 at 19:11 +0400, Nikolay Sivov wrote: > >> On 5/1/2011 13:07, Alexey Fisher wrote: > >>> There is a new patch in the attachment. > >>>BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCST

Re: comctl32: realloc or free and alloc

2011-05-01 Thread Nikolay Sivov
On 5/1/2011 21:49, Alexey Fisher wrote: On So, 2011-05-01 at 19:11 +0400, Nikolay Sivov wrote: On 5/1/2011 13:07, Alexey Fisher wrote: There is a new patch in the attachment. BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) { -TRACE("(%p %s)\n", lppDest, lpSrc); +TRACE("(%p, %s

Re: comctl32: realloc or free and alloc

2011-05-01 Thread Alexey Fisher
On So, 2011-05-01 at 19:11 +0400, Nikolay Sivov wrote: > On 5/1/2011 13:07, Alexey Fisher wrote: > > > > There is a new patch in the attachment. > > > BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) > > { > > -TRACE("(%p %s)\n", lppDest, lpSrc); > > +TRACE("(%p, %s)\n", *lppDest, d

Re: comctl32: realloc or free and alloc

2011-05-01 Thread Vitaliy Margolen
On 05/01/2011 10:29 AM, Alexey Fisher wrote: Correct me if I'm wrong. You can't ReAlloc pointer only if you allocated the memory by Alloc. At least for glibc. First of all we talking about Wine's functions HeapAlloc, HeapReAlloc, and HeapFree. The HeapReAlloc can and does re-allocate memory

Re: comctl32: realloc or free and alloc

2011-05-01 Thread Alexey Fisher
On So, 2011-05-01 at 08:05 -0700, Dan Kegel wrote: > On Sun, May 1, 2011 at 2:07 AM, Alexey Fisher > wrote: > >> > The code looks like it assumes that pointer is always > >> > managed by Alloc/ReAlloc/Free. In what context is > >> > the destination a fresh, non-Alloc'd pointer? > >> > Perhaps tha

Re: comctl32: realloc or free and alloc

2011-05-01 Thread Nikolay Sivov
On 5/1/2011 13:07, Alexey Fisher wrote: There is a new patch in the attachment. BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) { -TRACE("(%p %s)\n", lppDest, lpSrc); +TRACE("(%p, %s)\n", *lppDest, debugstr_a(lpSrc)); + +if (*lppDest) { +ERR("lppDest should be NULL

Re: comctl32: realloc or free and alloc

2011-05-01 Thread Dan Kegel
On Sun, May 1, 2011 at 2:07 AM, Alexey Fisher wrote: >> > The code looks like it assumes that pointer is always >> > managed by Alloc/ReAlloc/Free.  In what context is >> > the destination a fresh, non-Alloc'd pointer? >> > Perhaps that's where the bug lies. >> >> We do not need to save anything w

re: comctl32: realloc or free and alloc

2011-05-01 Thread Alexey Fisher
On So, 2011-05-01 at 07:43 +0200, Alexey Fisher wrote: > Am Samstag, den 30.04.2011, 14:41 + schrieb Dan Kegel: > > Alexey wrote: > > > > > i currently digg in comctl32 to find why my app fails. I found that > > > string conversation AtoW in some places silently fails. The problem is > > > tha

re: comctl32: realloc or free and alloc

2011-04-30 Thread Alexey Fisher
Am Samstag, den 30.04.2011, 14:41 + schrieb Dan Kegel: > Alexey wrote: > > > i currently digg in comctl32 to find why my app fails. I found that > > string conversation AtoW in some places silently fails. The problem is > > that the destination for string is just a fresh pointer (not NULL). >

re: comctl32: realloc or free and alloc

2011-04-30 Thread Dan Kegel
Alexey wrote: > i currently digg in comctl32 to find why my app fails. I found that > string conversation AtoW in some places silently fails. The problem is > that the destination for string is just a fresh pointer (not NULL). > Str_SetPtrAtoW check if it is NULL pointer and if not it trys to > Re

comctl32: realloc or free and alloc

2011-04-29 Thread Alexey Fisher
Hallo, i currently digg in comctl32 to find why my app fails. I found that string conversation AtoW in some places silently fails. The problem is that the destination for string is just a fresh pointer (not NULL). Str_SetPtrAtoW check if it is NULL pointer and if not it trys to ReAlloc. There was