diff --git a/reactos/tools/spec2def/spec2def.c b/reactos/tools/spec2def/spec2def.c index 5264f4104b5..117daf93ecf 100644 --- a/reactos/tools/spec2def/spec2def.c +++ b/reactos/tools/spec2def/spec2def.c @@ -604,7 +604,8 @@ OutputLine_def_GCC(FILE *fileDest, EXPORT *pexp) /* C++ stubs are forwarded to C stubs */ fprintf(fileDest, "=stub_function%d", pexp->nNumber); } - else if (gbTracing && ((pexp->uFlags & FL_NORELAY) == 0) && (pexp->nCallingConvention == CC_STDCALL) && + else if (gbTracing && ((pexp->uFlags & FL_NORELAY) == 0) && + (pexp->nCallingConvention == CC_STDCALL) && (pexp->strName.buf[0] != '?')) { /* Redirect it to the relay-tracing trampoline */ diff --git a/reactos/win32ss/gdi/ntgdi/dcobjs.c b/reactos/win32ss/gdi/ntgdi/dcobjs.c index 4772e9456df..72b34c25a85 100644 --- a/reactos/win32ss/gdi/ntgdi/dcobjs.c +++ b/reactos/win32ss/gdi/ntgdi/dcobjs.c @@ -318,6 +318,28 @@ NtGdiSelectPen( return hOrgPen; } +BOOL +NTAPI +DC_bIsBitmapCompatible(PDC pdc, PSURFACE psurf) +{ + ULONG cBitsPixel; + + /* Must be an API bitmap */ + if (!(psurf->flags & API_BITMAP)) return FALSE; + + /* DIB sections are always compatible */ + if (psurf->hSecure != NULL) return TRUE; + + /* Get the bit depth of the bitmap */ + cBitsPixel = gajBitsPerFormat[psurf->SurfObj.iBitmapFormat]; + + /* 1 BPP is compatible */ + if ((cBitsPixel == 1) || (cBitsPixel == pdc->ppdev->gdiinfo.cBitsPixel)) + return TRUE; + + return FALSE; +} + /* * @implemented */ @@ -332,7 +354,6 @@ NtGdiSelectBitmap( PSURFACE psurfNew, psurfOld; PREGION VisRgn; HDC hdcOld; - ULONG cBitsPixel; ASSERT_NOGDILOCKS(); /* Verify parameters */ @@ -395,10 +416,7 @@ NtGdiSelectBitmap( } /* Check if the bitmap is compatile with the dc */ - cBitsPixel = gajBitsPerFormat[psurfNew->SurfObj.iBitmapFormat]; - if ((cBitsPixel != 1) && - (cBitsPixel != pdc->ppdev->gdiinfo.cBitsPixel) && - (psurfNew->hSecure == NULL)) + if (!DC_bIsBitmapCompatible(pdc, psurfNew)) { /* Dereference the bitmap, unlock the DC and fail. */ SURFACE_ShareUnlockSurface(psurfNew);