RtlpConstructCrossVmObjectPath

NTSTATUS __stdcall RtlpConstructCrossVmObjectPath(_UNICODE_STRING *a1, const _GUID *a2, const _GUID *a3){
  wchar_t *Buffer; 
  int appended; 
  UINT32 v8; 
  _UNICODE_STRING Destination; 
  _UNICODE_STRING GuidString; 
  _UNICODE_STRING Source; 

  Destination = 0i64;
  Destination.MaximumLength = 112;
  GuidString = 0i64;
  Source = 0i64;
  if( a3 )
    Destination.MaximumLength = 190;
  Destination.Buffer = (wchar_t *)ExpAllocateStringRoutine(a3 != 0i64 ? 190i64 : 112i64);
  Buffer = Destination.Buffer;
  if( Destination.Buffer )
  {
    appended = RtlAppendUnicodeStringToString(&Destination, (_UNICODE_STRING *)&stru_140009638 + 3);
    if( appended < 0
      || (appended = RtlAppendUnicodeToString(&Destination, (WCHAR *)L"\\"), appended < 0)
      || a3
      && ((appended = RtlStringFromGUIDEx((_GUID *)a3, &GuidString, 1u), appended < 0)
       || (appended = RtlAppendUnicodeStringToString(&Destination, &GuidString), appended < 0)
       || (appended = RtlAppendUnicodeToString(&Destination, (WCHAR *)L"\\"), appended < 0))
      || (appended = RtlStringFromGUIDEx((_GUID *)a2, &Source, 1u), appended < 0)
      || (appended = RtlAppendUnicodeStringToString(&Destination, &Source), appended < 0) )
    {
      Buffer = Destination.Buffer;
    }
    else
    {
      Buffer = 0i64;
      *a1 = Destination;
    }
  }
  else
  {
    appended = -1073741801;
  }
  RtlFreeAnsiString(&GuidString);
  RtlFreeAnsiString(&Source);
  if( Buffer )
    ExFreePoolWithTag(Buffer, v8);
  return appended;
}

Referenced by:

RtlConstructCrossVmMutexPath