Fix SetWindowExtEx to pass all tests

svn path=/trunk/; revision=56424
This commit is contained in:
Timo Kreuzer 2012-04-25 18:15:41 +00:00
parent e28f37f061
commit 05599f98f0

View file

@ -483,38 +483,42 @@ SetWindowOrgEx(HDC hdc,
*/ */
BOOL BOOL
WINAPI WINAPI
SetWindowExtEx(HDC hdc, SetWindowExtEx(
int nXExtent, _In_ HDC hdc,
int nYExtent, _In_ INT nXExtent,
LPSIZE lpSize) _In_ INT nYExtent,
_Out_opt_ LPSIZE lpSize)
{ {
PDC_ATTR pdcattr; PDC_ATTR pdcattr;
ULONG ulType;
#if 0 /* Check what type of DC that is */
if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) ulType = GDI_HANDLE_GET_TYPE(hdc);
switch (ulType)
{ {
if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) case GDILoObjType_LO_DC_TYPE:
return MFDRV_SetWindowExtEx(); /* Handle this in the path below */
else break;
{ #if 0// FIXME: we don't support this
PLDC pLDC = GdiGetLDC(hdc); case GDILoObjType_LO_METADC16_TYPE:
if ( !pLDC ) return MFDRV_SetWindowExtEx(hdc, nXExtent, nYExtent, lpSize);
{
SetLastError(ERROR_INVALID_HANDLE); case GDILoObjType_LO_METAFILE_TYPE:
return FALSE; return EMFDRV_SetWindowExtEx(hdc, nXExtent, nYExtent, lpSize);
}
if (pLDC->iType == LDC_EMFLDC)
{
return EMFDRV_SetWindowExtEx();
}
}
}
#endif #endif
default:
/* Other types are not allowed */
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
/* Get the DC attr */
pdcattr = GdiGetDcAttr(hdc); pdcattr = GdiGetDcAttr(hdc);
if (!pdcattr) if (!pdcattr)
{ {
/* Set the error value and return failure */
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
return 0; return FALSE;
} }
if (lpSize) if (lpSize)
@ -549,7 +553,8 @@ SetWindowExtEx(HDC hdc,
if (pdcattr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc); if (pdcattr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc);
pdcattr->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;
} }
/* /*