UINT8 __stdcall ViLockContextPointer(_VF_CONTEXT_POINTER *ContextPointer){
signed __int64 v2;
signed __int64 v3;
UINT64 SpinCount;
LODWORD(SpinCount) = 0;
do
{
while( 1 )
{
_m_prefetchw(ContextPointer);
v2 = *(_QWORD *)ContextPointer;
if( (*(_QWORD *)ContextPointer & 1) != 0 )
break;
if( !v2 )
return v2;
KeYieldProcessorEx(&SpinCount);
}
v3 = *(_QWORD *)ContextPointer;
}
while( v3 != _InterlockedCompareExchange64((volatile signed __int64 *)ContextPointer, v2 - 1, v2) );
LOBYTE(v2) = 1;
return v2;
}