3.2.5.5 NetPrintQGetInfo Command

The Remote Administration Protocol server MUST process the NetPrintQGetInfoRequest as follows:

  1. The server MUST validate that the incoming ParamDesc field of the Remote Administration Protocol request contains the ASCII string "zWrLh"; if it does not, the server SHOULD format a Remote Administration Protocol response with the Win32ErrorCode set to ERROR_INVALID_PARAMETER (0x0057), and then return the response to the client.<72>

  2. The Remote Administration Protocol server MUST respond to NetPrintQGetInfoRequest with a Remote Administration Protocol response message with the RAPOutParams set to the contents of NetPrintQGetInfoResponse.

  3. The server MUST enumerate available printers as described in 3.2.5.4, providing NetPrintQGetInfoRequest.InfoLevel as the information level. The server MUST search for a returned PrintInfo structure where PrintQName is equal to NetPrintQGetInfoRequest.PrintQueueName. If no matching structure is found, the server MUST return the Win32ErrorCode NERR_QNotFound. If a matching structure is found, the server MUST construct a NetPrintQGetInfoResponse using that entry.

  4. If any other errors occur during the response processing, the Remote Administration Protocol server MUST fill in the Win32ErrorCode value in the Remote Administration Protocol response message with the Win32 error code corresponding to the error.

  5. If the input information level is 0x0000, the RAPOutData data field of the Remote Administration Protocol response MUST be filled with a PrintQueue0 structure that represents the named print queue, by using the attributes of the print queue.

    If the input information level is either 0x0001 or 0x0002, the RAPOutData data field of the Remote Administration Protocol response MUST be filled with a PrintQueue1 structure that represents the named print queue, by using the attributes of the print queue. For information level 2, following the PrintQueue1 structure, the server MUST walk PrintQueue.PrintJobList and fill in as many PrintJobInfo1 structures as are represented in the PrintJobCount field in the corresponding PrintQueue1 structure.

    If the input information level is either 0x0003 or 0x0004, the RAPOutData field of the Remote Administration Protocol response MUST be filled with a PrintQueue3 structure, using the attributes of the print queue. For information level 4, following the PrintQueue3 structure, the server MUST walk PrintQueue.PrintJobList and fill in as many PrintJobInfo2 structures as are represented in the PrintJobCount field in the corresponding PrintQueue3 structure.

  6. If the input information level is 0x0005, the RAPOutData field of the Remote Administration Protocol response MUST be filled with a PrintQueue5 structure, using the attributes of the print queue.

  7. If the information level is any value other than 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, or 0x0005, the server implementing NetPrintQGetInfo MUST set the Win32ErrorCode value in the Remote Administration Protocol response message to ERROR_INVALID_LEVEL (0x007C). See sections 2.5.5.2 and 2.5.5.3.

    If any other errors occur during the response processing, the Remote Administration Protocol server MUST fill the Win32ErrorCode value in the Remote Administration Protocol response message with the Win32 error code corresponding to the error, as specified in [MS-ERREF]. Otherwise, the Remote Administration Protocol server MUST set Win32ErrorCode to ERROR_SUCCESS (0X0000).

  8. If the request ReceiveBuffersSize field is less than the response TotalBytesAvailable field, the Remote Administration Protocol server MUST set the Win32ErrorCode value in the Remote Administration Protocol response message to NERR_BufTooSmall (0x084B).