dlls/opengl32/wgl.c: minor dealloc fix

Nick Burns adger44 at hotmail.com
Mon Jan 1 19:40:25 CST 2007


Got ya, -- looking at the heapfree impl -- it does the check first (so it is 
defined in Wine)

-- So please ignore this patch then --

However, this seems dangerous if you wanted to take any of that code and run 
it under windows (but im guessing xp and 2k work this way -- and few people 
use 95/98/me anymore)

Where is a good place for api docs other than the MSDN? (and no source does 
not count as good api docs)

It seems like Microsoft should be notified of incorrect/incomplete api docs 
-- so they can correct them
(but sadly this is a huge thankless task...)

- Nick

>From: Vitaliy Margolen <wine-devel at kievinfo.com>
>To: Nick Burns <adger44 at hotmail.com>
>CC: wine-devel at winehq.org
>Subject: Re: dlls/opengl32/wgl.c: minor dealloc fix
>Date: Mon, 01 Jan 2007 18:00:44 -0700
>
>DO NOT top post bottom posted emails!!!
>Nick Burns wrote:
> >> From: Stefan Dösinger <stefandoesinger at gmx.at>
> >> To: wine-devel at winehq.org
> >> CC: Nick Burns <adger44 at hotmail.com>
> >> Subject: Re: dlls/opengl32/wgl.c: minor dealloc fix
> >> Date: Mon, 1 Jan 2007 22:33:49 +0100
> >>
> >>
> >> Am 01.01.2007 um 11:03 schrieb Nick Burns:
> >>
> >>> There can be a problem where the detach is hit before
> >>> internal_gl_extensions is allocated and it tries to free NULL and
> >>> dies...
> >>>
> >>> This just checks for the allocation before freeing -- very minor
> >>>
> >>> - Nick
> >> HeapFree(GetProcessHeap(), 0, NULL) is supposed to be a nop, so the
> >> check is not needed.
> > According to...
> >    http://msdn2.microsoft.com/en-us/library/aa366701.aspx
> >
> > lpMem
> >   [in] ...If this pointer is NULL, the behavior is undefined.
>
>That's incorrect. 90% of MSDN is not correct or incomplete. The behavior
>is well known and defined (at least in Wine) - NULL pointers are ignored.
>
>So your patch is not correct.
>
>Vitaliy.
>
>





More information about the wine-devel mailing list