arty(a)svn.reactos.com wrote:
+NTSTATUS NTAPI AppendUnicodeString(PUNICODE_STRING ResultFirst,
+ PUNICODE_STRING Second,
+ BOOL Deallocate) {
+ NTSTATUS Status;
+ UNICODE_STRING Ustr = *ResultFirst;
+ PWSTR new_string = ExAllocatePoolWithTag
+ (PagedPool,
+ (ResultFirst->Length + Second->Length + sizeof(WCHAR)), TAG_STRING);
+ if( !new_string ) {
+ return STATUS_NO_MEMORY;
+ }
+ memcpy( new_string, ResultFirst->Buffer, ResultFirst->Length );
+ memcpy( new_string + ResultFirst->Length / sizeof(WCHAR),
+ Second->Buffer, Second->Length );
+ if( Deallocate ) RtlFreeUnicodeString(ResultFirst);
+ ResultFirst->Length = Ustr.Length + Second->Length;
+ ResultFirst->MaximumLength = ResultFirst->Length;
+ new_string[ResultFirst->Length / sizeof(WCHAR)] = 0;
+ Status = RtlCreateUnicodeString(ResultFirst,new_string) ?
+ STATUS_SUCCESS : STATUS_NO_MEMORY;
+ ExFreePool(new_string);
+ return Status;
+}
What's wrong with
RtlAppendUnicodeStringToString ?
Best regards,
Alex Ionescu