RpcGetJob (Opnum 3)

RpcGetJob retrieves information about a specified print job.

 DWORD RpcGetJob(
   [in] PRINTER_HANDLE hPrinter,
   [in] DWORD JobId,
   [in] DWORD Level,
   [in, out, unique, size_is(cbBuf), disable_consistency_check] 
     BYTE* pJob,
   [in] DWORD cbBuf,
   [out] DWORD* pcbNeeded

hPrinter: A handle to a printer object, job object, or server object that was opened by RpcAddPrinter (section, RpcAddPrinterEx (section, RpcOpenPrinter (section, or RpcOpenPrinterEx (section

JobId: The identifier of the print job. This value MUST NOT be zero.

Level: The job information level. This value MUST be 0x00000001, 0x00000002, 0x00000003, or 0x00000004.

pJob: A pointer to BUFFER as specified in INFO Structures Query Parameters (section


This parameter can be NULL if cbBuf equals zero.

cbBuf: A parameter specified in section

pcbNeeded: A parameter specified in section

Return Values: This method MUST return zero (ERROR_SUCCESS) to indicate successful completion or a nonzero Windows error code to indicate failure, as specified in [MS-ERREF].

Upon receiving this message, the server MUST validate parameters as follows:

  • Perform the validation steps specified in PRINTER_HANDLE Parameters (section This method SHOULD assume that the handle to the printer or server object can be used without further access checks.

  • Verify that the value of the JobId parameter corresponds to a job in the list of jobs. If this verification fails, return ERROR_INVALID_PARAMETER.

  • Perform the validation steps that are specified in section

If parameter validation fails, the server MUST fail the operation immediately and return a nonzero error response to the client. Otherwise, the server MUST process the message and compose a response to the client as follows:

  • Using information about the job, perform the processing and response steps specified in section

  • Return the status of the operation.