BeginCloseDC

OS2_PM_DRV_ENABLE: BeginCloseDC is called to inform the presentation driver that the device context is being closed.

Syntax
BeginCloseDC(ulSubfunction, hdcParam1, pParam2)

Parameters

 * ulSubfunction (ULONG) - input:0Bh.
 * hdcParam1 (HDC) - input:A device context handle.
 * pParam2 (PLONG) - input:A pointer (pInstance) to the DC instance data.

Return Code

 * rc (LONG) - returns:Return codes.
 * The handling routine should return a LONG integer. Valid values are:
 * 0 Successful
 * -1 Error

Remarks
This is the last call made to the driver before it loses access to the graphics engine. Display drivers for the primary display device return Successful without taking any action. For other devices, the handling routine in the presentation driver has to close any resources (such as journal files and bit maps) that it owns.

Hardcopy drivers do not use the BeginCloseDC routine to complete tasks such as writing spool files. The tasks are completed in response to a call to GreEscape DEVESC_ENDDOC. The DEVESC_ENDDOC routine resets the DEVESC_STARTDOC flag in the instance data. The BeginCloseDC routine checks that the flag is reset before taking any action.