3.1.4.14.5 RpcIppGetPrinterAttributes (Opnum 122)
RpcIppGetPrinterAttributes requests IPP printer attributes from the printer.<407>
-
HRESULT RpcIppGetPrinterAttributes( [in] PRINTER_HANDLE hPrinter, [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).
attributeNameCount: The number of elements in the array pointed to by attributeNames parameter.
attributeNames: An 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).
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.