RtlInitUTF8StringEx - NtDoc

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

NTSYSAPI
NTSTATUS
NTAPI
RtlInitUTF8StringEx(
    _Out_ PUTF8_STRING DestinationString,
    _In_opt_z_ __drv_aliasesMem PCSZ SourceString
    );

#endif
#endif

View code on GitHub
// ntifs.h

NTSYSAPI NTSTATUS RtlInitUTF8StringEx(
  PUTF8_STRING          DestinationString,
  __drv_aliasesMem PCSZ SourceString
);
View the official Windows Driver Kit DDI reference
// wdm.h

NTSYSAPI NTSTATUS RtlInitUTF8StringEx(
  PUTF8_STRING          DestinationString,
  __drv_aliasesMem PCSZ SourceString
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit here and here.

Windows Driver Kit DDI reference (nf-ntifs-rtlinitutf8stringex)

RtlInitUTF8StringEx function (ntifs.h)

Description

RtlInitUTF8StringEx initializes a counted string of UTF-8 characters.

Parameters

DestinationString

Pointer to the UTF8_STRING structure to be initialized. The ntdef.h header file defines this structure to be identical to the ANSI_STRING structure.

SourceString

Pointer to a null-terminated character string. SourceString is used to initialize the counted string that DestinationString points to.

Return value

RtlInitUTF8StringEx returns STATUS_NAME_TOO_LONG if the SourceString is too long. Otherwise, this routine returns STATUS_SUCCESS.

Remarks

RtlInitUTF8StringEx sets the members of the UTF8_STRING structure that DestinationString points to as follows:

If SourceString is NULL, Length and MaximumLength are both set to zero.

RtlInitStringEx does not alter the source string pointed to by SourceString.

Callers of RtlInitStringEx can be running at IRQL <= DISPATCH_LEVEL if the DestinationString buffer is nonpageable. Usually, callers run at IRQL = PASSIVE_LEVEL because most other RtlXxxString routines cannot be called at IRQL > PASSIVE_LEVEL.

See also

ANSI_STRING


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

RtlInitUTF8StringEx function (wdm.h)

Description

The RtlInitUTF8StringEx routine initializes a counted string of UTF-8 characters.

Parameters

DestinationString

A pointer to the UTF8_STRING structure to be initialized. The Ntdef.h header file defines this structure to be identical to the STRING structure.

SourceString

A pointer to a null-terminated character string. This string is used to initialize the counted string pointed to by DestinationString.

Return value

Returns STATUS_NAME_TOO_LONG if the SourceString is too long. Otherwise, this routine returns STATUS_SUCCESS.

Remarks

The routine copies the SourceString pointer value to the Buffer member of the UTF8_STRING structure pointed to by DestinationString. The Length member of this structure is set to the length, in bytes, of the source string, excluding the terminating null. The MaximumLength member of the structure is set to the length, in bytes, of the source string, including the terminating null. If SourceString is NULL, Length and MaximumLength are both set to zero.

RtlInitUTF8StringEx does not alter the source string pointed to by SourceString.

Callers of RtlInitUTF8StringEx can be running at IRQL <= DISPATCH_LEVEL if the DestinationString buffer is nonpageable. Usually, callers run at IRQL = PASSIVE_LEVEL because most other RtlXxxString routines cannot be called at IRQL > PASSIVE_LEVEL.

See also

RtlInitAnsiString