#ifndef _NTRTL_H
#ifndef PHNT_NO_INLINE_INIT_STRING
FORCEINLINE
VOID
NTAPI_INLINE
RtlInitUnicodeString(
_Out_ PUNICODE_STRING DestinationString,
_In_opt_z_ PCWSTR SourceString
)
{
if (SourceString)
DestinationString->MaximumLength = (DestinationString->Length = (USHORT)(wcslen(SourceString) * sizeof(WCHAR))) + sizeof(UNICODE_NULL);
else
DestinationString->MaximumLength = DestinationString->Length = 0;
DestinationString->Buffer = (PWCH)SourceString;
}
View code on GitHub
#ifndef _NTRTL_H
#ifndef PHNT_NO_INLINE_INIT_STRING
// ...
#else
NTSYSAPI
VOID
NTAPI
RtlInitUnicodeString(
_Out_ PUNICODE_STRING DestinationString,
_In_opt_z_ PCWSTR SourceString
);
View code on GitHub
// wdm.h
NTSYSAPI VOID RtlInitUnicodeString(
[out] PUNICODE_STRING DestinationString,
[in, optional] __drv_aliasesMem PCWSTR SourceString
);
View the official Windows Driver Kit DDI reference
// winternl.h
VOID RtlInitUnicodeString(
[in, out] PUNICODE_STRING DestinationString,
[in, optional] PCWSTR SourceString
);
View the official Win32 API reference
This function is documented in Windows Driver Kit.
For more information, see the WdmlibRtlInitUnicodeStringEx function.
DestinationString
[out]For more information, see the WdmlibRtlInitUnicodeStringEx function.
SourceString
[in, optional]For more information, see the WdmlibRtlInitUnicodeStringEx function.
For more information, see the WdmlibRtlInitUnicodeStringEx function.
The RTL_CONSTANT_STRING macro creates a string or Unicode string structure to hold a counted string.
STRING RTL_CONSTANT_STRING(
[in] PCSZ SourceString
);
UNICODE_STRING RTL_CONSTANT_STRING(
[in] PCWSTR SourceString
);
RTL_CONSTANT_STRING returns either a string structure or Unicode string structure.
The RTL_CONSTANT_STRING macro replaces the RtlInitAnsiString, RtlInitString, and RtlInitUnicodeString routines when passing a constant string.
You can use RTL_CONSTANT_STRING to initialize global variables.
Initializes a counted Unicode string.
DestinationString
[in, out]The buffer for a counted Unicode string to be initialized. The length is initialized to zero if the SourceString is not specified.
SourceString
[in, optional]Optional pointer to a null-terminated Unicode string with which to initialize the counted string.