From 2740865cc06b075078a4ff5197fc21f2833ca4ba Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Mon, 30 Jan 2012 20:29:12 +0000 Subject: [PATCH] [COMCTL32] - Fix the fix for MSVC build (r55306). This is the version accepted by Wine. svn path=/trunk/; revision=55334 --- reactos/dll/win32/comctl32/imagelist.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/comctl32/imagelist.c b/reactos/dll/win32/comctl32/imagelist.c index 61cfbe3aaee..bb4107ba2de 100644 --- a/reactos/dll/win32/comctl32/imagelist.c +++ b/reactos/dll/win32/comctl32/imagelist.c @@ -3094,13 +3094,13 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count) if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR) { - BITMAPINFO *bmi = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, FIELD_OFFSET( BITMAPINFO, bmiColors[256] )); - if (bmi == NULL) - return NULL; + char buffer[sizeof(BITMAPINFO) + (256 - 1) * sizeof(RGBQUAD)]; + BITMAPINFO *bmi = (BITMAPINFO *)buffer; TRACE("Creating DIBSection %d x %d, %d Bits per Pixel\n", sz.cx, sz.cy, himl->uBitsPixel); + memset( buffer, 0, sizeof(buffer) ); bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi->bmiHeader.biWidth = sz.cx; bmi->bmiHeader.biHeight = sz.cy; @@ -3116,7 +3116,6 @@ static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count) DeleteObject( tmp ); } hbmNewBitmap = CreateDIBSection(hdc, bmi, DIB_RGB_COLORS, NULL, 0, 0); - HeapFree( GetProcessHeap(), 0, bmi ); } else /*if (ilc == ILC_COLORDDB)*/ {