Author: jimtabor Date: Thu Dec 25 17:44:23 2008 New Revision: 38348
URL: http://svn.reactos.org/svn/reactos?rev=38348&view=rev Log: - Example of a thread overrun? HAX-Fixes wine cursoricon test.
Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c
Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/bi... ============================================================================== --- trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] Thu Dec 25 17:44:23 2008 @@ -412,6 +412,7 @@ ULONG HeaderSize; ULONG ColorCount; PVOID Data; + BOOL Hit = FALSE;
if (!(fuLoad & LR_LOADFROMFILE)) { @@ -470,8 +471,26 @@ UnmapViewOfFile(BitmapInfo); return NULL; } + + _SEH2_TRY + { memcpy(PrivateInfo, BitmapInfo, HeaderSize); - + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Hit = TRUE; + } + _SEH2_END; + + if (Hit) + { + DbgPrint("We have a thread overrun, these are already freed! pi -> %d bi -> %d\n", PrivateInfo, BitmapInfo); + RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo); + if (fuLoad & LR_LOADFROMFILE) + UnmapViewOfFile(BitmapInfo); + return NULL; + } + /* FIXME: Handle color conversion and transparency. */
hScreenDc = CreateCompatibleDC(NULL);