diff --git a/reactos/subsystems/win32/win32k/objects/wingl.c b/reactos/subsystems/win32/win32k/objects/wingl.c index a46dbcec164..586df78b23d 100644 --- a/reactos/subsystems/win32/win32k/objects/wingl.c +++ b/reactos/subsystems/win32/win32k/objects/wingl.c @@ -162,6 +162,9 @@ NtGdiSetPixelFormat( ppdev = pdc->ppdev; + /* + WndObj is needed so exit on NULL pointer. + */ if (pWndObj) pso = pWndObj->psoOwner; else { @@ -169,18 +172,6 @@ NtGdiSetPixelFormat( goto Exit; } - if (!pso) - { - /* - Based on some rules! InfoDC to DC or, based on wiki information! - All pointers, it's a "must be!", (CONTAINING_RECORD +10h = SURFOBJ), the - pointer will start at SURFOBJ of the SURFACE structure. - */ - pso = (SURFOBJ *)pdc->dclevel.pSurface; - if (!pso) pso = pdc->pSurfInfo; - if (!pso) pso = ppdev->pSurface; - } - if (ppdev->flFlags & PDEV_META_DEVICE) { UNIMPLEMENTED;