Undoc. comctl32 mem management functions

Michael Stefaniuc mstefani at redhat.com
Wed Feb 7 05:27:10 CST 2007


Felix Nawothnig wrote:
> Hi. comctl32 exports (undocumented) Alloc() and friends which call
> LocalAlloc => GlobalAlloc => HeapAlloc since it's doesn't use any fancy
> LMEM / GMEM flags... so shouldn't Alloc() call HeapAlloc() directly?
> 
> If Global/Local* behave different than Heap* on Windows - wouldn't it
> then be desirable to replace the Alloc()/etc. calls in our comctl32 (we
> use it all over the place) by Heap*?
> 
> Reason I'm asking: Since it's not documented the Free(NULL) semantics
> are not clear (although it's safe in our implementation) - and I'm
> wondering if we really want to internally use undocumented functions
> with unclear semantics when there is an easy (documented) way.
> 
> And besides - the comctl32 code is full of "if(p) Free(p);"...
Looks like i need to add Free() to my redundant_null_check.pl Smatch script.

bye
	michael
-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart



More information about the wine-devel mailing list