Jump to content

SplQmGetJobID

From EDM2

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.
  • 0 Success
  • ERROR_INVALID_HANDLE(6) Invalid handle given.
  • ERROR_INVALID_PARAMETER(87) ulLevel not 0 or invalid parameter given.
  • ERROR_MORE_DATA(234) 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.
  • ERROR_NOT_SUPPORTED(50) This function is not supported by the print server processing the spool job.
  • NERR_BufTooSmall(2123) 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.
  • NERR_JobNotFound(2151) No spooler job found.

Example Code

#define INCL_SPL
#define INCL_SPLBIDI
#include <os2.h>

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);