ViDeadlockAllocate

VOID *__stdcall ViDeadlockAllocate(VI_DEADLOCK_ALLOC_TYPE Type){
  __int32 v1; 
  __int32 v2; 
  VOID *result; 
  _NPAGED_LOOKASIDE_LIST *v4; 

  v1 = Type - 1;
  if( v1 )
  {
    v2 = v1 - 1;
    if( v2 )
    {
      if( v2 != 1 )
        return 0i64;
      v4 = &ViDeadlockThreadLookaside;
    }
    else
    {
      v4 = &ViDeadlockNodeLookaside;
    }
  }
  else
  {
    v4 = &ViDeadlockResourceLookaside;
  }
  result = ExAllocateFromNPagedLookasideList(v4);
  if( !result )
  {
    ViDeadlockState |= 1u;
    _InterlockedIncrement((volatile signed __int32 *)ViDeadlockGlobals + 8196);
  }
  return result;
}

Referenced by:

VfDeadlockAcquireResource
VfDeadlockBeforeCallDriver
VfDeadlockInitializeResource