#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;
}
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 referenceThis function is documented in Windows Driver Kit.
The RtlInitEmptyAnsiString macro initializes an empty counted ANSI string.
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.
The members of the structure that the _DestinationString_ parameter points to are initialized as follows.
Length. Zero.
MaximumLength. _BufferSize_.
Buffer. _SourceString_.
To initialize a non-empty counted ANSI string, call RtlInitAnsiString.