RtlMultiByteToUnicodeSize function

The RtlMultiByteToUnicodeSize routine determines the number of bytes that are required to store the Unicode translation for the specified source string. The translation is assumed to use the current system ANSI code page (ACP). The source string is not necessarily from a multibyte character set.

Syntax

NTSYSAPI NTSTATUS RtlMultiByteToUnicodeSize(
  PULONG     BytesInUnicodeString,
  const CHAR *MultiByteString,
  ULONG      BytesInMultiByteString
);

Parameters

BytesInUnicodeString

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

MultiByteString

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

BytesInMultiByteString

Length, in bytes, of the source string.

Return Value

RtlMultiByteToUnicodeSize returns STATUS_SUCCESS.

Remarks

RtlMultiByteToUnicodeSize can be called to determine how much memory to allocate, or possibly, the value to specify for MaxBytesInUnicodeString, before translating a multibyte string into Unicode with RtlMultiByteToUnicodeN. The returned value does not include space for a NULL terminator for the Unicode string.

Like RtlMultiByteToUnicodeN, RtlMultiByteToUnicodeSize 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

RtlMultiByteToUnicodeN

RtlUnicodeToMultiByteSize