DbgkpInitializePhase0

NTSTATUS __stdcall DbgkpInitializePhase0(){
  CHAR *ServerSiloState; 
  NTSTATUS result; 
  __int64 v2; 
  _RTL_RUN_ONCE *v3; 
  _RTL_RUN_ONCE *v4; 
  _UNICODE_STRING TypeName; 
  _OBJECT_TYPE_INITIALIZER ObjectTypeInitializer; 

  *(_QWORD *)&TypeName.Length = 1572886i64;
  TypeName.Buffer = L"DebugObject";
  memset(&ObjectTypeInitializer, 0i64, sizeof(ObjectTypeInitializer));
  DbgkpProcessDebugPortMutex.Owner = 0i64;
  DbgkpProcessDebugPortMutex.Contention = 0;
  *(_DWORD *)&DbgkpProcessDebugPortMutex.gap14[8] = 0;
  *(_QWORD *)&DbgkpProcessDebugPortMutex.gap14[20] = &DbgkpProcessDebugPortMutex.gap14[12];
  *(_QWORD *)&DbgkpProcessDebugPortMutex.gap14[12] = &DbgkpProcessDebugPortMutex.gap14[12];
  DbgkpProcessDebugPortMutex.Count = 1;
  *(_WORD *)&DbgkpProcessDebugPortMutex.gap14[4] = 1;
  DbgkpProcessDebugPortMutex.gap14[6] = 6;
  ServerSiloState = DbgkpGetServerSiloState(0i64);
  result = DbgkpInitializePhase0SiloState(ServerSiloState);
  if( result >= 0 )
  {
    ObjectTypeInitializer.InvalidAttributes = 0;
    ObjectTypeInitializer.DefaultPagedPoolCharge = 0;
    ObjectTypeInitializer.DefaultNonPagedPoolCharge = 0;
    ObjectTypeInitializer.DeleteProcedure = (void(__fastcall *)(void *))AlpcMessageDeleteProcedure;
    ObjectTypeInitializer.Length = 120;
    ObjectTypeInitializer.CloseProcedure = (void(__fastcall *)(_EPROCESS *, void *, unsigned __int64, unsigned __int64))DbgkpCloseObject;
    v2 = 8i64;
    ObjectTypeInitializer._bf_0 |= 8u;
    ObjectTypeInitializer.ValidAccessMask = 2031631;
    ObjectTypeInitializer.GenericMapping.GenericAll = 2031631;
    ObjectTypeInitializer.PoolType = NonPagedPoolNx;
    ObjectTypeInitializer.GenericMapping.GenericRead = 131073;
    ObjectTypeInitializer.GenericMapping.GenericWrite = 131074;
    ObjectTypeInitializer.GenericMapping.GenericExecute = 1179648;
    result = ObCreateObjectType(&TypeName, &ObjectTypeInitializer, 0i64, &DbgkDebugObjectType);
    if( result >= 0 )
    {
      if( !DbgkpMaxModuleMsgs )
        DbgkpMaxModuleMsgs = 500;
      v3 = (_RTL_RUN_ONCE *)&stru_140C53C70;
      do
      {
        CmSiRWLockInitialize(v3);
        v3 = v4 + 2;
        --v2;
      }
      while( v2 );
    }
  }
  return result;
}

Referenced by:

DbgkInitialize