mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[NTGDI] Fix MaskBlt error code and check pattern usage (#7083)
Follow-up to #7074. Fix MaskBlt behaviour. JIRA issue: CORE-13133 - Fix MaskBlt error code. - Fix MaskBlt pattern usage check.
This commit is contained in:
parent
c536664666
commit
61cdd02d1c
1 changed files with 12 additions and 4 deletions
|
@ -337,18 +337,22 @@ NtGdiMaskBlt(
|
||||||
BOOL Status = FALSE;
|
BOOL Status = FALSE;
|
||||||
EXLATEOBJ exlo;
|
EXLATEOBJ exlo;
|
||||||
XLATEOBJ *XlateObj = NULL;
|
XLATEOBJ *XlateObj = NULL;
|
||||||
BOOL UsesSource;
|
BOOL UsesSource, UsesPattern;
|
||||||
ROP4 rop4;
|
ROP4 rop4;
|
||||||
|
|
||||||
rop4 = WIN32_ROP4_TO_ENG_ROP4(dwRop4);
|
rop4 = WIN32_ROP4_TO_ENG_ROP4(dwRop4);
|
||||||
|
|
||||||
UsesSource = ROP4_USES_SOURCE(rop4);
|
if (!hdcDest)
|
||||||
if (!hdcDest || (UsesSource && !hdcSrc))
|
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UsesSource = ROP4_USES_SOURCE(rop4);
|
||||||
|
UsesPattern = ROP4_USES_PATTERN(rop4);
|
||||||
|
if (!hdcSrc && (UsesSource || UsesPattern))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* Check if we need a mask and have a mask bitmap */
|
/* Check if we need a mask and have a mask bitmap */
|
||||||
if (ROP4_USES_MASK(rop4) && (hbmMask != NULL))
|
if (ROP4_USES_MASK(rop4) && (hbmMask != NULL))
|
||||||
{
|
{
|
||||||
|
@ -363,8 +367,8 @@ NtGdiMaskBlt(
|
||||||
/* Make sure the mask bitmap is 1 BPP */
|
/* Make sure the mask bitmap is 1 BPP */
|
||||||
if (gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1)
|
if (gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
|
||||||
SURFACE_ShareUnlockSurface(psurfMask);
|
SURFACE_ShareUnlockSurface(psurfMask);
|
||||||
|
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -398,6 +402,7 @@ NtGdiMaskBlt(
|
||||||
if(DCSrc) DC_UnlockDc(DCSrc);
|
if(DCSrc) DC_UnlockDc(DCSrc);
|
||||||
WARN("Invalid destination dc handle (0x%p) passed to NtGdiMaskBlt\n", hdcDest);
|
WARN("Invalid destination dc handle (0x%p) passed to NtGdiMaskBlt\n", hdcDest);
|
||||||
if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
|
if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
|
||||||
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,6 +538,9 @@ cleanup:
|
||||||
DC_UnlockDc(DCDest);
|
DC_UnlockDc(DCDest);
|
||||||
if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
|
if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
|
||||||
|
|
||||||
|
if (!Status)
|
||||||
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue