NdisUnicodeStringToAnsiString

NDIS_STATUS
    NdisUnicodeStringToAnsiString(
        IN OUT PNDIS_ANSI_STRING  DestinationString,
        IN PNDIS_STRING  SourceString
        );

NdisUnicodeStringToAnsiString converts a given counted Unicode string into a counted ANSI string. The translation conforms to the current system locale information.

Parameters

DestinationString
Points to a caller-allocated buffer in which this function should return the converted ANSI string.
SourceString
Points to the Unicode string to be converted.

Return Value

NdisUnicodeStringToAnsiString returns NDIS_STATUS_SUCCESS if the conversion succeeds. Otherwise, the contents of the buffer at DestinationString are unaffected.

Comments

The caller must allocate storage for both the source and destination strings and release these buffers as soon as the strings are no longer needed. The buffer at SourceString must be at least twice the size of that at DestinationString.

Callers of NdisUnicodeStringToAnsiString run at IRQL PASSIVE_LEVEL.

See Also

DriverEntry of NDIS Protocol Drivers, MiniportInitialize, NdisAnsiStringToUnicodeString, NdisInitAnsiString, NdisInitializeString, NdisInitUnicodeString, ProtocolBindAdapter