This function allocates storage for and initializes a counted string in the system-default character set.

VOID NdisInitializeString(
  PNDIS_STRING DestinationString,
  PUCHAR SourceString


  • DestinationString
    [in, out] Specifies NULL when this function is called; on return from this function, points to a buffer containing an initialized counted string.
  • SourceString
    [in] Pointer to a 0-terminated string with which to initialize the counted string.

Return Values



This function sets the Length and MaximumLength for the destination string and terminates the destination string with 0.

If SourceString is NULL, the lengths are set to 0.

The buffer allocated by this function should be released promptly with the NdisFreeString function.


OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.

See Also

NdisAnsiStringToUnicodeString | NdisEqualString | NdisFreeString | NdisInitAnsiString | NdisInitUnicodeString | NdisUnicodeStringToAnsiString

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.