2.2.11 RPC_UNICODE_STRING

EventLog Remoting Protocol APIs use the RPC_UNICODE_STRING structure to specify a Unicode string parameter.

 typedef struct {
   unsigned short Length;
   unsigned short MaximumLength;
   [size_is(MaximumLength/2), length_is(Length / 2)] 
     WCHAR* Buffer;
 } RPC_UNICODE_STRING,
  *PRPC_UNICODE_STRING;

Length: The length, in bytes, of the string pointed to by the Buffer member, not including the terminating null character, if any. The length MUST be a multiple of 2. The length SHOULD equal the entire size of the Buffer, in which case there is no terminating null character. Any method that accesses this structure MUST use the Length that is specified, instead of relying on the presence or absence of a null character.

MaximumLength: The maximum size, in bytes, of the string pointed to by Buffer. The size MUST be a multiple of 2. If not, the size MUST be decremented by 1 prior to use. This value MUST not be less than Length.

Buffer: A pointer to a string buffer. If MaximumLength is greater than zero, the buffer MUST contain a non-null value.