3.1.4.14.3 RpcIppGetJobAttributes (Opnum 120)

RpcIppGetJobAttributes requests IPP job attributes from the printer or job attribute cache if the job has not been sent to the printer. <405> See [RFC8011], section 4.3.4.

 HRESULT
 RpcIppGetJobAttributes(
   [in] PRINTER_HANDLE hPrinter,
   [in] DWORD jobId,
   [in] DWORD attributeNameCount,
   [in, string, size_is(attributeNameCount)] const wchar_t** attributeNames,
   [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.

attributeNameCount: The number of elements in the array pointed to by attributeNames parameter.

attributeNames: Array of pointers to null-terminated strings of 16-bit Unicode characters representing the attribute names requested.

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 read from the cache.

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.