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.
I personally dislike undefined behaviour -- If it is defined to NOP in wine that is sufficent for me.
But I think/tought I had a crash there tho...
- Nick
From: Stefan Dösinger stefandoesinger@gmx.at To: wine-devel@winehq.org CC: Nick Burns adger44@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.
Am 02.01.2007 um 00:54 schrieb Nick Burns:
According to... http://msdn2.microsoft.com/en-us/library/aa366701.aspx
lpMem [in] ...If this pointer is NULL, the behavior is undefined.
I personally dislike undefined behaviour -- If it is defined to NOP in wine that is sufficent for me.
But I think/tought I had a crash there tho...
I think we have a test case for that, as well as a test case for allocation of 0 bytes. Not sure about the details though, but there was a series of patches before to remove such checks.
- Nick
From: Stefan Dösinger stefandoesinger@gmx.at To: wine-devel@winehq.org CC: Nick Burns adger44@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.
DO NOT top post bottom posted emails!!! Nick Burns wrote:
From: Stefan Dösinger stefandoesinger@gmx.at To: wine-devel@winehq.org CC: Nick Burns adger44@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.
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@kievinfo.com To: Nick Burns adger44@hotmail.com CC: wine-devel@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@gmx.at To: wine-devel@winehq.org CC: Nick Burns adger44@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.
On Tuesday 02 January 2007 02:40, Nick Burns wrote:
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)
There are win98 tests run on test.winehq.org. You can check there if the HeapFree() works there.
Where is a good place for api docs other than the MSDN? (and no source does not count as good api docs)
I'm afraid the Wine source is the most complete win32 api doc apart from MSDN.
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...)
I sort of doubt they'll fix it for us. They didn't fix it for the EU.
Cheers, Kai