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( SURFOBJ *pso, ULONG iEsc, ULONG cjIn, PVOID pvIn, ULONG cjOut, PVOID pvOut );
Pointer to a SURFOBJ structure that describes the surface to which the call is directed.
Specifies a query. The meaning of the other parameters depends on this value. QUERYESCSUPPORT is the only predefined value; it queries whether the driver supports a particular escape function. In this case, pvIn points to an escape function number; cjOut and pvOut are ignored. If the specified function is supported, the return value is nonzero.
Specifies the size, in bytes, of the buffer pointed to by pvIn.
Pointer to the input data for the call. The format of the input data depends on the query specified by the iEscparameter.
Specifies the size, in bytes, of the buffer pointed to by pvOut.
Pointer to the output buffer. The format of the output data depends on the query specified by the iEsc parameter.
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.
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:
- Verify that the value received in the iEsc parameter represents a valid query.
- Verify that the size of the input buffer (the value in the cjIn parameter) is valid for the specified query.
- Verify that the contents of the buffer pointed to by the pvIn parameter are valid for the specified query.
- Verify that the size of the specified output buffer (the value in the cjOut parameter) is valid for the specified query.
DrvEscape is optional for all drivers.
|Header||winddi.h (include Winddi.h)|