CompleteOpenDC

OS2_PM_DRV_ENABLE: CompleteOpenDC is called upon completion of the DevOpenDC process to tell the presentation driver that the device context now has access to the graphics engine.

Syntax
CompleteOpenDC(ulSubfunction, hdcParam1, pParam2)

Parameters

 * ulSubfunction (ULONG) - input:0AH.
 * 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
Presentation drivers for the primary display device return Successful without taking any action. For other devices, the handling routine in the presentation driver completes the initialization process for any resources, such as bit maps, that are obtained through calls to the graphics engine.

Hardcopy drivers do not use the CompleteOpenDC routine to open resources such as spool files or journal files. If these resources are required, they are opened in response to a call to GreEscape DEVESC_STARTDOC. Such drivers set a flag in the instance data to show that DEVESC_STARTDOC has been received, and do not process any output until that flag has been set.


 * Note: The presentation driver locks and unlocks resources such as bit maps and device contexts to prevent simultaneous use of the resource by two threads belonging to the same process. Typically, this is done by setting a semaphore or some other form of BUSY flag for the resource.