Index: subsystems/win32/win32k/objects/dibobj.c =================================================================== --- subsystems/win32/win32k/objects/dibobj.c (revision 39873) +++ subsystems/win32/win32k/objects/dibobj.c (working copy) @@ -271,8 +271,17 @@ return 0; } - // Destination palette obtained from the hDC - hDCPalette = PALETTE_LockPalette(((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault); + //using hDIBPalette if exists + if (bitmap->hDIBPalette) + { + DDB_Palette = bitmap->hDIBPalette; + } + else + { + // Destination palette obtained from the hDC + DDB_Palette = ((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault; + } + hDCPalette = PALETTE_LockPalette(DDB_Palette); if (NULL == hDCPalette) { EngUnlockSurface(SourceSurf); @@ -282,7 +291,6 @@ return 0; } DDB_Palette_Type = hDCPalette->Mode; - DDB_Palette = ((GDIDEVICE *)DC->pPDev)->DevInfo.hpalDefault; PALETTE_UnlockPalette(hDCPalette); // Source palette obtained from the BITMAPINFO