ExfAcquirePushLockExclusiveEx
INT64 __fastcall ExfAcquirePushLockExclusiveEx(UINT64 *a1, VOID *a2, VOID *a3){
unsigned __int64 v6;
__int64 v7;
INT64 result;
bool v9;
__int64 v10;
signed __int64 v11;
bool v12;
signed __int64 v13;
VOID *v14;
int i;
unsigned __int64 v16;
unsigned __int64 v17;
unsigned __int64 v18;
unsigned __int64 v19;
__int16 Object;
char v21;
int v22;
__int64 v23[3];
__int16 *p_Object;
__int64 v25;
int v26;
signed __int32 v27;
VOID *v28;
UINT64 v29;
memset((INT64)&Object, 0i64);
LODWORD(v29) = 0;
_m_prefetchw(a1);
v6 = *a1;
v7 = (unsigned int)(unsigned __int8)v29 + 3;
while( (v6 & 1) != 0 )
{
if( a2 )
KeAbPreWait(a2);
v9 = 0;
v28 = a2;
v27 = v7;
v25 = 0i64;
if( (v6 & 2) != 0 )
{
p_Object = 0i64;
v26 = -1;
v23[2] = v6 & 0xFFFFFFFFFFFFFFF0ui64;
v11 = (unsigned __int64)&Object | v6 & 8 | 7;
v9 = (v6 & 4) == 0;
}
else
{
v10 = 11i64;
p_Object = &Object;
v26 = v6 >> 4;
if( v26 <= 1 )
v10 = v7;
v11 = (unsigned __int64)&Object | v10;
if( !(unsigned int)(v6 >> 4) )
v26 = -2;
}
v13 = _InterlockedCompareExchange64((volatile signed __int64 *)a1, v11, v6);
v12 = v6 == v13;
v6 = v13;
if( !v12 )
goto LABEL_13;
if( v9 )
ExpOptimizePushLockList((volatile INT64 *)a1, v11);
v23[1] = (__int64)v23;
v23[0] = (__int64)v23;
Object = 1;
v21 = 6;
v22 = 0;
if( KUSER_SHARED_DATA.UnparkedProcessorCount > 1u )
{
if( KUSER_SHARED_DATA.ProcessorFeatures[35] )
{
v16 = __rdtsc();
v17 = v16 + (unsigned int)ExpSpinCycleCount;
while( 1 )
{
__asm { monitorx rax, rcx, rdx }
if( (v27 & 2) == 0 )
break;
v18 = v16;
v19 = __rdtsc();
v16 = v19;
if( v19 <= v18 || v19 >= v17 )
break;
__asm { mwaitx rax, rcx, rbx }
}
}
else
{
for( i = 0; (v27 & 2) != 0 && i != ExpSpinCycleCount / (unsigned int)KUSER_SHARED_DATA.CyclesPerYield; ++i )
_mm_pause();
}
}
if( _interlockedbittestandreset(&v27, 1u) )
KeWaitForSingleObject(&Object, WrPushLock, 0, 0, 0i64);
LABEL_14:
if( a2 )
{
LODWORD(v14) = KeAbPreAcquire(a3, a2, 0i64);
a2 = v14;
}
}
result = _InterlockedCompareExchange64((volatile signed __int64 *)a1, v6 + 1, v6);
if( v6 != result )
{
if( a2 )
KeAbPreWait(a2);
LABEL_13:
RtlBackoff(&v29);
v6 = *a1;
_m_prefetchw(a1);
goto LABEL_14;
}
return result;
}Referenced by:
ExAcquireAutoExpandPushLockExclusive
ExAcquirePushLockExclusiveEx
ExGetWakeTimerList
ExRegisterExtension
ExRegisterHost
ExShareAddressSpaceWithDevice
ExSvmBeginDeviceReset
ExSvmFinalizeDeviceReset
ExUnregisterExtension
ExUuidCreate
ExWakeTimersPause
ExfAcquireCacheAwarePushLockExclusiveEx
ExfAcquirePushLockExclusive
ExfAcquireReleasePushLockExclusive
ExpAcquireFannedOutPushLockExclusive
ExpDeleteTimer
ExpKdPullRemoteFileForUser
ExpSaAllocatorAllocate
ExpSaAllocatorFree
ExpSaPageGroupAllocateMemory
ExpSaPageGroupDescriptorAllocate
ExpSaPageGroupDescriptorFree
ExpSaPageGroupFreeMemory
ExpSetTimerObject
ExpSvmDereferenceDevice
ExpWnfAllocateNextPersistentNameSequence
ExpWnfCompleteThreadSubscriptions
ExpWnfCreateNameInstance
ExpWnfCreateProcessContext
ExpWnfDeleteNameInstance
ExpWnfDeleteProcessContext
ExpWnfDeleteScopeById
ExpWnfDeleteScopeInstances
ExpWnfDeleteStateData
ExpWnfDeleteSubscription
ExpWnfDeliverThreadNotifications
ExpWnfDispatchKernelSubscription
ExpWnfResolveScopeInstance
ExpWnfSubscribeNameInstance
ExpWnfUpdateSubscription
ExpWnfWriteStateData
FlushLookUpTableBucket
NtAllocateUuids
NtCancelTimer
NtReleaseKeyedEvent
NtSetUuidSeed
NtWaitForKeyedEvent
PdcAcquireRwLockExclusive
TlgRegisterAggregateProviderEx
WbAddHeapExecutedBlockToCache
WbAddHeapExecutedBlockToLRU
WbAddWarbirdEncryptionSegment
WbAllocateSlots
WbAllocateUserMemory
WbDecryptEncryptionSegment
WbFreeMemoryBlockRegion
WbGetInitializedEncryptionSegment
WbGetWarbirdProcess
WbGetWarbirdThread
WbHeapExecutionUnloadModule
WbInPlaceEncryptionUnloadModule
WbMoveHeapExecutedBlockToBackOfLRU
WbReEncryptEncryptionSegment
WbReleaseLeastRecentlyUsedHeapExecutedBlocks
WbRemoveWarbirdProcess
WheaConfigureErrorSource
WheaInitialize
WheaRegisterInUsePageOfflineNotification
WheaUnconfigureErrorSource
WheaUnregisterInUsePageOfflineNotification
WheapCallInUsePageNotificationCallbacks
WheapPfaReset
WheapPredictiveFailureAnalysis