Previous Next

NdisInitializeString

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

VOID
  NdisInitializeString(
    IN OUT PNDIS_STRING  DestinationString,
    IN PUCHAR  SourceString
    );

Parameters

DestinationString
Specifies NULL when NdisInitializeString is called; on return from this function, points to an NDIS_STRING type that describes an initialized counted string. For Windows 2000 and later, NDIS defines the NDIS_STRING type as a UNICODE_STRING type.
SourceString
Pointer to a zero-terminated string with which to initialize the counted string.

Headers

Declared in Ndis.h. Include Ndis.h.

Comments

NdisInitializeString sets the Length and MaximumLength members of NDIS_STRING for the destination string and terminates the destination string with zero. For Windows 2000 and later drivers, NdisInitializeString converts the supplied source string to Unicode characters.

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

The buffer allocated by NdisInitializeString should be released with NdisFreeString.

Callers of NdisInitializeString run at IRQL = PASSIVE_LEVEL.

See Also

ANSI_STRING, DriverEntry of NDIS Protocol Drivers, MiniportInitialize, NdisAnsiStringToUnicodeString, NdisEqualString, NdisFreeString, NdisInitAnsiString, NdisInitUnicodeString, NdisUnicodeStringToAnsiString, UNICODE_STRING