diff --git a/StringsAndData/RtlInitUnicodeString.c b/StringsAndData/RtlInitUnicodeString.c new file mode 100644 index 0000000..a5ba858 --- /dev/null +++ b/StringsAndData/RtlInitUnicodeString.c @@ -0,0 +1,18 @@ +VOID RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString) +{ + SIZE_T DestSize; + + if (SourceString) + { + DestSize = StringLengthW(SourceString) * sizeof(WCHAR); + DestinationString->Length = (USHORT)DestSize; + DestinationString->MaximumLength = (USHORT)DestSize + sizeof(WCHAR); + } + else + { + DestinationString->Length = 0; + DestinationString->MaximumLength = 0; + } + + DestinationString->Buffer = (PWCHAR)SourceString; +} \ No newline at end of file