Subsequent calls to DosSetCp do not alter the code page of an existing DC. Default VIO and KBD code pages are always in the last code page set by any application process.
When this function is called for the first time, the graphics engine performs the following sequence:
DosLoadModule("NEWDRIVER", &hDriver) /****************************************************/ /* Load the presentation driver DLL file. */ /****************************************************/ DosGetProcAddr(hDriver, "OS2_PM_DRV_ENABLE", &Enable) /****************************************************/ /* Find the presentation driver's Enable function. */ /* See OS2_PM_DRV_ENABLE. */ /****************************************************/ *Enable(FillLogicalDeviceBlock, &DispatchTable) /****************************************************/ /* The presentation driver must: */ /* Save the addresses of the engine simulations */ /* Overwrite the dispatch table, as necessary */ /* Hook the ExitList for the calling process */ /****************************************************/ hPhysDev=*Enable(FillPhysicalDeviceBlock, pDevOpenStructure) /****************************************************/ /* Create the physical device block. */ /****************************************************/ pInstance=*Enable(EnableDeviceContext, hdc, Type, hPhysDev) /****************************************************/ /* The presentation driver must create an instance */ /* data structure for the DC. */ /****************************************************/ *Enable(CompleteOpenDC, hdc, pInstance) /****************************************************/ /* The presentation driver must inform the system */ /* that the DC is open and ready to receive output. */ /****************************************************/
For subsequent calls to GreOpenDC for the same DC, the graphics engine calls Enable (EnableDeviceContext) to create a new instance for the DC and then calls Enable (CompleteOpenDC). When GreOpenDC is called for the same DC by a different process, the graphics engine calls DosLoadModule to load the presentation driver. It then calls Enable (FillLogicalDeviceBlock), Enable (EnableDeviceContext), and Enable (CompleteOpenDC).