GreEscape

The GreEscape handling routine in the presentation driver supports the DevEscape function and its escape codes at the API. While the primary function of GreEscape is to implement the required support for the defined escape codes, it can be used to implement additional escape codes. There is a set of defined ranges for additional escape codes. The range chosen determines how the operating system processes the escape code when it is received as a parameter to DevEscape. On entry to GreEscape, the value of lEscape on the stack identifies the escape code. The action taken is determined by the escape code and the physical device that the presentation driver supports.


 * Support: GreEscape is called by DevEscape. GreEscape with the escape code, DEVESC_QUERYESCSUPPORT, must be supported by all presentation drivers. Hardcopy drivers also support the DEVESC_STARTDOC, DEVESC_ABORTDOC, DEVESC_NEXTFRAME, and DEVESC_ENDDOC escape codes. The other escape codes are optional. See Defined Escape Codes and the individual escape codes that follow.

Syntax
GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction);

Parameters
 ┌───────────────┬───────────────┬──────────────────────────────┐ │Parameter     │Data Type      │Description                   │ ├───────────────┼───────────────┼──────────────────────────────┤ │hdc           │HDC            │Device context handle. │ ├───────────────┼───────────────┼──────────────────────────────┤ │lEscape       │LONG           │Escape code. │ ├───────────────┼───────────────┼──────────────────────────────┤ │cInCount      │LONG           │Number of bytes pointed to by │ │              │               │pInData. │ ├───────────────┼───────────────┼──────────────────────────────┤ │pInData       │PBYTE          │Pointer to input data         │ │              │               │structure. │ ├───────────────┼───────────────┼──────────────────────────────┤ │pcOutCount    │PLONG          │Pointer to the number of bytes│ │              │               │in output data structure. If │ │              │               │the escape code is one that   │ │              │               │returns data in the output    │ │              │               │data structure, the handling  │ │              │               │routine changes the value     │ │              │               │addressed by pcOutCount to    │ │              │               │show the number of bytes      │ │              │               │returned. │ ├───────────────┼───────────────┼──────────────────────────────┤ │pOutData      │PLONG          │Pointer to output data        │ │              │               │structure. │ ├───────────────┼───────────────┼──────────────────────────────┤ │pInstance     │PVOID          │Pointer to instance data. │ ├───────────────┼───────────────┼──────────────────────────────┤ │lFunction     │ULONG          │High-order WORD=flags;        │ │              │               │Low-order WORD=NGreEscape. │ └───────────────┴───────────────┴──────────────────────────────┘ 
 * Stack Frame: On entry to the GreEscape routine, the stack frame contains:

Return Code
The handling routine returns:


 * DEV_OK Successful
 * DEVESC_NOTIMPLEMENTED Escape not implemented for specified code
 * DEVESC_ERROR Error


 * Possible Erros 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_DEV_FUNC_NOT_INSTALLED
 * PMERR_INV_LENGTH_OR_COUNT

Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further information.

Defined Escape Codes
The following list shows the escape codes that have been defined for Presentation Manager and the devices to which they apply. GreEscape returns DEVESC_NOTIMPLEMENTED for escape codes that it does not support.

Ranges from DEV_DBE_FIRST (24450) to DEV_DBE_LAST (24455) are reserved for DBCS support and used by DBCS display driver.  ┌───────────────────────────────┬─────────────────────────────┐ │DEVESC_ABORTDOC               │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_ACQUIREFB              │(software motion video)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_BREAK_EXTRA            │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_CHAR_EXTRA             │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_DBE_FONTMANAGEMENT     │(DBCS support)               │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_DEACQUIREFB            │(software motion video)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_DRAFTMODE              │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_ENDDOC                 │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_EXTGET                 │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_EXTPUT                 │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_EXTQUERY               │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_FLUSHOUTPUT            │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_GETAPERTURE            │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_GETCP                  │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_GETJOBID               │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_GETSCALINGFACTOR       │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_HWREQUEST              │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_NEWFRAME               │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_NEXTBAND               │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_QUERYESCSUPPORT        │(All drivers)                │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_QUERYFB                │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_QUERYVIOCELLSIZES      │(Display drivers only)       │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_RAWDATA                │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_REGISTER               │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_SETMODE                │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_SETUPBLITTERNOTIFY     │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_STARTDOC               │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_STD_JOURNAL            │(Hardcopy drivers only)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_SWITCHBANK             │(software motion video)      │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_VIDEOHIDDEN            │(EnDIVE support)             │ ├───────────────────────────────┼─────────────────────────────┤ │DEVESC_VRAMALLOC              │(EnDIVE support)             │ └───────────────────────────────┴───────────────────────────── 

Ranges for Additional Escape Codes
The following table indicates the defined ranges for additional escape codes and shows how the operating system processes the escape codes when they are received as parameters to DevEscape:  ┌───────────────┬─────────────────────────────────────────────┐ │32768-40959   │Escape is not metafiled or recorded by the   │ │              │spooler. The escape is passed to the        │ │              │presentation driver in all cases. │ ├───────────────┼─────────────────────────────────────────────┤ │40960-49151   │Escape is metafiled but is not recorded by   │ │              │the spooler. For an OD_QUEUED device with   │ │              │PM_Q_STD data and for all device types other │ │              │than OD_METAFILE, the escape is passed to the│ │              │presentation driver. │ ├───────────────┼─────────────────────────────────────────────┤ │49152-57343   │Escape is metafiled and recorded by the      │ │              │spooler. For an OD_METAFILE device or for   │ │              │OD_QUEUED with PM_Q_STD data, the escape is  │ │              │not passed to the presentation driver. │ ├───────────────┼─────────────────────────────────────────────┤ │57344-65535   │Escape is recorded by the spooler. The escape│ │              │is passed to the presentation driver except  │ │              │when the DC is an OD_QUEUED device with      │ │              │PM_Q_STD data. │ └───────────────┴─────────────────────────────────────────────┘ 