RtlCreateUnicodeString function

The RtlCreateUnicodeString routine creates a new counted Unicode string.

Syntax

NTSYSAPI BOOLEAN RtlCreateUnicodeString(
  PUNICODE_STRING DestinationString,
  PCWSTR          SourceString
);

Parameters

DestinationString

Pointer to the newly allocated and initialized Unicode string.

SourceString

Pointer to a null-terminated Unicode string with which to initialize the new string.

Return Value

RtlCreateUnicodeString returns TRUE if the Unicode string was successfully created, FALSE otherwise.

Remarks

The DestinationString is allocated from paged pool. The caller is responsible for freeing the DestinationString by calling RtlFreeUnicodeString.

For information about other string-handling routines, see Strings.

Requirements

   
Windows version This routine is available on Microsoft Windows 2000 and later.
Target Platform Universal
Header ntifs.h (include Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe (kernel mode); Ntdll.dll (user mode)
IRQL PASSIVE_LEVEL

See Also

RtlFreeUnicodeString

UNICODE_STRING