Author: tkreuzer Date: Tue Aug 15 18:13:14 2017 New Revision: 75553
URL: http://svn.reactos.org/svn/reactos?rev=75553&view=rev Log: [WIN32K] IntEngBitBlt returns BOOL, not NTSTATUS! Fix usage in NtGdiSetDIBitsToDeviceInternal accordingly and get rid of NTSTATUS variable entirely.
Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c?... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Tue Aug 15 18:13:14 2017 @@ -470,8 +470,7 @@ IN BOOL bTransformCoordinates, IN OPTIONAL HANDLE hcmXform) { - INT ret = 0; - NTSTATUS Status = STATUS_SUCCESS; + INT ret; PDC pDC = NULL; HBITMAP hSourceBitmap = NULL, hMaskBitmap = NULL; SURFOBJ *pDestSurf, *pSourceSurf = NULL, *pMaskSurf = NULL; @@ -483,6 +482,7 @@ EXLATEOBJ exlo; PPALETTE ppalDIB = NULL; LPBITMAPINFO pbmiSafe; + BOOL bResult;
if (!Bits) return 0;
@@ -498,19 +498,16 @@ } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - Status = _SEH2_GetExceptionCode(); + ret = 0; + goto Exit; } _SEH2_END - - if (!NT_SUCCESS(Status)) - { - goto Exit; - }
ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan); if (ScanLines == 0) { DPRINT1("ScanLines == 0\n"); + ret = 0; goto Exit; }
@@ -518,11 +515,13 @@ if (!pDC) { EngSetLastError(ERROR_INVALID_HANDLE); + ret = 0; goto Exit; }
if (pDC->dctype == DC_TYPE_INFO) { + ret = 0; goto Exit; }
@@ -564,14 +563,14 @@ if (!hSourceBitmap) { EngSetLastError(ERROR_NO_SYSTEM_RESOURCES); - Status = STATUS_NO_MEMORY; + ret = 0; goto Exit; }
pSourceSurf = EngLockSurface((HSURF)hSourceBitmap); if (!pSourceSurf) { - Status = STATUS_UNSUCCESSFUL; + ret = 0; goto Exit; }
@@ -586,13 +585,13 @@ if (!hMaskBitmap) { EngSetLastError(ERROR_NO_SYSTEM_RESOURCES); - Status = STATUS_NO_MEMORY; + ret = 0; goto Exit; } pMaskSurf = EngLockSurface((HSURF)hMaskBitmap); if (!pMaskSurf) { - Status = STATUS_UNSUCCESSFUL; + ret = 0; goto Exit; } } @@ -602,7 +601,7 @@ if (!ppalDIB) { EngSetLastError(ERROR_NO_SYSTEM_RESOURCES); - Status = STATUS_NO_MEMORY; + ret = 0; goto Exit; }
@@ -632,7 +631,7 @@ DPRINT("BitsToDev with dstsurf=(%d|%d) (%d|%d), src=(%d|%d) w=%d h=%d\n", rcDest.left, rcDest.top, rcDest.right, rcDest.bottom, ptSource.x, ptSource.y, SourceSize.cx, SourceSize.cy); - Status = IntEngBitBlt(pDestSurf, + bResult = IntEngBitBlt(pDestSurf, pSourceSurf, pMaskSurf, (CLIPOBJ *)&pDC->co, @@ -650,11 +649,9 @@ /* We're done */ DC_vFinishBlit(pDC, NULL);
+ ret = bResult ? ScanLines : 0; + Exit: - if (NT_SUCCESS(Status)) - { - ret = ScanLines; - }
if (ppalDIB) PALETTE_ShareUnlockPalette(ppalDIB); if (pSourceSurf) EngUnlockSurface(pSourceSurf);