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