#ifndef _NTRTL_H
/**
* 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). The source string is not necessarily from a multibyte character set.
*
* \param BytesInMultiByteString Pointer to a caller-allocated variable that receives the number of bytes required to store the translated string.
* \param UnicodeString Pointer to the Unicode string for which the multibyte length is to be calculated.
* \param BytesInUnicodeString Length, in bytes, of the source string.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-rtlunicodetomultibytesize
*/
NTSYSAPI
NTSTATUS
NTAPI
RtlUnicodeToMultiByteSize(
_Out_ PULONG BytesInMultiByteString,
_In_reads_bytes_(BytesInUnicodeString) PCWCH UnicodeString,
_In_ ULONG BytesInUnicodeString
);
View code on GitHub
This function is documented in Windows Driver Kit.