The DrvEscape function is used for retrieving information from a device that is not available in a device-independent device driver interface; the particular query depends on the value of the iEsc parameter.
ULONG
DrvEscape(
IN SURFOBJ *pso,
IN ULONG iEsc,
IN ULONG cjIn,
IN PVOID pvIn,
IN ULONG cjOut,
OUT PVOID pvOut
);
The return value is dependent on the query specified by the iEsc parameter. If the function specified in the query is not supported, the return value is zero.
Declared in winddi.h. Include winddi.h.
Drawing on the device is not allowed in this function. DrvDrawEscape is to be used for specialized drawing support.
GDI passes data directly from a (possibly malicious) client application to the driver, which means that the DrvEscape function must validate all input arguments. Specifically, this function must:
Microsoft reserves the range 0 to 0X10000 for its escape codes. Third-party vendors are free to choose escape codes for their own use above this range. Since driver-specific escape codes may conflict with those used in other display drivers, it is important for a display driver to validate escape parameters before processing the escape. One way to do this would be to validate the input and output block sizes and the input block parameters. For added security, drivers should also include a "magic" value which must be set appropriately in every input block to ensure that the input block is from a trusted source.
DrvEscape is optional for all drivers.