HalpCreateSecondaryIcEntry

INT64 __fastcall HalpCreateSecondaryIcEntry(_SECONDARY_INTERRUPT_PROVIDER_INTERFACE *Interface){
  VOID *PoolWithTag; 
  unsigned int v3; 
  __int64 v4; 
  unsigned __int64 v5; 
  __int64 *v6; 
  PoolWithTag = ExAllocatePoolWithTag(NonPagedPoolNx, 16 * (Interface->GsivSize + 10i64), 0x536C6148ui64);
  v3 = 0;
  v4 = (__int64)PoolWithTag;
  if( PoolWithTag )
  {
    memset((INT64)PoolWithTag, 0i64);
    *(_DWORD *)(v4 + 16) = Interface->GsivBase;
    *(_DWORD *)(v4 + 20) = Interface->GsivSize;
    *(_OWORD *)(v4 + 24) = *(_OWORD *)&Interface->Size;
    *(_OWORD *)(v4 + 40) = *(_OWORD *)&Interface->GsivBase;
    *(_OWORD *)(v4 + 56) = *(_OWORD *)&Interface->Reserved1;
    *(_OWORD *)(v4 + 72) = *(_OWORD *)&Interface->Reserved3;
    *(_OWORD *)(v4 + 88) = *(_OWORD *)&Interface->Reserved5;
    *(_QWORD *)(v4 + 104) = Interface->Reserved7;
    ObfReferenceObjectWithTag(*(PVOID *)(v4 + 48), 0x536C6148u);
    *(_WORD *)(v4 + 120) = 1;
    *(_QWORD *)(v4 + 136) = v4 + 128;
    *(_QWORD *)(v4 + 128) = v4 + 128;
    *(_BYTE *)(v4 + 122) = 6;
    *(_DWORD *)(v4 + 124) = 1;
    v5 = (unsigned __int8)HalpAcquireHighLevelLock(&SecondaryIcListSpinLock);
    v6 = (__int64 *)qword_140C49948;
    if( *(__int64 **)qword_140C49948 != &SecondaryIcList )
      __fastfail(3u);
    *(_QWORD *)v4 = &SecondaryIcList;
    *(_QWORD *)(v4 + 8) = v6;
    *v6 = v4;
    qword_140C49948 = v4;
    KxReleaseSpinLock(&SecondaryIcListSpinLock);
    __writecr8(v5);
  }
  else
  {
    return(unsigned int)-1073741801;
  }
  return v3;
}

Referenced by:

HalpRegisterSecondaryIcInterface