RtlInitEmptyUnicodeString function (wdm.h)

The RtlInitEmptyUnicodeString macro initializes an empty counted Unicode string.


void RtlInitEmptyUnicodeString(
  [out] PUNICODE_STRING         UnicodeString,
  [in]  __drv_aliasesMem PWCHAR Buffer,
  [in]  USHORT                  BufferSize


[out] UnicodeString

Pointer to the UNICODE_STRING structure to be initialized.

[in] Buffer

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

[in] BufferSize

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

Return value



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.


Minimum supported client Windows XP
Header wdm.h
IRQL Any level