Author: jimtabor Date: Thu Apr 27 19:20:09 2017 New Revision: 74422
URL: http://svn.reactos.org/svn/reactos?rev=74422&view=rev Log: [NtGDI] - Use internal function for setting brush origin. Related to CORE-13110.
Modified: trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c?... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] Thu Apr 27 19:20:09 2017 @@ -168,40 +168,30 @@ _In_ INT y, _Out_opt_ LPPOINT pptOut) { - PDC pdc; - - /* Lock the DC */ - pdc = DC_LockDc(hdc); - if (pdc == NULL) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - - /* Check if the old origin was requested */ - if (pptOut != NULL) - { - /* Enter SEH for buffer transfer */ - _SEH2_TRY - { - /* Probe and copy the old origin */ - ProbeForWrite(pptOut, sizeof(POINT), 1); - *pptOut = pdc->pdcattr->ptlBrushOrigin; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - DC_UnlockDc(pdc); - _SEH2_YIELD(return FALSE); - } - _SEH2_END; - } - - /* Call the internal function */ - DC_vSetBrushOrigin(pdc, x, y); - - /* Unlock the DC and return success */ - DC_UnlockDc(pdc); - return TRUE; + + POINT ptOut; + /* Call the internal function */ + BOOL Ret = GreSetBrushOrg( hdc, x, y, &ptOut); + if (Ret) + { + /* Check if the old origin was requested */ + if (pptOut != NULL) + { + /* Enter SEH for buffer transfer */ + _SEH2_TRY + { + /* Probe and copy the old origin */ + ProbeForWrite(pptOut, sizeof(POINT), 1); + *pptOut = ptOut; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return FALSE); + } + _SEH2_END; + } + } + return Ret; }
HPALETTE