RtlInitEmptyAnsiString - NtDoc

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

//
// Strings
//

_At_(AnsiString->Buffer, _Post_equal_to_(Buffer))
_At_(AnsiString->Length, _Post_equal_to_(0))
_At_(AnsiString->MaximumLength, _Post_equal_to_(MaximumLength))
FORCEINLINE
VOID
NTAPI_INLINE
RtlInitEmptyAnsiString(
    _Out_ PANSI_STRING AnsiString,
    _Pre_maybenull_ _Pre_readable_size_(MaximumLength) __drv_aliasesMem PCHAR Buffer,
    _In_ USHORT MaximumLength
    )
{
    memset(AnsiString, 0, sizeof(ANSI_STRING));
    AnsiString->MaximumLength = MaximumLength;
    AnsiString->Buffer = Buffer;
}

#endif

View code on GitHub
// wdm.h

VOID RtlInitEmptyAnsiString(
  [out] PANSI_STRING           AnsiString,
  [in]  __drv_aliasesMem PCHAR 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-rtlinitemptyansistring)

Description

The RtlInitEmptyAnsiString macro initializes an empty counted ANSI string.

Parameters

AnsiString [out]

Pointer to the ANSI_STRING structure to be initialized.

Buffer [in]

Pointer to a caller-allocated buffer to be used to contain an ANSI string composed of CHAR elements.

BufferSize [in]

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

Remarks

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

To initialize a non-empty counted ANSI string, call RtlInitAnsiString.