Export (0) Print
Expand All
Expand Minimize

RtlUnicodeStringToAnsiString routine

The RtlUnicodeStringToAnsiString routine converts a given Unicode string into an ANSI string.

Syntax


NTSTATUS RtlUnicodeStringToAnsiString(
  _Inout_  PANSI_STRING DestinationString,
  _In_     PCUNICODE_STRING SourceString,
  _In_     BOOLEAN AllocateDestinationString
);

Parameters

DestinationString [in, out]

Pointer to an ANSI_STRING structure to hold the converted ANSI string. If AllocateDestinationString is TRUE, the routine allocates a new buffer to hold the string data, and updates the Buffer member of DestinationString to point to the new buffer. Otherwise, the routine uses the currently specified buffer to hold the string.

SourceString [in]

Pointer to the Unicode source string to be converted to ANSI.

AllocateDestinationString [in]

TRUE if this routine is to allocate the buffer space for the DestinationString. If it does, the buffer must be deallocated by calling RtlFreeAnsiString.

Return value

If the conversion succeeds, RtlUnicodeStringToAnsiString returns STATUS_SUCCESS. Otherwise, no storage was allocated, and no conversion was done.

Remarks

The translation is done in accord with the current system-locale information.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

See also

ANSI_STRING
UNICODE_STRING
RtlAnsiStringToUnicodeString
RtlFreeAnsiString

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft