2.2.4.1 Application Advertise Script Record Structure

The first 16-bit word of a record MUST contain the operation code in the low byte and the argument count in the high byte.

Each argument specified MUST be preceded by a 16-bit word that specifies the data type and length of the following argument data. The exact data representation depends upon the type. The maximum length of an argument is 16,383 characters.

The following table specifies the operation code argument format.

Data type

Type and length encoding (16 bits)

Data

Null string (all types)

0x0

Absent.

32-bit signed integer

0x4000

32-bit integer value.

Null argument

0x8000

Absent.

Extended size

0xC000

32-bit type and size information followed by data. If the length of the string or stream is greater than 0x3FFF, the data type value MUST be 0xC000 and is followed by a 32-bit value that includes the length of the data plus the type. The type MUST be in the high-order 2 bits.

The value written is the value obtained from the following formula: (length + DataType<<16), where DataType is string/stream values defined in this table, such as ASCII char string, binary stream, or Unicode string. The maximum length of the string can be (230 – 1).

ASCII char string

0x0 + length of string

Character array. The length of the string does not include the terminating NULL character.

binary stream

0x8000 + byte count

Byte array.

Unicode string

0xC000 + length of Unicode string

Unicode character array. The length of the string does not include the terminating NULL character.