IopConnectInterruptFullySpecified

NTSTATUS __stdcall IopConnectInterruptFullySpecified(
        _KINTERRUPT **InterruptObject,
        UINT8 *ServiceRoutine,
        _KINTERRUPT *a3,
        VOID *a4,
        VOID *ServiceContext,
        UINT64 *SpinLock,
        UINT64 Vector,
        UINT64 Irql,
        UINT64 SynchronizeIrql,
        _KINTERRUPT_MODE InterruptMode,
        UINT8 ShareVector,
        _GROUP_AFFINITY *TargetProcessors,
        UINT8 FloatingSave){
  UINT32 v16; 
  char v17; 
  _GROUP_AFFINITY v18; 
  char v19; 
  NTSTATUS result; 
  char v21; 
  _KINTERRUPT_POLARITY v22; 
  _KINTERRUPT_POLARITY v23; 
  unsigned __int64 *v24; 
  PINTERRUPT_CONNECTION_DATA v25; 
  _KINTERRUPT_POLARITY Polarity; 
  _KINTERRUPT_POLARITY IntRemapInfo; 
  PIO_INTERRUPT_STRUCTURE InterruptStructureOut[2]; 
  _GROUP_AFFINITY IntRemapInfoa[6]; 

  v16 = (unsigned int)a4;
  memset(IntRemapInfoa, 0i64, sizeof(IntRemapInfoa));
  Polarity = InterruptPolarityUnknown;
  *(_QWORD *)InterruptStructureOut = 0i64;
  IntRemapInfo = InterruptPolarityUnknown;
  if( !a3 || !KeVerifyGroupAffinity((_GROUP_AFFINITY *)ShareVector, 0) )
    return -1073741811;
  v17 = Irql;
  if( (_BYTE)Irql )
  {
    if( (unsigned __int8)Irql >= (unsigned __int8)Vector )
      goto LABEL_5;
    return -1073741811;
  }
  v17 = Vector;
LABEL_5:
  v18 = *(_GROUP_AFFINITY *)ShareVector;
  *(_DWORD *)&IntRemapInfoa[0].Group = 0;
  LOBYTE(IntRemapInfoa[1].Mask) = Vector;
  v19 = 1;
  *(_DWORD *)&IntRemapInfoa[1].Group = SynchronizeIrql;
  LODWORD(IntRemapInfoa[0].Mask) = 1;
  *(_DWORD *)&IntRemapInfoa[0].Reserved[1] = (_DWORD)SpinLock;
  IntRemapInfoa[2] = v18;
  result = HalGetVectorInput(
             (unsigned int)SpinLock,
             &IntRemapInfoa[2],
             &Polarity,
             &IntRemapInfo,
             (_INTERRUPT_REMAPPING_INFO *)&IntRemapInfoa[3]);
  if( result >= 0 )
  {
    v21 = ((__int64(__fastcall *)(_QWORD, _QWORD))off_140C00780[0])(0i64, (unsigned int)Polarity);
    v22 = IntRemapInfo;
    if( v21 || (unsigned int)(IntRemapInfo - 3) > 1 )
    {
      v23 = Polarity;
      *InterruptObject = 0i64;
      LODWORD(IntRemapInfoa[4].Mask) = v23;
      if( (IntRemapInfoa[4].Mask & 0x100000000i64) == 0 )
        v19 = InterruptMode;
      HIDWORD(IntRemapInfoa[1].Mask) = v22;
      LODWORD(v24) = 0;
      result = IopConnectInterrupt(
                 InterruptStructureOut,
                 (PKSERVICE_ROUTINE)ServiceRoutine,
                 (PKMESSAGE_SERVICE_ROUTINE)a3,
                 0i64,
                 v16,
                 v24,
                 (_KIRQL)ServiceContext,
                 v17,
                 v19,
                 v25);
      if( result >= 0 )
        *InterruptObject = (_KINTERRUPT *)(*(_QWORD *)InterruptStructureOut + 112i64);
    }
    else
    {
      return -1073741637;
    }
  }
  return result;
}

Referenced by:

IoConnectInterrupt
IoConnectInterruptEx