VfHalAllocateMapRegisters

NTSTATUS __stdcall VfHalAllocateMapRegisters(
        ULONG_PTR DmaAdapter,
        UINT64 NumberOfMapRegisters,
        UINT64 BaseAddressCount,
        ULONG_PTR *MapRegisterArray){
  __int64 v5; 
  unsigned int v6; 
  _DMA_ADAPTER *v7; 
  INT64 v8; 
  NTSTATUS MapRegisters; 
  _LIST_ENTRY *AdapterInformationInternal; 
  _MAP_REGISTER_FILE *MapRegisterFile; 

  v5 = (unsigned int)BaseAddressCount;
  v6 = NumberOfMapRegisters;
  v7 = *(_DMA_ADAPTER **)&DmaAdapter;
  if( !VfRealHalAllocateMapRegisters )
    return -1073741823;
  MapRegisters = VfRealHalAllocateMapRegisters(DmaAdapter, NumberOfMapRegisters, (unsigned int)BaseAddressCount);
  if( MapRegisters >= 0 )
  {
    LOBYTE(v8) = 1;
    AdapterInformationInternal = ViGetAdapterInformationInternal(v7, v8);
    if( AdapterInformationInternal )
    {
      if( (_DWORD)v5 )
      {
        do
        {
          if( BYTE1(AdapterInformationInternal[2].Flink)
            || (MapRegisterFile = ViAllocateMapRegisterFile((_ADAPTER_INFORMATION *)AdapterInformationInternal, v6)) == 0i64 )
          {
            if( !*(_QWORD *)MapRegisterArray )
              *(_QWORD *)MapRegisterArray = -559026163i64;
          }
          else
          {
            *((_QWORD *)MapRegisterFile + 6) = *(_QWORD *)MapRegisterArray;
            *(_QWORD *)MapRegisterArray = MapRegisterFile;
          }
          ADD_MAP_REGISTERS((_ADAPTER_INFORMATION *)AdapterInformationInternal, v6, 1u);
          MapRegisterArray += 4;
          --v5;
        }
        while( v5 );
      }
    }
  }
  return MapRegisters;
}

Referenced by:

No references.