2.2.2 Unicode String (UNICODE_STRING)

The Unicode String (UNICODE_STRING) packet is used to pack a variable-length Unicode string.


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

cchString

String (variable)

...

cchString (2 bytes): A 16-bit, unsigned integer that specifies the number of Unicode characters in the String field. The size of each Unicode character is 2 bytes. The value of cchString MUST NOT exceed 1,024. If cchString is set to 0, then the String field MUST NOT be present.

String (variable): An array of Unicode characters, equal in length to the value of cchString field. The variable-length Unicode string comprises the first n Unicode characters in the String field, where n is the lesser of the value of the cchString field and the number of characters preceding the first null in the array.