Bewerken

Delen via


PFREE_COMMON_BUFFER callback function (wdm.h)

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

Syntax

PFREE_COMMON_BUFFER PfreeCommonBuffer;

void PfreeCommonBuffer(
  [in] PDMA_ADAPTER DmaAdapter,
  [in] ULONG Length,
  [in] PHYSICAL_ADDRESS LogicalAddress,
  [in] PVOID VirtualAddress,
  [in] BOOLEAN CacheEnabled
)
{...}

Parameters

[in] DmaAdapter

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

[in] Length

Specifies the number of bytes to deallocate.

[in] LogicalAddress

Specifies the logical address of the allocated memory range.

[in] VirtualAddress

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

[in] CacheEnabled

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

Requirement Value
Minimum supported client Available starting with Windows 2000.
Target Platform Desktop
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
IRQL PASSIVE_LEVEL
DDI compliance rules IrqlDispatch(wdm)

See also

AllocateCommonBuffer

DMA_ADAPTER

DMA_OPERATIONS

IoGetDmaAdapter