RtlInitEmptyUnicodeString - NtDoc

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

_At_(DestinationString->Buffer, _Post_equal_to_(Buffer))
_At_(DestinationString->Length, _Post_equal_to_(0))
_At_(DestinationString->MaximumLength, _Post_equal_to_(MaximumLength))
FORCEINLINE
VOID
NTAPI_INLINE
RtlInitEmptyUnicodeString(
    _Out_ PUNICODE_STRING DestinationString,
    _Writable_bytes_(MaximumLength) _When_(MaximumLength != 0, _Notnull_) __drv_aliasesMem PWCHAR Buffer,
    _In_ USHORT MaximumLength
    )
{
    memset(DestinationString, 0, sizeof(UNICODE_STRING));
    DestinationString->MaximumLength = MaximumLength;
    DestinationString->Buffer = Buffer;
}

#endif

View code on GitHub
// wdm.h

VOID RtlInitEmptyUnicodeString(
  [out] PUNICODE_STRING         UnicodeString,
  [in]  __drv_aliasesMem PWCHAR Buffer,
  [in]  USHORT                  BufferSize
);
View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

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

Description

The RtlInitEmptyUnicodeString macro initializes an empty counted Unicode string.

Parameters

UnicodeString [out]

Pointer to the UNICODE_STRING structure to be initialized.

Buffer [in]

Pointer to a caller-allocated buffer to be used to contain a WCHAR string.

BufferSize [in]

Length, in bytes, of the buffer that _Buffer_ points to.

Remarks

The members of the structure that the _DestinationString_ parameters points to are initialized as follows.

To initialize a non-empty counted Unicode string, call RtlInitUnicodeString.