RtlAnsiStringToUnicodeSize - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

// NTSYSAPI
// ULONG
// NTAPI
// RtlAnsiStringToUnicodeSize(
//     _In_ PCANSI_STRING AnsiString
//     );

#define RtlAnsiStringToUnicodeSize(STRING) \
    RtlxAnsiStringToUnicodeSize(STRING)

#endif

View code on GitHub
// wdm.h

//
//  NTSYSAPI
//  ULONG
//  NTAPI
//  RtlAnsiStringToUnicodeSize(
//      PANSI_STRING AnsiString
//      );
//

#define RtlAnsiStringToUnicodeSize(STRING) (                 \
    RtlxAnsiStringToUnicodeSize(STRING)                      \
)

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-rtlansistringtounicodesize)

RtlAnsiStringToUnicodeSize macro

Description

The RtlAnsiStringToUnicodeSize routine returns the number of bytes required to hold an ANSI string converted into a Unicode string.

Parameters

STRING [in]

Pointer to a buffer containing the ANSI string.

Syntax

//
//  NTSYSAPI
//  ULONG
//  NTAPI
//  RtlAnsiStringToUnicodeSize(
//      PANSI_STRING AnsiString
//      );
//

#define RtlAnsiStringToUnicodeSize(STRING) (                 \
    RtlxAnsiStringToUnicodeSize(STRING)                      \
)

Remarks

RtlAnsiStringToUnicodeSize returns a ULONG value containing the number of bytes required to hold an ANSI string converted into a Unicode string.

Casting the return value of the RtlAnsiStringToUnicodeSize routine to USHORT might cause a loss of data. To avoid potential problems, callers of this routine should test the return value for arithmetic overflow. Note that RtlAnsiStringToUnicodeSize accounts for the trailing NULL.

Callers of RtlAnsiStringToUnicodeSize must be running at IRQL = PASSIVE_LEVEL.

See also

RtlAnsiStringToUnicodeString

RtlxAnsiStringToUnicodeSize