4.7 UNICODE_STRING Representation

The following structure uses expression in both conformance and varying description.

 typedef struct _UNICODE_STRING {
 unsigned short Length;
 unsigned short MaximumLength;
 [size_is(MaximumLength/2),length_is(Length/2)] 
    unsigned short * pString;
 } 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

Length

MaximumLength

Pointer Identifier

Maximum Count = MaximumLength/2

Offset (0)

Actual Count = Length/2

Representation of first element

continued

continued

continued

continued

Representation of last element

In this example, in the conformant varying array referred by pString, the maximum count is what the expression (MaximumLength/2) evaluates to, and the actual count is what the expression (Length/2) evaluates to.

In the target level 5.0 data consistency check, the implementation validates that the maximum count of the conformant varying array referred by pString is equal to the evaluation result of the expression (MaximumLength/2), and the actual count is equal to the evaluation result of the expression (Length/2).