FreeCommonBuffer routine

The FreeCommonBuffer routine frees a common buffer allocated by AllocateCommonBuffer, along with all resources the buffer uses.

Syntax


VOID FreeCommonBuffer(
  _In_  PDMA_ADAPTER DmaAdapter,
  _In_  ULONG Length,
  _In_  PHYSICAL_ADDRESS LogicalAddress,
  _In_  PVOID VirtualAddress,
  _In_  BOOLEAN CacheEnabled
);

Parameters

DmaAdapter [in]

Pointer to the DMA_ADAPTER structure returned by IoGetDmaAdapter that represents the bus-master adapter or DMA controller.

Length [in]

Specifies the number of bytes to deallocate.

LogicalAddress [in]

Specifies the logical address of the allocated memory range.

VirtualAddress [in]

Pointer to the corresponding virtual address of the allocated memory range.

CacheEnabled [in]

Indicates whether the allocated memory is cached.

Return value

None

Remarks

FreeCommonBuffer is not a system routine that can be called directly by name. This routine is callable only by pointer from the address returned in a DMA_OPERATIONS structure. Drivers obtain the address of this routine by calling IoGetDmaAdapter.

To release a common buffer, a driver calls FreeCommonBuffer to unmap both its logical and virtual addresses. The parameters passed to FreeCommonBuffer must match exactly those passed to and returned from AllocateCommonBuffer. A driver cannot free part of an allocated common buffer.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

IRQL

PASSIVE_LEVEL

DDI compliance rules

IrqlDispatch

See also

DMA_ADAPTER
AllocateCommonBuffer
IoGetDmaAdapter
DMA_OPERATIONS

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft