PopPepLockActivityLink

CHAR __fastcall PopPepLockActivityLink(INT64 a1, volatile INT64 *a2, UINT64 a3, UINT64 a4, UINT8 *a5){
  CHAR v5; 
  KIRQL v9; 
  bool v10; 
  unsigned __int64 v11; 
  v5 = 0;
  if( !a2 || *(_DWORD *)(a1 + 180) == 1 )
    goto LABEL_3;
  if( (_DWORD)a3 == 6 )
  {
    if( (_DWORD)a4 == 6 )
      goto LABEL_3;
  }
  else if( (unsigned int)a3 <= 5 && ActivityAttributes[136 * (int)a3] == 1 )
  {
    goto LABEL_3;
  }
  if( (unsigned int)a4 > 5 || ActivityAttributes[136 * (int)a4] != 1 )
  {
    v9 = ExAcquireSpinLockShared((PEX_SPIN_LOCK)(a1 + 64));
    v10 = *(_BYTE *)(a1 + 125) == 1;
    v11 = v9;
    *a5 = v9;
    if( !v10 )
    {
      ExAcquireSpinLockExclusiveAtDpcLevel((INT64 *)a2);
      return v5;
    }
    ExReleaseSpinLockSharedFromDpcLevel((PEX_SPIN_LOCK)(a1 + 64));
    __writecr8(v11);
  }
LABEL_3:
  *a5 = ExAcquireSpinLockExclusive((PEX_SPIN_LOCK)(a1 + 64));
  v5 = 1;
  *(_BYTE *)(a1 + 125) = 1;
  return v5;
}

Referenced by:

PopPepCompleteComponentIdleState
PopPepComponentSetLatency
PopPepComponentSetResidency
PopPepComponentSetWakeHint
PopPepProcessEvent