ExfAcquireRundownProtection

UINT8 __stdcall ExfAcquireRundownProtection(_EX_RUNDOWN_REF *RunRef){
  signed __int64 Count; 
  signed __int64 v2; 

  _m_prefetchw(RunRef);
  Count = RunRef->Count;
  if( (RunRef->Count & 1) != 0 )
    return 0;
  while( 1 )
  {
    v2 = Count;
    Count = _InterlockedCompareExchange64((volatile signed __int64 *)RunRef, Count + 2, Count);
    if( v2 == Count )
      break;
    if( (Count & 1) != 0 )
      return 0;
  }
  return 1;
}

Referenced by:

ExAcquireRundownProtection
ExAcquireRundownProtectionCacheAware