RtlUnicodeToMultiByteSize function

The RtlUnicodeToMultiByteSize routine determines the number of bytes that are required to store the multibyte translation for the specified Unicode string. The translation is assumed to use the current system ANSI code page (ACP).

Syntax

NTSYSAPI NTSTATUS RtlUnicodeToMultiByteSize(
  PULONG BytesInMultiByteString,
  PCWCH  UnicodeString,
  ULONG  BytesInUnicodeString
);

Parameters

BytesInMultiByteString

Pointer to a caller-allocated variable that receives the number of bytes required to store the translated string.

UnicodeString

Pointer to the Unicode string for which the multibyte length is to be calculated.

BytesInUnicodeString

Length, in bytes, of the source string.

Return Value

RtlUnicodeToMultiByteSize returns STATUS_SUCCESS.

Remarks

RtlUnicodeToMultiByteSize can be called to determine how much memory to allocate, or possibly the value to specify for MaxBytesInMultiByteString, before translating a Unicode string to ANSI with RtlUnicodeToMultiByteN or RtlUpcaseUnicodeToMultiByteN. The returned value does not include space for a NULL terminator for the ANSI string.

Like RtlUnicodeToMultiByteN, RtlUnicodeToMultiByteSize supports only precomposed Unicode characters that are mapped to the current system ANSI code page installed at system boot.

For information about other string-handling routines, see Strings.

Requirements

   
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL "< DISPATCH_LEVEL"

See Also

RtlMultiByteToUnicodeSize

RtlUnicodeToMultiByteN

RtlUpcaseUnicodeToMultiByteN