3.1.4.14.4 RpcIppSetJobAttributes (Opnum 121)

RpcIppSetJobAttributes sends a set job attributes request to the printer or stores job attribute to the cache if the job is still in the queue and has not been sent to the printer.<406>

 HRESULT
 RpcIppSetJobAttributes(
   [in] PRINTER_HANDLE hPrinter,
   [in] DWORD jobId,
   [in] DWORD jobAttributeGroupBufferSize,
   [in, size_is(jobAttributeGroupBufferSize)] BYTE* jobAttributeGroupBuffer,
   [out, ref] DWORD* ippResponseBufferSize,
   [out, size_is(, *ippResponseBufferSize), ref] BYTE** ippResponseBuffer
 );

hPrinter: A PRINTER_HANDLE (section 2.2.1.1.4) to a printer object that was opened by RpcAddPrinter (section 3.1.4.2.3), RpcAddPrinterEx (section 3.1.4.2.15), RpcOpenPrinter (section 3.1.4.2.2), or RpcOpenPrinterEx (section 3.1.4.2.14).

jobId: The identifier of a print job. This value MUST NOT be zero.

jobAttributeGroupBufferSize: The size, in bytes, of the buffer pointed to by the jobAttributeGroupBuffer parameter.

jobAttributeGroupBuffer: A pointer to a buffer containing serialized IPP attribute group data (see [RFC8010], section 4.2.1).

ippResponseBufferSize: A pointer to a variable that receives the number of bytes in the buffer pointed to by the ippResponseBuffer parameter on a successful return from this call.

ippResponseBuffer: On a successful return from this call, this parameter is a pointer to the buffer containing the serialized IPP response from the printer (see [RFC8010], section 3.1.1) or the response generated by the server in case the job is not yet active, and the attributes have been cached.

Return Values: This method MUST return zero or an HRESULT success value (see [MS-ERREF], section 2.1) to indicate successful completion, or an HRESULT error value to indicate failure.

On receiving this message, the server MUST validate the following:

  • Perform the validation steps that are specified in PRINTER_HANDLE Parameters (section 3.1.4.1.11).

  • Verify that ippResponseBuffer and ippResponseBufferSize parameters are not null.

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

  • Allocate and initialize a buffer with the serialized IPP response to be returned to the client via the ippResponseBuffer parameter.

  • Update the value pointed to by ippResponseBufferSize with the number of bytes allocated for the buffer pointed to by the ippResponseBuffer parameter.

  • Return the status of the operation.

On successful completion of this call, the client SHOULD free the buffer specified by the ippResponseBuffer parameter.