DevQueryPrintEx

BOOL DevQueryPrintEx(

    PDEVQUERYPRINT_INFO pDQPInfo

   );

DevQueryPrintEx determines whether or not the driver can print the specified job on a printer.

Parameters

pDQPInfo
Pointer to the DEVQUERYPRINT_INFO structure that contains the data required to do the query.

Return Value

DevQueryPrintEx returns TRUE if the job is printable and not to be held; otherwise, it returns FALSE.

Comments

The spooler calls DevQueryPrintEx when a print job is scheduled to print or when the Hold Mismatched Documents option is checked on the printer’s Scheduling property sheet page in the Printers folder.

The driver should always validate the pDevMode field of the DEVQUERYPRINT_INFO structure before performing the query.

If the job is determined to be printable, the driver need not return an error string.

If the job is not printable, the driver should return the applicable error string and its length in pszErrorStr and cchNeeded, respectively. If the buffer to which pszErrorStr points is too small to hold the entire error string, the driver should truncate the error string to be cchErrorStr characters in length, including the null terminator. Regardless of whether the string is truncated, the driver should always return the length of the original error string in cchNeeded. The driver should define resource error strings for possible error conditions, such as memory allocation failure or the inability to open a printer’s data file.

DevQueryPrintEx must be implemented.