RtlUnicodeStringCopy

NTSTATUS __stdcall RtlUnicodeStringCopy(UNICODE_STRING *DestinationString, UNICODE_STRING *SourceString){
  UINT32 v2; 
  __int16 v3; 
  __int64 v5; 
  unsigned __int64 v6; 
  NTSTATUS result; 
  SIZE_T v9; 
  __int64 v10; 
  UINT32 v11; 
  int v12; 
  wchar_t *Buffer; 
  unsigned __int64 v14; 
  __int64 v15; 
  v3 = 0;
  v5 = 0i64;
  v6 = 0i64;
  result = RtlUnicodeStringValidateWorker_0(DestinationString, (SIZE_T)SourceString, v2);
  if( result >= 0 )
  {
    if( v10 )
    {
      v5 = *(_QWORD *)(v10 + 8);
      v6 = (unsigned __int64)*(unsigned __int16 *)(v10 + 2) >> 1;
    }
    v12 = RtlUnicodeStringValidateWorker_0(SourceString, v9, v11);
    if( v12 >= 0 )
    {
      if( SourceString )
      {
        Buffer = SourceString->Buffer;
        v14 = (unsigned __int64)SourceString->Length >> 1;
      }
      v12 = 0;
      if( v6 )
      {
        v15 = v5 - (_QWORD)Buffer;
        while( v14 )
        {
          --v14;
          *(wchar_t *)((char *)Buffer + v15) = *Buffer;
          ++v3;
          ++Buffer;
          if( !--v6 )
            goto LABEL_11;
        }
      }
      else
      {
LABEL_11:
        if( v14 )
          v12 = -2147483643;
      }
    }
    result = v12;
    DestinationString->Length = 2 * v3;
  }
  return result;
}

Referenced by:

AslpPathWildcardAllocMatchNode
CmpDoWritethroughReparse
CmpGetSymbolicLinkTarget
CmpLinkHiveToMaster
CmpLogTransactionAbortedWithChildName
CmpVEExecuteVirtualStoreParseLogic
MiConstructNonRetpolineImageLoadRecord
PopCloneUnicodeString
PopUnicodeStringDeepCopy
SleepstudyHelperSetBlockerFriendlyName
SshpCopyDataEntry
VrpHandleIoctlInitializeJobForVreg