Jump to content

DevPostEscape

From EDM2
Revision as of 03:22, 25 April 2025 by Martini (talk | contribs)

This is an exported entry point in the .DEF file (OS2_PM_DRV_POSTESCAPE @206).

Syntax

DevPostEscape(pszDriverName, pszDeviceName, pszQueueName, pszSplPrinterName, 
              ulFuncNum, cbParm1, pbParm1, cbParm2, pbParm2)

Parameters

pszDriverName (PCSZ) - input
pszDeviceName (PCSZ) - input
pszQueueName (PCSZ) - input
pszSplPrinterName (PCSZ) - input
ulFuncNum (ULONG) - input
cbParm1 (ULONG) - input
pbParm1 (PBYTE) - input
cbParm2 (ULONG) - input
pbParm2 (PBYTE) - input

Remarks

The major difference between DevEscapes and DevPostEscapes is that DevEscape uses an already opened device context handle (HDC), and printer property information is already "hardcoded" at DevOpenDC time. If another device's job properties are passed in, or if another queue's job properties is used with different printer property information, misleading information will be returned.

To overcome this limitation with DevEscape, DevPostEscape passes in four strings with all the information required to find both the printer and job property data. However, DevPostEscape also has a limitation: DevPostEscape behaves like DevPostDeviceModes() in that it loads and unloads the printer driver for each call to DevPostEscape. When DevPostEscape is used before a DevOpenDC() is issued against a specified printer driver, the number of opened instances against the printer driver is 0 (after DevOpenDC, the number will be at least 2 or more). When the number of references is 0, the printer driver will behave as if it is being called for the first time and will load all of its global resources, such as string tables and device data structures. This process can be time consuming, and, if DevPostEscape is called a number of times before DevOpenDC, performance will suffer.