HalDisableInterrupt

NTSTATUS __stdcall HalDisableInterrupt(_INTERRUPT_CONNECTION_DATA *ConnectionData){
  INTERRUPT_CONNECTION_TYPE Type; 
  NTSTATUS v3; 
  unsigned int Gsiv; 
  unsigned int *LinesForGsiRange; 
  unsigned int *v7; 
  _REGISTERED_INTERRUPT_CONTROLLER *v8; 
  unsigned __int64 v9; 
  _INTERRUPT_LINE_STATE *v10; 
  _INTERRUPT_LINE Line; 

  if( ConnectionData->Count != 1 )
  {
LABEL_10:
    *(&CmpDummyThreadEvent + 1789) = 19;
    return -1073741811;
  }
  Type = ConnectionData->Vectors[0].Type;
  if( Type )
  {
    if( Type == InterruptTypeMessageRequest )
      return 0;
    goto LABEL_10;
  }
  Gsiv = ConnectionData->Vectors[0].ControllerInput.Gsiv;
  LinesForGsiRange = HalpInterruptFindLinesForGsiRange(Gsiv, Gsiv + 1);
  v7 = LinesForGsiRange;
  if( !LinesForGsiRange )
  {
    if( ((unsigned __int8(__fastcall *)(_QWORD, _QWORD))off_140C00780[0])(0i64, Gsiv) )
      return HalpDisableSecondaryInterrupt(ConnectionData);
    *(&CmpDummyThreadEvent + 1789) = 18;
    return -1073741811;
  }
  Line.UnitId = LinesForGsiRange[4];
  Line.Line = Gsiv + LinesForGsiRange[5] - LinesForGsiRange[7];
  HalpInterruptApplyOverrides(&Line, 0i64, 0i64);
  v8 = HalpInterruptLookupController(Line.UnitId);
  if( !v8 )
    *(&CmpDummyThreadEvent + 1789) = 17;
  v9 = (unsigned __int8)HalpAcquireHighLevelLock(&qword_140C49C40);
  v10 = (_INTERRUPT_LINE_STATE *)(*((_QWORD *)v7 + 5) + 56i64 * (int)(Line.Line - v7[5]));
  v10->Flags &= ~0x10u;
  v3 = HalpInterruptSetLineStateInternal(v8, &Line, v10);
  KxReleaseSpinLock(&qword_140C49C40);
  __writecr8(v9);
  return v3;
}

Referenced by:

KiDisconnectInterruptInternal
KiDisconnectSecondaryInterrupt