SplQmGetJobID

This function returns the spooler print job ID for the spool file handle.

This function allows Presentation drivers (or applications) to get the spooler print job ID while still spooling the job. Currently, only SplQmEndDoc will return the spooler print job ID.

SplQmGetJobID will return an error if called after SplQmEndDoc and before the next SplQmStartDoc because the spool file handle does not reference a spool job after SplQmEndDoc.

Syntax
rc = SplQmGetJobID(hspl, ulLevel, pBuf, cbBuf, pcbNeeded);

Parameters

 * hspl (HSPL) - input
 * Spool file handle returned by SplQmOpen.


 * ulLevel (ULONG) - input
 * Level of job information; currently, level 0 is supported.


 * pBuf (PVOID) - output
 * Buffer to receive job information.

Level 0 will return the QMJOBINFO data structure. See QMJOBINFO in Data Types for details on this data structure.


 * cbBuf (ULONG) - input
 * Length of pBuf, in bytes.


 * pcbNeeded (PULONG) - output
 * Receives length, in bytes, of buffer needed to store job information.

Return Code

 * rc (ULONG) - returns
 * Return codes.

Success Invalid handle given. ulLevel not 0 or invalid parameter given. Part of the information requested was returned, but there was not enough room for all the data. The *pcbOutData parameter contains the size of buffer needed to retrieve all the query response data. This function is not supported by the print server processing the spool job. No information was returned because the output buffer was too small. *pcbOutData contains the size of buffer needed to retrieve all the query response data. No spooler job found.
 * 0
 * ERROR_INVALID_HANDLE(6)
 * ERROR_INVALID_PARAMETER(87)
 * ERROR_MORE_DATA(234)
 * ERROR_NOT_SUPPORTED(50)
 * NERR_BufTooSmall(2123)
 * NERR_JobNotFound(2151)

Example Code

 * 1) define INCL_SPL
 * 2) define INCL_SPLBIDI
 * 3) include 

HSPL     hspl;       /*  Spool file handle returned by SplQmOpen. */ ULONG    ulLevel;    /*  Level of job information; currently, level 0 is supported. */ PVOID    pBuf;       /*  Buffer to receive job information. */ ULONG    cbBuf;      /*  Length of pBuf, in bytes. */ PULONG   pcbNeeded;  /*  Receives length, in bytes, of buffer needed to store job information. */ ULONG    rc;         /*  Return codes. */

rc = SplQmGetJobID(hspl, ulLevel, pBuf, cbBuf,      pcbNeeded);

