HalpDmaReturnPageToOwner

VOID __stdcall HalpDmaReturnPageToOwner(
        _ADAPTER_OBJECT *ChildAdapterObject,
        _HALP_DMA_MASTER_ADAPTER_OBJECT *MasterAdapterObject,
        _HALP_DMA_TRANSLATION_ENTRY *Translation){
  _HALP_DMA_TRANSLATION_ENTRY *v4; 
  union {void *VirtualAddress;struct {unsigned __int64 BoundToMaster : 1;unsigned __int64 BoundToScatterPool : 1;unsigned __int64 OwnedByMaster : 1;unsigned __int64 OwnedByScatterPool : 1;unsigned __int64 TemporaryMapping : 1;unsigned __int64 ZeroBuffer : 1;unsigned __int64 Address : 58;} Flags;} v5; 
  __int64 v6; 
  bool v7; 

  Translation->NextMapping = Translation;
  if( ChildAdapterObject )
  {
    v5.VirtualAddress = (void *)Translation->u;
    v6 = (__int64)v5.VirtualAddress & 4;
    if( ChildAdapterObject->ScatterGather )
    {
      if( ((__int64)v5.VirtualAddress & 4) == 0 )
      {
        v4 = Translation;
LABEL_9:
        HalpDmaReturnToScatterPool(&ChildAdapterObject->AdapterObject, v4, 0i64);
        return;
      }
      v7 = ((__int64)v5.VirtualAddress & 8) == 0;
      ChildAdapterObject = (_ADAPTER_OBJECT *)MasterAdapterObject;
      v4 = Translation;
      if( !v7 )
        goto LABEL_9;
    }
    else
    {
      v4 = Translation;
      if( v6 )
        ChildAdapterObject = (_ADAPTER_OBJECT *)MasterAdapterObject;
    }
  }
  else
  {
    v4 = Translation;
    ChildAdapterObject = (_ADAPTER_OBJECT *)MasterAdapterObject;
    if( ((__int64)Translation->u.VirtualAddress & 8) != 0 )
      goto LABEL_9;
  }
  HalpDmaReturnToContiguousPool(&ChildAdapterObject->AdapterObject, v4, 0i64);
}

Referenced by:

HalpDmaAllocateMapRegisters
HalpDmaAllocateNewTranslationBuffer
HalpDmaFreeMapRegisters