共用方式為


3.1.4.14.6 RpcIppSetPrinterAttributes (Opnum 123)

RpcIppSetPrinterAttributes sends a set printer attributes request to the printer.<408>

 HRESULT
 RpcIppSetPrinterAttributes(
     [in] PRINTER_HANDLE hPrinter,
     [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).

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

jobAttributeGroupBuffer: A pointer to a buffer containing a serialized IPP attribute group (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).

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.