GET_PRINT_QUEUE: Get Printer Queue Entries

This message obtains a list of the elements currently in the print queue on the server.

Client Request
==================================
Description
=================================
UCHAR WordCount; Count of parameter words = 2
USHORT MaxCount; Max number of entries to return
USHORT StartIndex; First queue entry to return
USHORT ByteCount; Count of data bytes = 0

StartIndex specifies the first entry in the queue to return.

MaxCount specifies the maximum number of entries to return, this may be a positive or negative number. A positive number requests a forward search, a negative number indicates a backward search.

Server Response
==================================
Description
=================================
UCHAR WordCount; Count of parameter words = 2
USHORT Count; Number of entries returned
USHORT RestartIndex; Index of entry after last returned
USHORT ByteCount; Count of data bytes; min = 3
UCHAR BufferFormat; 0x01 -- Data block
USHORT DataLength; Length of data
UCHAR Data[]; Queue elements

Count indicates how many entries were actually returned. RestartIndex is the index of the entry following the last entry returned; it may be used as the StartIndex in a subsequent request to resume the queue listing.

The format of each returned queue element is:

Queue Element Member
================================
Description
===================================
SMB_DATE FileDate; Date file was queued
SMB_TIME FileTime; Time file was queued
UCHAR Status; Entry status. One of:
01 = held or stopped
02 = printing
03 = awaiting print
04 = in intercept
05 = file had error
06 = printer error
07-FF = reserved
USHORT SpoolFileNumber; Assigned by the spooler
ULONG SpoolFileSize; Number of bytes in spool file
UCHAR Reserved;
UCHAR SpoolFileName[16]; Client which created the spool file

SMB_COM_GET_PRINT_QUEUE will return less than the requested number of elements only when the top or end of the queue is encountered.

Support for this SMB is server optional. In particular, no current Microsoft client software issues this request.

Errors

ERRHRD/ERRnotready
ERRHRD/ERRerror
ERRSRV/ERRbaduid