Jump to content

GreGetScreenChangeArea

From EDM2

GreGetScreenChangeArea takes an SCA handle and, for the identified SCA, adds its rectangles to the region pointed to by the phrgn field. The SCA is reset to NULL as a result of this call.

Simulation support
This function is mandatory for display drivers that want to be DCAF-enabled.

Syntax

GreGetScreenChangeArea(hdc, hsca, phrgn, pdcArg, FunN)

Parameters

hdc (HDC) - input
Any valid device context.
hsca (HSCA) - input
Handle of the SCA to be queried.
To be valid, the handle must be obtained from a previous call to GreOpenScreenChangeArea.
phrgn (PHRGN) - input
Pointer to a region handle.
pdcArg (PDC) - input
Pointer to instance data.
FunN (ULONG) - input
High-order word=Flags; Low-order word=NGreGetScreenArea.

Returns

rc (LONG) - returns
This function returns one of the following:
  • TRUE If the handle passed is recognized and no errors occurred.
  • FALSE All other cases.
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
  • PMERR_INV_HDC
  • PMERR_NO_HANDLE
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Remarks

It is permissible to implement this function by returning 0 to indicate that the bits were not saved and, therefore, must be saved by the calling routine.

GreGetScreenChangeArea calls EnterDriver and performs entry checks. Using the MergeSeamlessSCAWithGlobalSCAs routine, GreGetScreenChangeArea then checks to see if there are any rectangles in the Seamless SCA (called scaSeamless). If there are, they are merged with all of the currently active SCAs. MergeSeamlessSCAWithGlobalSCAs will call AccumulateScreenBound for every rectangle in scaSeamless. At the end, the cRects field of scaSeamless is set to zero. See Seamless Windows Support in Distributed Console Access Facility (DCAF) Architecture for more information on Seamless Windows support.

Next, the linked list is tracked until the SCA to be queried is found or the end of the linked list is reached. If the SCA to be queried is found, GreCombineRectRegion is called for all the rectangles in the SCA and adds the rectangles to the region passed by the user. If the call is always successful, the cRects field of the SCA is set to zero, resetting the SCA. If the end of the list is reached without finding the SCA, a PMERR_NO_ERROR is logged and the call returns FALSE.

If there were no errors, GreGetScreenChangeArea calls ExitDriver and returns TRUE.