ViFreeToContiguousMemory

UINT64 __stdcall ViFreeToContiguousMemory(_ADAPTER_INFORMATION *AdapterInformation, VOID *Address, UINT64 HintIndex){
  __int64 v3; 
  VOID **v5; 
  UINT64 *v7; 
  unsigned __int64 v8; 

  v3 = (unsigned int)HintIndex;
  v5 = (VOID **)*((_QWORD *)AdapterInformation + 33);
  if( !v5 )
    return 0i64;
  if( (unsigned int)v3 >= 0x20 || v5[v3] != Address )
  {
    LODWORD(v3) = 0;
    while( *v5 != Address )
    {
      LODWORD(v3) = v3 + 1;
      ++v5;
      if( (unsigned int)v3 >= 0x20 )
        return 0i64;
    }
  }
  v7 = (UINT64 *)(AdapterInformation + 70);
  v8 = (unsigned __int8)KeAcquireSpinLockRaiseToDpc((UINT64 *)AdapterInformation + 35);
  RtlClearBits((PRTL_BITMAP)(AdapterInformation + 74), v3, 1u);
  KxReleaseSpinLock(v7);
  __writecr8(v8);
  return 1i64;
}

Referenced by:

ViAllocateMapRegisterFile
ViFreeMapRegisterFile