IopConnectLinkTrackingPort

VOID __stdcall IopConnectLinkTrackingPort(PVOID Parameter){
  WCHAR v1; 
  int v2; 
  ULONG MaxMessageLength[2]; 
  void *PortHandle; 
  struct _UNICODE_STRING DestinationString; 
  struct _SECURITY_QUALITY_OF_SERVICE SecurityQos; 
  PortHandle = 0i64;
  v2 = 0;
  if( !IopLinkTrackingServiceObject )
  {
    MaxMessageLength[0] = 0;
    *(_QWORD *)&SecurityQos.Length = 0i64;
    *(_DWORD *)&SecurityQos.ContextTrackingMode = 0;
    DestinationString = 0i64;
    if( *(_DWORD *)(IopLinkTrackingServiceEvent + 4) )
    {
      SecurityQos.ImpersonationLevel = SecurityImpersonation;
      *(_WORD *)&SecurityQos.ContextTrackingMode = 257;
      RtlInitUnicodeString(&DestinationString, L"\\Security\\TRKWKS_PORT", v1);
      v2 = NtSecureConnectPort(
             &PortHandle,
             &DestinationString,
             &SecurityQos,
             0i64,
             0i64,
             0i64,
             (UINT64 *)MaxMessageLength,
             0i64,
             0i64);
      if( v2 >= 0 )
      {
        if( MaxMessageLength[0] - 128 > 0x80 )
        {
          NtClose(PortHandle);
          v2 = -1073741811;
        }
        else
        {
          *(_QWORD *)MaxMessageLength = 0i64;
          v2 = ObReferenceObjectByHandle(PortHandle, 0, LpcPortObjectType, 0, (PVOID *)MaxMessageLength, 0i64);
          IopLinkTrackingServiceObject = *(PADAPTER_OBJECT *)MaxMessageLength;
          NtClose(PortHandle);
        }
      }
    }
    else
    {
      v2 = -1073741772;
    }
  }
  *((_DWORD *)Parameter + 14) = v2;
  KeSetEvent((PRKEVENT)((char *)Parameter + 32), 0);
}

Referenced by:

No references.