2 * PROJECT: ReactOS win32 kernel mode subsystem
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: subsystems/win32/win32k/objects/wingl.c
17 IntGetipfdDevMax(PDC pdc
)
20 PPDEVOBJ ppdev
= pdc
->ppdev
;
22 if (ppdev
->flFlags
& PDEV_META_DEVICE
)
27 if (ppdev
->DriverFunctions
.DescribePixelFormat
)
29 Ret
= ppdev
->DriverFunctions
.DescribePixelFormat(
36 if (Ret
) pdc
->ipfdDevMax
= Ret
;
41 _Success_(return != 0)
44 NtGdiDescribePixelFormat(
48 _When_(cjpfd
!= 0, _Out_
) PPIXELFORMATDESCRIPTOR ppfd
)
53 PIXELFORMATDESCRIPTOR pfdSafe
;
55 if ((ppfd
== NULL
) && (cjpfd
!= 0)) return 0;
60 EngSetLastError(ERROR_INVALID_HANDLE
);
64 if (!pdc
->ipfdDevMax
) IntGetipfdDevMax(pdc
);
66 if ((ipfd
< 1) || (ipfd
> pdc
->ipfdDevMax
))
68 EngSetLastError(ERROR_INVALID_PARAMETER
);
74 if (ppdev
->flFlags
& PDEV_META_DEVICE
)
80 if (ppdev
->DriverFunctions
.DescribePixelFormat
)
82 Ret
= ppdev
->DriverFunctions
.DescribePixelFormat(
93 cjpfd
= min(cjpfd
, sizeof(PIXELFORMATDESCRIPTOR
));
94 ProbeForWrite(ppfd
, cjpfd
, 1);
95 RtlCopyMemory(ppfd
, &pfdSafe
, cjpfd
);
97 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
99 SetLastNtError(_SEH2_GetExceptionCode());
123 pdc
= DC_LockDc(hdc
);
126 EngSetLastError(ERROR_INVALID_HANDLE
);
130 if (!pdc
->ipfdDevMax
) IntGetipfdDevMax(pdc
);
133 ipfd
> pdc
->ipfdDevMax
)
135 EngSetLastError(ERROR_INVALID_PARAMETER
);
139 UserEnterExclusive();
140 hWnd
= UserGethWnd(hdc
, &pWndObj
);
145 EngSetLastError(ERROR_INVALID_WINDOW_STYLE
);
152 WndObj is needed so exit on NULL pointer.
154 if (pWndObj
) pso
= pWndObj
->psoOwner
;
157 EngSetLastError(ERROR_INVALID_PIXEL_FORMAT
);
161 if (ppdev
->flFlags
& PDEV_META_DEVICE
)
167 if (ppdev
->DriverFunctions
.SetPixelFormat
)
169 Ret
= ppdev
->DriverFunctions
.SetPixelFormat(
182 NtGdiSwapBuffers(HDC hDC
)