00084 :
00085
00086 The
RtlInitUnicodeString function initializes an NT counted
00087 unicode string. The DestinationString
is initialized to point to
00088
the SourceString and
the Length and MaximumLength fields of
00089 DestinationString are initialized to
the length of
the SourceString,
00090 which
is zero
if SourceString is not specified.
00091
00092 Arguments:
00093
00094 DestinationString - Pointer to
the counted string to initialize
00095
00096
SourceString - Optional pointer to a null terminated unicode string that
00097
the counted string
is to point to.
00098
00099
00100 Return Value:
00101
00102 None.
00103
00104 --*/
00105
00106 {
00107
USHORT Length = 0;
00108 DestinationString->Length = 0;
00109 DestinationString->Buffer =
SourceString;
00110
if (ARGUMENT_PRESENT( SourceString )) {
00111
while (*
SourceString++) {
00112 Length +=
sizeof(*SourceString);
00113 }
00114
00115 DestinationString->Length = Length;
00116
00117 DestinationString->MaximumLength = Length+(
USHORT)
sizeof(UNICODE_NULL);
00118 }
00119
else {
00120 DestinationString->MaximumLength = 0;
00121 }
00122 }
}