Jump to content

DEVESC_ENDDOC

From EDM2
Revision as of 23:26, 11 July 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:DEVESC_ENDDOC}} GreEscape DEVESC_ENDDOC ends the current document. ;Simulation support: This function is mandatory for hardcopy drivers and must be implemented in order to have a valid OS/2 hardcopy driver. For other drivers, it is simulated by a handling routine in the graphics engine. ==Syntax== GreEscape(hdc, lEscape, cInCount, pInData, pcOutCount, pOutData, pInstance, lFunction); ==Parameters== ;''hdc'' (HDC) - input: Device context handle. ;'...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GreEscape DEVESC_ENDDOC ends the current document.

Simulation support
This function is mandatory for hardcopy drivers and must be implemented in order to have a valid OS/2 hardcopy driver. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

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

Parameters

hdc (HDC) - input
Device context handle.
lEscape (LONG) - input
DEVESC_ENDDOC escape code.
cInCount (LONG) - input
The handling routine ignores this parameter.
pInData (PBYTE) - input
The handling routine ignores this parameter.
pcOutCount (PLONG) - input
Pointer to size parameter. On input, this parameter specifies the size of the buffer pointed to by pOutData. On output, it is set to the number of data bytes returned in this buffer. The input value of this parameter is usually 2. On completion, this is set to 0 if no ID is returned in pOutData.
pOutData (PLONG) - input
Pointer to data area. Pointer to a data area in which the Job ID of the spooled print job is returned. Set to NULL if there is no Job ID, for example, when the hardcopy DC is OD_DIRECT.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreEscape.

Returns

rc (LONG) - returns
Return Code.
The handling routine returns:
DEV_OK
Successful
DEVESC_NOTIMPLEMENTED
Escape not implemented for specified code
DEVESC_ERROR
Error

Remarks

The handling routine does whatever work is required to complete the job. For example, a DC for an OD_QUEUED device with PM_Q_STD data would close the spooler buffer and transfer the buffered data to a spool file. As with DEVESC_STARTDOC, do not assume that this escape code is always issued at the end of a document. When it has not been issued, the DEVESC_ENDDOC work must be done in the BeginCloseDC or CloseDC routine.

Note: DEVESC_ENDDOC is mandatory at the API when writing PM_Q_STD data to an OD_QUEUED device.

This escape code is metafiled but not recorded.

Source Code Sample

Declaration:

#define INCL_GRE_DEVICE
#include <os2.h>

HDC      hdc;         /* Device context handle. */
LONG     lEscape;     /* DEVESC_ENDDOC escape code. */
LONG     cInCount;    /* The handling routine ignores this parameter. */
PBYTE    pInData;     /* The handling routine ignores this parameter. */
PLONG    pcOutCount;  /* Pointer to size parameter. */
PLONG    pOutData;    /* Pointer to data area. */
PVOID    pInstance;   /* Pointer to instance data. */
ULONG    lFunction;   /* High-order WORD=flags; low-order WORD=NGreEscape. */
LONG     rc;          /* Return Code. */

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