NdisInitializeString function

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

Syntax

void NdisInitializeString(
  PNDIS_STRING Destination,
  PUCHAR       Source
);

Parameters

Destination

A pointer that is NULL when NdisInitializeString is called; on return from this function, this parameter 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.

Source

A pointer to a null-terminated string with which to initialize the counted string. SourceString must not be NULL.

Return Value

None

Remarks

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.

SourceString must not be NULL.

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

Requirements

   
Minimum supported client Supported for existing drivers in NDIS 6.0 and later, but new drivers should use RtlInitUnicodeString or RTL_CONSTANT_STRING or DECLARE_CONST_UNICODE_STRING (see ntdef.h) instead.
Target Platform Universal
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL PASSIVE_LEVEL
DDI compliance rules Irql_Miscellaneous_Function

See Also

ANSI_STRING

DriverEntry of NDIS Protocol Drivers

MiniportInitializeEx

RtlAnsiStringToUnicodeString

RtlEqualUnicodeString

RtlFreeAnsiString

RtlFreeUnicodeString

RtlInitString

RtlInitUnicodeString

RtlUnicodeStringToAnsiString

UNICODE_STRING