RtlUnicodeToMultiByteSize routine

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


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

Parameters

BytesInMultiByteString [out]

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

UnicodeString [in]

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

BytesInUnicodeString [in]

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

 

 

Send comments about this topic to Microsoft

Show: