KiMaskSecondaryInterruptInternal

NTSTATUS __stdcall KiMaskSecondaryInterruptInternal(UINT64 Vector, UINT64 Gsiv){
  unsigned int v2; 
  NTSTATUS v3; 
  __int64 v4; 
  UINT64 *v5; 
  __int64 v6; 
  __int64 v8; 
  __int64 *v9; 
  UINT8 OldIrql; 

  OldIrql = 0;
  v2 = Gsiv;
  v3 = 0;
  v4 = (unsigned int)(Vector - 256);
  v5 = (UINT64 *)(KiGlobalSecondaryIDT + 48 * v4);
  KiAcquireSecondaryInterruptConnectLock(v5, &OldIrql);
  v6 = KiGlobalSecondaryIDT + 48 * v4;
  if( *(_BYTE *)(v6 + 32) || (v8 = *(_QWORD *)(v6 + 40)) == 0 )
  {
    KxReleaseSpinLock(v5);
    __writecr8(OldIrql);
    return 0;
  }
  else
  {
    v9 = (__int64 *)(v8 + 8);
    while( (v9[12] & 1) != 0 )
    {
      v9 = (__int64 *)*v9;
      if( v9 == (__int64 *)(v8 + 8) )
      {
        *(_BYTE *)(v6 + 32) = 1;
        goto LABEL_9;
      }
    }
    v3 = 296;
LABEL_9:
    KxReleaseSpinLock(v5);
    __writecr8(OldIrql);
    if( !v3 )
      ((void(__fastcall *)(_QWORD, _QWORD))off_140C00770[0])(v2, 0i64);
    return v3;
  }
}

Referenced by:

KeMaskInterrupt