diff --git "a/win32ss/user/user32/windows/cursoricon.c" "b/win32ss/user/user32/windows/cursoricon.c" index 1f6b71714aa..331422d9059 100644 --- "a/win32ss/user/user32/windows/cursoricon.c" +++ "b/win32ss/user/user32/windows/cursoricon.c" @@ -1085,7 +1085,7 @@ BITMAP_LoadImageW( HBITMAP hbmpOld, hbmpRet = NULL; LONG width, height; WORD bpp; - DWORD compr; + DWORD compr, HdrSize = 0, ResSize = 0; /* Map the bitmap info */ if(fuLoad & LR_LOADFROMFILE) @@ -1123,6 +1123,7 @@ BITMAP_LoadImageW( pbmi = LockResource(hgRsrc); if(!pbmi) return NULL; + ResSize = SizeofResource(hinst, hrsrc); } /* Fix up values */ @@ -1148,6 +1149,16 @@ BITMAP_LoadImageW( goto end; CopyMemory(pbmiCopy, pbmi, iBMISize); + /* Test if MSVC Resource Compiler used and if so, adjust pvBits */ + HdrSize = *(char*)pbmi; + if (pbmiCopy->bmiHeader.biSizeImage + HdrSize + 12 == ResSize + && compr == BI_BITFIELDS && bpp == 32) + { + /* MSVC pointer to the image data has 12 more bytes than GCC */ + pvBits = (char*)pvBits + 12; + TRACE("MSVC Resource Compiled\n"); + } + /* Fix it up, if needed */ if(fuLoad & (LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS)) {