HICON
-CreateCursorIconFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cxDesired, int cyDesired, int xHotspot, int yHotspot, BOOL fIcon)
+CreateCursorIconFromData(PVOID ImageData, ICONIMAGE* IconImage, int cxDesired, int cyDesired, int xHotspot, int yHotspot, BOOL fIcon)
{
- BYTE BitmapInfoBuffer[sizeof(BITMAPINFOHEADER) + 2 * sizeof(RGBQUAD)];
- BITMAPINFO *bwBIH = (BITMAPINFO *)BitmapInfoBuffer;
ICONINFO IconInfo;
+ PVOID pBits ;
+ HICON res;
IconInfo.fIcon = fIcon;
IconInfo.xHotspot = xHotspot;
{
IconInfo.hbmColor = (HBITMAP)0;
IconImage->icHeader.biHeight *= 2;
- IconInfo.hbmMask = CreateDIBitmap(hDC, &IconImage->icHeader, CBM_INIT,
- ImageData, (BITMAPINFO*)IconImage,
- DIB_RGB_COLORS);
+ IconInfo.hbmMask = CreateDIBSection(0,
+ (BITMAPINFO*)IconImage,
+ DIB_RGB_COLORS,
+ &pBits,
+ NULL,
+ 0);
+ if(!pBits)
+ {
+ ERR("Could not create a DIB section\n");
+ return NULL;
+ }
+ CopyMemory(pBits,
+ ImageData,
+ (((IconImage->icHeader.biWidth + 31) & ~31 ) >> 3) * IconImage->icHeader.biHeight) ;
}
else
{
+ BYTE BitmapInfoBuffer[sizeof(BITMAPINFOHEADER) + 2 * sizeof(RGBQUAD)];
+ BITMAPINFO *bwBIH = (BITMAPINFO *)BitmapInfoBuffer;
/* Create the XOR bitmap */
- IconInfo.hbmColor = CreateDIBitmap(hDC, &IconImage->icHeader, CBM_INIT,
- ImageData, (BITMAPINFO*)IconImage,
- DIB_RGB_COLORS);
+ IconInfo.hbmColor = CreateDIBSection(0,
+ (BITMAPINFO*)IconImage,
+ DIB_RGB_COLORS,
+ &pBits,
+ NULL,
+ 0);
+ if(!pBits)
+ {
+ ERR("Could not create a DIB section\n");
+ return NULL;
+ }
+ CopyMemory(pBits,
+ ImageData,
+ (((IconImage->icHeader.biWidth * IconImage->icHeader.biBitCount+ 31) & ~31 ) >> 3) * IconImage->icHeader.biHeight) ;
/* Make ImageData point to the start of the AND image data. */
ImageData = ((PBYTE)ImageData) + (((IconImage->icHeader.biWidth *
bwBIH->bmiColors[1].rgbRed = 0xff;
bwBIH->bmiColors[1].rgbReserved = 0;
- /* Create the AND bitmap. */
- IconInfo.hbmMask = CreateDIBitmap(hDC, &bwBIH->bmiHeader, 0,
- ImageData, bwBIH, DIB_RGB_COLORS);
-
- SetDIBits(hDC, IconInfo.hbmMask, 0, IconImage->icHeader.biHeight,
- ImageData, bwBIH, DIB_RGB_COLORS);
+ IconInfo.hbmMask = CreateDIBSection(0,
+ bwBIH,
+ DIB_RGB_COLORS,
+ &pBits,
+ NULL,
+ 0);
+ if(!pBits)
+ {
+ ERR("Could not create a DIB section\n");
+ DeleteObject(IconInfo.hbmColor);
+ return NULL;
+ }
+ CopyMemory(pBits,
+ ImageData,
+ (((IconImage->icHeader.biWidth + 31) & ~31 ) >> 3) * IconImage->icHeader.biHeight) ;
}
-
/* Create the icon based on everything we have so far */
- return NtUserCreateCursorIconHandle(&IconInfo, FALSE);
+ /* Use indirect creation, as DIBSection can't be shared between processes */
+ res = NtUserCreateCursorIconHandle(&IconInfo, TRUE);
+ DeleteObject(IconInfo.hbmMask);
+ if(IconInfo.hbmColor) DeleteObject(IconInfo.hbmColor);
+
+ return res;
}
/*
ULONG HeaderSize;
ULONG ColourCount;
PVOID Data;
- HDC hScreenDc;
WORD wXHotspot;
WORD wYHotspot;
/* make data point to the start of the XOR image data */
Data = (PBYTE)SafeIconImage + HeaderSize;
- /* get a handle to the screen dc, the icon we create is going to be compatable with this */
- hScreenDc = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
- if (hScreenDc == NULL)
- {
+ hIcon = CreateCursorIconFromData(Data, SafeIconImage, cxDesired, cyDesired, wXHotspot, wYHotspot, fIcon);
RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage);
- return(NULL);
- }
-
- hIcon = CreateCursorIconFromData(hScreenDc, Data, SafeIconImage, cxDesired, cyDesired, wXHotspot, wYHotspot, fIcon);
- RtlFreeHeap(GetProcessHeap(), 0, SafeIconImage);
- DeleteDC(hScreenDc);
return hIcon;
}
-/*
- * The following macro function accounts for the irregularities of
- * accessing cursor and icon resources in files and resource entries.
- */
-typedef BOOL
-(*fnGetCIEntry)(LPVOID dir, int n, int *width, int *height, int *bits );
-
/**********************************************************************
* CURSORICON_FindBestIcon
*
* Find the icon closest to the requested size and number of colors.
*/
-static int
+int
CURSORICON_FindBestIcon(LPVOID dir,
fnGetCIEntry get_entry,
int Width,
* FIXME: parameter 'color' ignored and entries with more than 1 bpp
* ignored too
*/
-static int
+int
CURSORICON_FindBestCursor(LPVOID dir,
fnGetCIEntry get_entry,
int Width,
HCURSOR hOldCursor = (HCURSOR)0;
HDC hdcScreen;
BOOL bResult;
-
+
CurInfo = IntGetSysCursorInfo();
OldCursor = CurInfo->CurrentCursorObject;
{
// FIXME: WTF?
CurIcon->IconInfo.hbmMask = BITMAP_CopyBitmap(CurIcon->IconInfo.hbmMask);
- CurIcon->IconInfo.hbmColor = BITMAP_CopyBitmap(CurIcon->IconInfo.hbmColor);
- }
- if (CurIcon->IconInfo.hbmColor &&
- (psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor)))
- {
- CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
- CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy;
- SURFACE_UnlockSurface(psurfBmp);
- GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL);
+ GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL);
+ if(CurIcon->IconInfo.hbmColor)
+ {
+ CurIcon->IconInfo.hbmColor = BITMAP_CopyBitmap(CurIcon->IconInfo.hbmColor);
+ GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL);
+ }
}
- if (CurIcon->IconInfo.hbmMask &&
- (psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmMask)))
+ else
{
- if (CurIcon->IconInfo.hbmColor == NULL)
+ if (CurIcon->IconInfo.hbmColor &&
+ (psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmColor)))
{
CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
- CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy >> 1;
+ CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy;
+ SURFACE_UnlockSurface(psurfBmp);
+ GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmColor, NULL);
+ }
+ if (CurIcon->IconInfo.hbmMask &&
+ (psurfBmp = SURFACE_LockSurface(CurIcon->IconInfo.hbmMask)))
+ {
+ if(!CurIcon->IconInfo.hbmColor)
+ {
+ CurIcon->Size.cx = psurfBmp->SurfObj.sizlBitmap.cx;
+ CurIcon->Size.cy = psurfBmp->SurfObj.sizlBitmap.cy*2;
+ }
+ SURFACE_UnlockSurface(psurfBmp);
+ GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL);
}
- SURFACE_UnlockSurface(psurfBmp);
- GDIOBJ_SetOwnership(CurIcon->IconInfo.hbmMask, NULL);
}
/* Calculate icon hotspot */
DesktopWindow = UserGetDesktopWindow();
- if (prcl != NULL &&
- (prcl->right > prcl->left) &&
+ if (prcl != NULL &&
+ (prcl->right > prcl->left) &&
(prcl->bottom > prcl->top) &&
DesktopWindow != NULL)
{
return FALSE;
}
+/* Mostly inspired from wine code */
BOOL
UserDrawIconEx(
HDC hDc,
{
BOOL Ret = FALSE;
HBITMAP hbmMask, hbmColor;
- BITMAP bmpMask, bmpColor;
+ BITMAP bmpColor, bm;
BOOL DoFlickerFree;
SIZE IconSize;
+ INT iOldBkColor = 0, iOldTxtColor = 0;
- HDC hdcOff;
+ HDC hMemDC, hOffDC = NULL;
HGDIOBJ hOldOffBrush = 0;
HGDIOBJ hOldOffBmp = 0;
- HBITMAP hbmOff = 0;
- HDC hdcMask = 0;
- HGDIOBJ hOldMask = NULL;
- HDC hdcImage = 0;
- HGDIOBJ hOldImage = NULL;
+ HBITMAP hTmpBmp = 0, hOffBmp = 0;
BOOL bAlpha = FALSE;
hbmMask = pIcon->IconInfo.hbmMask;
if (istepIfAniCur)
DPRINT1("NtUserDrawIconEx: istepIfAniCur is not supported!\n");
- if (!hbmMask || !IntGdiGetObject(hbmMask, sizeof(BITMAP), (PVOID)&bmpMask))
+ if (!hbmMask || !IntGdiGetObject(hbmMask, sizeof(BITMAP), (PVOID)&bm))
{
return FALSE;
}
return FALSE;
}
+ if(!(hMemDC = NtGdiCreateCompatibleDC(hDc)))
+ {
+ DPRINT1("NtGdiCreateCompatibleDC failed!\n");
+ return FALSE;
+ }
+
if (hbmColor)
{
IconSize.cx = bmpColor.bmWidth;
IconSize.cy = bmpColor.bmHeight;
}
- else
+ else /* take it from mask */
{
- IconSize.cx = bmpMask.bmWidth;
- IconSize.cy = bmpMask.bmHeight / 2;
+ IconSize.cx = bm.bmWidth;
+ IconSize.cy = bm.bmHeight/2;
}
+ if (!diFlags)
+ diFlags = DI_NORMAL;
+
/* NtGdiCreateCompatibleBitmap will create a monochrome bitmap
when cxWidth or cyHeight is 0 */
- if ((bmpColor.bmBitsPixel == 32) && (cxWidth != 0) && (cyHeight != 0))
+ if (hbmColor
+ && (bmpColor.bmBitsPixel == 32)
+ && (cxWidth != 0)
+ && (cyHeight != 0)
+ && (diFlags & DI_IMAGE))
{
SURFACE *psurfOff = NULL;
PFN_DIB_GetPixel fnSource_GetPixel = NULL;
/* In order to correctly display 32 bit icons Windows first scans the image,
because information about transparency is not stored in any image's headers */
- psurfOff = SURFACE_LockSurface(hbmColor ? hbmColor : hbmMask);
+ psurfOff = SURFACE_LockSurface(hbmColor);
if (psurfOff)
{
fnSource_GetPixel = DibFunctionsForBitmapFormat[psurfOff->SurfObj.iBitmapFormat].DIB_GetPixel;
}
}
- if (!diFlags)
- diFlags = DI_NORMAL;
-
if (!cxWidth)
cxWidth = ((diFlags & DI_DEFAULTSIZE) ?
UserGetSystemMetrics(SM_CXICON) : IconSize.cx);
DoFlickerFree = (hbrFlickerFreeDraw &&
(GDI_HANDLE_GET_TYPE(hbrFlickerFreeDraw) == GDI_OBJECT_TYPE_BRUSH));
- if (DoFlickerFree || bAlpha)
+ if (DoFlickerFree)
{
- RECTL r;
- BITMAP bm;
- SURFACE *psurfOff = NULL;
-
- r.right = cxWidth;
- r.bottom = cyHeight;
-
- hdcOff = NtGdiCreateCompatibleDC(hDc);
- if (!hdcOff)
- {
- DPRINT1("NtGdiCreateCompatibleDC() failed!\n");
- return FALSE;
- }
-
- hbmOff = NtGdiCreateCompatibleBitmap(hDc, cxWidth, cyHeight);
- if (!hbmOff)
- {
- DPRINT1("NtGdiCreateCompatibleBitmap() failed!\n");
- goto cleanup;
- }
-
- /* make sure we have a 32 bit offscreen bitmap
- otherwise we can't do alpha blending */
- psurfOff = SURFACE_LockSurface(hbmOff);
- if (psurfOff == NULL)
- {
- DPRINT1("BITMAPOBJ_LockBitmap() failed!\n");
- goto cleanup;
- }
- BITMAP_GetObject(psurfOff, sizeof(BITMAP), (PVOID)&bm);
-
- if (bm.bmBitsPixel != 32)
- bAlpha = FALSE;
-
- SURFACE_UnlockSurface(psurfOff);
-
- hOldOffBmp = NtGdiSelectBitmap(hdcOff, hbmOff);
- if (!hOldOffBmp)
+ hOffDC = NtGdiCreateCompatibleDC(hDc);
+ if(!hOffDC)
{
- DPRINT1("NtGdiSelectBitmap() failed!\n");
- goto cleanup;
+ DPRINT1("NtGdiCreateCompatibleBitmap failed!\n");
+ Ret = FALSE;
+ goto Cleanup ;
}
-
- if (DoFlickerFree)
+ hOffBmp = NtGdiCreateCompatibleBitmap(hDc, cxWidth, cyHeight);
+ if(!hOffBmp)
{
- hOldOffBrush = NtGdiSelectBrush(hdcOff, hbrFlickerFreeDraw);
- if (!hOldOffBrush)
- {
- DPRINT1("NtGdiSelectBrush() failed!\n");
- goto cleanup;
- }
-
- NtGdiPatBlt(hdcOff, 0, 0, r.right, r.bottom, PATCOPY);
+ DPRINT1("NtGdiCreateCompatibleBitmap failed!\n");
+ goto Cleanup ;
}
+ hOldOffBmp = NtGdiSelectBitmap(hOffDC, hOffBmp);
+ hOldOffBrush = NtGdiSelectBrush(hOffDC, hbrFlickerFreeDraw);
+ NtGdiPatBlt(hOffDC, 0, 0, cxWidth, cyHeight, PATCOPY);
+ NtGdiSelectBrush(hOffDC, hOldOffBrush);
}
else
- hdcOff = hDc;
-
- if (diFlags & DI_IMAGE)
{
- hdcImage = NtGdiCreateCompatibleDC(hDc);
- if (!hdcImage)
- {
- DPRINT1("NtGdiCreateCompatibleDC() failed!\n");
- goto cleanup;
- }
- hOldImage = NtGdiSelectBitmap(hdcImage, (hbmColor ? hbmColor : hbmMask));
- if (!hOldImage)
- {
- DPRINT("NtGdiSelectBitmap() failed!\n");
- goto cleanup;
- }
+ /* Set Background/foreground colors */
+ iOldTxtColor = IntGdiSetTextColor(hDc, 0); //black
+ iOldBkColor = IntGdiSetBkColor(hDc, 0x00FFFFFF); //white
}
- /* If DI_IMAGE flag is specified and hbmMask exists, then always use mask for drawing */
- if (diFlags & DI_MASK || (diFlags & DI_IMAGE && hbmMask))
- {
- hdcMask = NtGdiCreateCompatibleDC(hDc);
- if (!hdcMask)
- {
- DPRINT1("NtGdiCreateCompatibleDC() failed!\n");
- goto cleanup;
- }
-
- hOldMask = NtGdiSelectBitmap(hdcMask, hbmMask);
- if (!hOldMask)
- {
- DPRINT("NtGdiSelectBitmap() failed!\n");
- goto cleanup;
- }
- }
- if (hdcMask || hdcImage)
+ if (hbmMask && (diFlags & DI_MASK) && !bAlpha)
{
- GreStretchBltMask(hdcOff,
- (DoFlickerFree || bAlpha) ? 0 : xLeft,
- (DoFlickerFree || bAlpha) ? 0 : yTop,
- cxWidth,
- cyHeight,
- hdcImage ? hdcImage : hdcMask,
- 0,
- 0,
- IconSize.cx,
- IconSize.cy,
- SRCCOPY,
- 0,
- hdcMask,
- 0,
- hdcImage ? 0 : IconSize.cy);
+ hTmpBmp = NtGdiSelectBitmap(hMemDC, hbmMask);
+ NtGdiStretchBlt(hOffDC ? hOffDC : hDc,
+ hOffDC ? 0 : xLeft,
+ hOffDC ? 0 : yTop,
+ cxWidth,
+ cyHeight,
+ hMemDC,
+ 0,
+ 0,
+ IconSize.cx,
+ IconSize.cy,
+ SRCAND,
+ 0);
+ NtGdiSelectBitmap(hMemDC, hTmpBmp);
}
- if (hOldMask) NtGdiSelectBitmap(hdcMask, hOldMask);
- if (hOldImage) NtGdiSelectBitmap(hdcImage, hOldImage);
- if (hdcImage) NtGdiDeleteObjectApp(hdcImage);
- if (hdcMask) NtGdiDeleteObjectApp(hdcMask);
-
- if (bAlpha)
+ if(diFlags & DI_IMAGE)
{
- BITMAP bm;
- SURFACE *psurfOff = NULL;
- PBYTE pBits = NULL;
- BLENDFUNCTION BlendFunc;
- DWORD Pixel;
- BYTE Red, Green, Blue, Alpha;
- DWORD Count = 0;
- INT i, j;
-
- psurfOff = SURFACE_LockSurface(hbmOff);
- if (psurfOff == NULL)
+ if (bAlpha)
{
- DPRINT1("BITMAPOBJ_LockBitmap() failed!\n");
- goto cleanup;
- }
- BITMAP_GetObject(psurfOff, sizeof(BITMAP), (PVOID)&bm);
+ BLENDFUNCTION pixelblend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ DWORD Pixel;
+ BYTE Red, Green, Blue, Alpha;
+ DWORD Count = 0;
+ INT i, j;
+ PSURFACE psurf;
+ PBYTE pBits ;
+ HBITMAP hMemBmp = NULL;
+
+ pBits = ExAllocatePoolWithTag(PagedPool,
+ bmpColor.bmWidthBytes * abs(bmpColor.bmHeight),
+ TAG_BITMAP);
+ if (pBits == NULL)
+ {
+ Ret = FALSE;
+ goto CleanupAlpha;
+ }
- pBits = ExAllocatePoolWithTag(PagedPool, bm.bmWidthBytes * abs(bm.bmHeight), TAG_BITMAP);
- if (pBits == NULL)
- {
- DPRINT1("ExAllocatePoolWithTag() failed!\n");
- SURFACE_UnlockSurface(psurfOff);
- goto cleanup;
- }
+ hMemBmp = BITMAP_CopyBitmap(hbmColor);
+ if(!hMemBmp)
+ {
+ DPRINT1("BITMAP_CopyBitmap failed!");
+ goto CleanupAlpha;
+ }
- /* get icon bits */
- IntGetBitmapBits(psurfOff, bm.bmWidthBytes * abs(bm.bmHeight), pBits);
+ psurf = SURFACE_LockSurface(hMemBmp);
+ if(!psurf)
+ {
+ DPRINT1("SURFACE_LockSurface failed!\n");
+ goto CleanupAlpha;
+ }
+ /* get color bits */
+ IntGetBitmapBits(psurf,
+ bmpColor.bmWidthBytes * abs(bmpColor.bmHeight),
+ pBits);
- /* premultiply with the alpha channel value */
- for (i = 0; i < cyHeight; i++)
- {
- for (j = 0; j < cxWidth; j++)
+ /* premultiply with the alpha channel value */
+ for (i = 0; i < cyHeight; i++)
{
- Pixel = *(DWORD *)(pBits + Count);
+ for (j = 0; j < cxWidth; j++)
+ {
+ Pixel = *(DWORD *)(pBits + Count);
- Alpha = ((BYTE)(Pixel >> 24) & 0xff);
+ Alpha = ((BYTE)(Pixel >> 24) & 0xff);
- Red = (((BYTE)(Pixel >> 0)) * Alpha) / 0xff;
- Green = (((BYTE)(Pixel >> 8)) * Alpha) / 0xff;
- Blue = (((BYTE)(Pixel >> 16)) * Alpha) / 0xff;
+ Red = (((BYTE)(Pixel >> 0)) * Alpha) / 0xff;
+ Green = (((BYTE)(Pixel >> 8)) * Alpha) / 0xff;
+ Blue = (((BYTE)(Pixel >> 16)) * Alpha) / 0xff;
- *(DWORD *)(pBits + Count) = (DWORD)(Red | (Green << 8) | (Blue << 16) | (Alpha << 24));
+ *(DWORD *)(pBits + Count) = (DWORD)(Red | (Green << 8) | (Blue << 16) | (Alpha << 24));
- Count += sizeof(DWORD);
+ Count += sizeof(DWORD);
+ }
}
- }
-
- /* set icon bits */
- IntSetBitmapBits(psurfOff, bm.bmWidthBytes * abs(bm.bmHeight), pBits);
- ExFreePoolWithTag(pBits, TAG_BITMAP);
- SURFACE_UnlockSurface(psurfOff);
-
- BlendFunc.BlendOp = AC_SRC_OVER;
- BlendFunc.BlendFlags = 0;
- BlendFunc.SourceConstantAlpha = 255;
- BlendFunc.AlphaFormat = AC_SRC_ALPHA;
+ /* set mem bits */
+ IntSetBitmapBits(psurf,
+ bmpColor.bmWidthBytes * abs(bmpColor.bmHeight),
+ pBits);
+ SURFACE_UnlockSurface(psurf);
+
+ hTmpBmp = NtGdiSelectBitmap(hMemDC, hMemBmp);
+
+ NtGdiAlphaBlend(hOffDC ? hOffDC : hDc,
+ hOffDC ? 0 : xLeft,
+ hOffDC ? 0 : yTop,
+ cxWidth,
+ cyHeight,
+ hMemDC,
+ 0,
+ 0,
+ IconSize.cx,
+ IconSize.cy,
+ pixelblend,
+ NULL);
+ NtGdiSelectBitmap(hMemDC, hTmpBmp);
+ CleanupAlpha:
+ if(pBits) ExFreePoolWithTag(pBits, TAG_BITMAP);
+ if(hMemBmp) NtGdiDeleteObjectApp(hMemBmp);
+ }
+ else if (hbmColor)
+ {
+ DWORD rop = (diFlags & DI_MASK) ? SRCINVERT : SRCCOPY ;
+ hTmpBmp = NtGdiSelectBitmap(hMemDC, hbmColor);
+ NtGdiStretchBlt(hOffDC ? hOffDC : hDc,
+ hOffDC ? 0 : xLeft,
+ hOffDC ? 0 : yTop,
+ cxWidth,
+ cyHeight,
+ hMemDC,
+ 0,
+ 0,
+ IconSize.cx,
+ IconSize.cy,
+ rop,
+ 0);
+ NtGdiSelectBitmap(hMemDC, hTmpBmp);
+ }
+ }
- NtGdiAlphaBlend(hDc, xLeft, yTop, cxWidth, cyHeight,
- hdcOff, 0, 0, cxWidth, cyHeight, BlendFunc, 0);
+ if(hOffDC)
+ {
+ NtGdiBitBlt(hDc, xLeft, yTop, cxWidth, cyHeight, hOffDC, 0, 0, SRCCOPY, 0, 0);
}
- else if (DoFlickerFree)
+ else
{
- NtGdiBitBlt(hDc, xLeft, yTop, cxWidth,
- cyHeight, hdcOff, 0, 0, SRCCOPY, 0, 0);
+ IntGdiSetBkColor(hDc, iOldBkColor);
+ IntGdiSetTextColor(hDc, iOldTxtColor);
}
- Ret = TRUE;
+ Ret = TRUE ;
-cleanup:
- if (DoFlickerFree || bAlpha)
- {
- if (hOldOffBmp) NtGdiSelectBitmap(hdcOff, hOldOffBmp);
- if (hOldOffBrush) NtGdiSelectBrush(hdcOff, hOldOffBrush);
- if (hbmOff) GreDeleteObject(hbmOff);
- if (hdcOff) NtGdiDeleteObjectApp(hdcOff);
- }
+Cleanup:
+ NtGdiDeleteObjectApp(hMemDC);
+ if(hOldOffBmp) NtGdiSelectBitmap(hOffDC, hOldOffBmp);
+ if(hOffDC) NtGdiDeleteObjectApp(hOffDC);
+ if(hOffBmp) NtGdiDeleteObjectApp(hOffBmp);
return Ret;
}