mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[GDI32/WIN32K]
Fix some regressions from previous commit svn path=/trunk/; revision=56401
This commit is contained in:
parent
4bc462e69c
commit
aa85f812bd
2 changed files with 143 additions and 129 deletions
|
@ -479,7 +479,8 @@ SetWindowExtEx(HDC hdc,
|
||||||
int nYExtent,
|
int nYExtent,
|
||||||
LPSIZE lpSize)
|
LPSIZE lpSize)
|
||||||
{
|
{
|
||||||
PDC_ATTR Dc_Attr;
|
PDC_ATTR pdcattr;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
|
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)
|
||||||
{
|
{
|
||||||
|
@ -500,39 +501,44 @@ SetWindowExtEx(HDC hdc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE;
|
pdcattr = GdiGetDcAttr(hdc);
|
||||||
|
if (!pdcattr)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (lpSize)
|
if (lpSize)
|
||||||
{
|
{
|
||||||
lpSize->cx = Dc_Attr->szlWindowExt.cx;
|
lpSize->cx = pdcattr->szlWindowExt.cx;
|
||||||
lpSize->cy = Dc_Attr->szlWindowExt.cy;
|
lpSize->cy = pdcattr->szlWindowExt.cy;
|
||||||
if (Dc_Attr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx;
|
if (pdcattr->dwLayout & LAYOUT_RTL) lpSize->cx = -lpSize->cx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Dc_Attr->dwLayout & LAYOUT_RTL)
|
if (pdcattr->dwLayout & LAYOUT_RTL)
|
||||||
{
|
{
|
||||||
NtGdiMirrorWindowOrg(hdc);
|
NtGdiMirrorWindowOrg(hdc);
|
||||||
Dc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID);
|
pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID);
|
||||||
}
|
}
|
||||||
else if ((Dc_Attr->iMapMode == MM_ISOTROPIC) || (Dc_Attr->iMapMode == MM_ANISOTROPIC))
|
else if ((pdcattr->iMapMode == MM_ISOTROPIC) || (pdcattr->iMapMode == MM_ANISOTROPIC))
|
||||||
{
|
{
|
||||||
if ((Dc_Attr->szlWindowExt.cx == nXExtent) && (Dc_Attr->szlWindowExt.cy == nYExtent))
|
if ((pdcattr->szlWindowExt.cx == nXExtent) && (pdcattr->szlWindowExt.cy == nYExtent))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if ((!nXExtent) || (!nYExtent)) return FALSE;
|
if ((!nXExtent) || (!nYExtent)) return FALSE;
|
||||||
|
|
||||||
if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
|
if (NtCurrentTeb()->GdiTebBatch.HDC == hdc)
|
||||||
{
|
{
|
||||||
if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
|
if (pdcattr->ulDirty_ & DC_FONTTEXT_DIRTY)
|
||||||
{
|
{
|
||||||
NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
|
NtGdiFlush(); // Sync up Dc_Attr from Kernel space.
|
||||||
Dc_Attr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
|
pdcattr->ulDirty_ &= ~(DC_MODE_DIRTY|DC_FONTTEXT_DIRTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Dc_Attr->szlWindowExt.cx = nXExtent;
|
pdcattr->szlWindowExt.cx = nXExtent;
|
||||||
Dc_Attr->szlWindowExt.cy = nYExtent;
|
pdcattr->szlWindowExt.cy = nYExtent;
|
||||||
if (Dc_Attr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc);
|
if (pdcattr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc);
|
||||||
Dc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID);
|
pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID);
|
||||||
}
|
}
|
||||||
return TRUE; // Return TRUE.
|
return TRUE; // Return TRUE.
|
||||||
}
|
}
|
||||||
|
|
|
@ -909,9 +909,6 @@ GetObjectW(HGDIOBJ hGdiObj, int cbSize, LPVOID lpBuffer)
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
return cbResult;
|
return cbResult;
|
||||||
|
|
||||||
case GDI_OBJECT_TYPE_METADC:
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case GDI_OBJECT_TYPE_DC:
|
case GDI_OBJECT_TYPE_DC:
|
||||||
case GDI_OBJECT_TYPE_REGION:
|
case GDI_OBJECT_TYPE_REGION:
|
||||||
case GDI_OBJECT_TYPE_EMF:
|
case GDI_OBJECT_TYPE_EMF:
|
||||||
|
@ -1011,25 +1008,30 @@ SetDCBrushColor(
|
||||||
COLORREF
|
COLORREF
|
||||||
WINAPI
|
WINAPI
|
||||||
SetDCPenColor(
|
SetDCPenColor(
|
||||||
HDC hdc,
|
_In_ HDC hdc,
|
||||||
COLORREF crColor
|
_In_ COLORREF crColor)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
PDC_ATTR Dc_Attr;
|
PDC_ATTR pdcattr;
|
||||||
COLORREF OldColor = CLR_INVALID;
|
COLORREF OldColor;
|
||||||
|
|
||||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return OldColor;
|
/* Get the dc attribute */
|
||||||
else
|
pdcattr = GdiGetDcAttr(hdc);
|
||||||
|
if (!pdcattr)
|
||||||
{
|
{
|
||||||
OldColor = (COLORREF) Dc_Attr->ulPenClr;
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
Dc_Attr->ulPenClr = (ULONG) crColor;
|
return CLR_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
if ( Dc_Attr->crPenClr != crColor )
|
/* Get old color and store the new */
|
||||||
|
OldColor = (COLORREF)pdcattr->ulPenClr;
|
||||||
|
pdcattr->ulPenClr = (ULONG)crColor;
|
||||||
|
|
||||||
|
if (pdcattr->crPenClr != crColor)
|
||||||
{
|
{
|
||||||
Dc_Attr->ulDirty_ |= DIRTY_LINE;
|
pdcattr->ulDirty_ |= DIRTY_LINE;
|
||||||
Dc_Attr->crPenClr = crColor;
|
pdcattr->crPenClr = crColor;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return OldColor;
|
return OldColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1438,17 +1440,23 @@ GetMapMode(HDC hdc)
|
||||||
INT
|
INT
|
||||||
WINAPI
|
WINAPI
|
||||||
SetMapMode(
|
SetMapMode(
|
||||||
HDC hdc,
|
_In_ HDC hdc,
|
||||||
INT Mode
|
_In_ INT iMode)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
PDC_ATTR Dc_Attr;
|
PDC_ATTR pdcattr;
|
||||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
|
||||||
|
pdcattr = GdiGetDcAttr(hdc);
|
||||||
|
if (!pdcattr)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
|
||||||
{
|
{
|
||||||
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
|
||||||
return MFDRV_SetMapMode(hdc, Mode);
|
return MFDRV_SetMapMode(hdc, iMode);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
@ -1456,34 +1464,34 @@ SetMapMode(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Force change if Isotropic is set for recompute.
|
// Force change if Isotropic is set for recompute.
|
||||||
if ((Mode != Dc_Attr->iMapMode) || (Mode == MM_ISOTROPIC))
|
if ((iMode != pdcattr->iMapMode) || (iMode == MM_ISOTROPIC))
|
||||||
{
|
{
|
||||||
Dc_Attr->ulDirty_ &= ~SLOW_WIDTHS;
|
pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
|
||||||
return GetAndSetDCDWord( hdc, GdiGetSetMapMode, Mode, 0, 0, 0 );
|
return GetAndSetDCDWord( hdc, GdiGetSetMapMode, iMode, 0, 0, 0 );
|
||||||
}
|
|
||||||
return Dc_Attr->iMapMode;
|
|
||||||
}
|
}
|
||||||
|
return pdcattr->iMapMode;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
WINAPI
|
WINAPI
|
||||||
GetStretchBltMode(HDC hdc)
|
GetStretchBltMode(HDC hdc)
|
||||||
{
|
{
|
||||||
PDC_ATTR Dc_Attr;
|
PDC_ATTR Dc_Attr;
|
||||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0;
|
||||||
return Dc_Attr->lStretchBltMode;
|
return Dc_Attr->lStretchBltMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
WINAPI
|
WINAPI
|
||||||
SetStretchBltMode(HDC hdc, int iStretchMode)
|
SetStretchBltMode(HDC hdc, int iStretchMode)
|
||||||
{
|
{
|
||||||
INT oSMode;
|
INT oSMode;
|
||||||
PDC_ATTR Dc_Attr;
|
PDC_ATTR Dc_Attr;
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -1517,30 +1525,30 @@ SetMapMode(
|
||||||
Dc_Attr->jStretchBltMode = iStretchMode;
|
Dc_Attr->jStretchBltMode = iStretchMode;
|
||||||
|
|
||||||
return oSMode;
|
return oSMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
HFONT
|
HFONT
|
||||||
WINAPI
|
WINAPI
|
||||||
GetHFONT(HDC hdc)
|
GetHFONT(HDC hdc)
|
||||||
{
|
{
|
||||||
PDC_ATTR Dc_Attr;
|
PDC_ATTR Dc_Attr;
|
||||||
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return NULL;
|
if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return NULL;
|
||||||
return Dc_Attr->hlfntNew;
|
return Dc_Attr->hlfntNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
HGDIOBJ
|
HGDIOBJ
|
||||||
WINAPI
|
WINAPI
|
||||||
SelectObject(HDC hDC,
|
SelectObject(HDC hDC,
|
||||||
HGDIOBJ hGdiObj)
|
HGDIOBJ hGdiObj)
|
||||||
{
|
{
|
||||||
PDC_ATTR pDc_Attr;
|
PDC_ATTR pDc_Attr;
|
||||||
HGDIOBJ hOldObj = NULL;
|
HGDIOBJ hOldObj = NULL;
|
||||||
UINT uType;
|
UINT uType;
|
||||||
|
@ -1618,10 +1626,10 @@ SetMapMode(
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
case GDI_OBJECT_TYPE_PALETTE:
|
case GDI_OBJECT_TYPE_PALETTE:
|
||||||
default:
|
|
||||||
SetLastError(ERROR_INVALID_FUNCTION);
|
SetLastError(ERROR_INVALID_FUNCTION);
|
||||||
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue