2.2.2.1 Client Device List Announce Request (DR_PRN_DEVICE_ANNOUNCE)

This message is specified in [MS-RDPEFS] section 2.2.2.9 (Client Device List Announce Request). For each redirected printer, a DEVICE_ANNOUNCE header (as specified in [MS-RDPEFS] section 2.2.1.3) is generated by the client printer redirection extension followed by variable printer-specific data.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

DeviceType

DeviceId

PreferredDosName

...

DeviceDataLength

Flags

CodePage

PnPNameLen

DriverNameLen

PrintNameLen

CachedFieldsLen

PnPName (variable)

...

DriverName (variable)

...

PrinterName (variable)

...

CachedPrinterConfigData (variable)

...

DeviceType (4 bytes): This field is defined in [MS-RDPEFS] section 2.2.1.3. This field MUST be set to RDPDR_DTYP_PRINT.

DeviceId (4 bytes): This field is defined in [MS-RDPEFS] section 2.2.1.3. The DeviceId field MUST be set to the unique device ID to identify this printer device. This field is later used to refer to the same printer device by both the client and the server.

PreferredDosName (8 bytes): This field is defined in [MS-RDPEFS] section 2.2.1.3. The PreferredDosName field MUST be set to the port name on which the printer is installed. The first 3 characters MUST be "PRN" and the remainder MUST be digits.

DeviceDataLength (4 bytes): This field is defined in [MS-RDPEFS] section 2.2.1.3. The DeviceDataLength field MUST be set to the length of data fields following the DeviceDataLength field.

Flags (4 bytes): A 32-bit unsigned integer that indicates the properties of the client printer queue. This bit field MUST be a valid combination of any of the following values.

Value

Meaning

RDPDR_PRINTER_ANNOUNCE_FLAG_ASCII

0x00000001

The DriverName field MUST be in ASCII characters. If not set, it MUST be in Unicode.

RDPDR_PRINTER_ANNOUNCE_FLAG_DEFAULTPRINTER

0x00000002

The printer is set as default. There MUST be only one printer with this flag set.

RDPDR_PRINTER_ANNOUNCE_FLAG_NETWORKPRINTER

0x00000004

This printer is from the network.

RDPDR_PRINTER_ANNOUNCE_FLAG_TSPRINTER

0x00000008

This flag is set when the printer to be redirected is not a local or network printer but is a terminal server client printer. This can happen in nested TS sessions; that is, this can happen when a TS connection is made from within a TS session.

RDPDR_PRINTER_ANNOUNCE_FLAG_XPSFORMAT

0x00000010

This client/printer supports XML Paper Specification (XPS) format (section 3.1.1.2).

CodePage (4 bytes): A 32-bit unsigned integer. Reserved for future use. This field MUST be set to 0.

PnPNameLen (4 bytes):  A 32-bit unsigned integer that specifies the number of bytes in the PnPName field, including its null terminator.

DriverNameLen (4 bytes): A 32-bit unsigned integer that specifies the number of bytes in the DriverName field, including its null terminator.

PrintNameLen (4 bytes): A 32-bit unsigned integer that specifies the number of bytes in the PrintName field, including its null terminator.

CachedFieldsLen (4 bytes): A 32-bit unsigned integer that specifies the number of bytes in the CachedPrinterConfigData field.

PnPName (variable): A null-terminated Unicode string. This field can be set to any valid Unicode string and MUST be ignored on receipt.

DriverName (variable):  An array of characters. The type of characters is determined by the RDPDR_PRINTER_ANNOUNCE_FLAG_ASCII flag. If the flag is set, the DriverName field MUST be a null-terminated ASCII string; otherwise, it MUST be a null-terminated Unicode string. The DriverName field specifies the driver name used by the client for this printer. This name is used by the terminal server to determine the appropriate matching driver for the redirected printer, which is to be used on the server.<1>

PrinterName (variable): The PrinterName field is a null-terminated Unicode string. The client MUST specify the user-assigned printer name of the local printer in this field. This name is used by the server to generate the server-side redirected printer queue.

CachedPrinterConfigData (variable): A variable-length array of bytes. This field is a binary large object (BLOB) of data that describes the cached printer configuration (see section 3.1.1.1).