From 855bf46399b0f3c852250cccf11fb655e536be78 Mon Sep 17 00:00:00 2001 From: Oleg Dubinskiy Date: Fri, 1 May 2020 16:57:11 +0300 Subject: [PATCH] [WIN32SS][NTDDRAW] Get complexity of visible region in DxEngGetDCState (#2604) CORE-7733 Get the complexity of visible region in the DxEngGetDCState() function, according to its remarks. This implementation returns a number of rectangles that make up the region, similarly to as it done in REGION_Complexity() function: https://git.reactos.org/?p=reactos.git;a=blob;f=win32ss/gdi/ntgdi/region.c;h=38bf3d377fa805e9db8768774c4fc473590252d0;hb=HEAD#l573 It is required by MS ddraw.dll when calling win32k/dxg functions during launching DirectDraw test or any DirectX 1 - 7 apps/games. --- win32ss/reactx/ntddraw/dxeng.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win32ss/reactx/ntddraw/dxeng.c b/win32ss/reactx/ntddraw/dxeng.c index f1c681f1e3f..24cb542643e 100644 --- a/win32ss/reactx/ntddraw/dxeng.c +++ b/win32ss/reactx/ntddraw/dxeng.c @@ -4,6 +4,7 @@ * FILE: win32ss/reactx/ntddraw/dxeng.c * PURPOSE: Implementation of DxEng functions * PROGRAMMERS: Magnus Olsen (magnus@greatlord.com) + * Oleg Dubinskiy (oleg.dubinskij2013@yandex.ua) */ #include @@ -442,7 +443,7 @@ DxEngSetHdevData(HDEV hDev, * Return one of the type values * * @remarks. -* We do not have type 2 implemented yet +* none * *--*/ DWORD_PTR @@ -463,7 +464,8 @@ DxEngGetDCState(HDC hDC, retVal = (DWORD_PTR) pDC->fs & DC_FLAG_FULLSCREEN; break; case 2: - UNIMPLEMENTED; + /* Return the number of rectangles in the visible region. */ + retVal = (DWORD_PTR) pDC->prgnRao ? pDC->prgnRao->rdh.nCount : pDC->prgnVis->rdh.nCount; break; case 3: {