HalFreeCommonBuffer

VOID
    HalFreeCommonBuffer(

        IN PADAPTER_OBJECT  AdapterObject,
        IN ULONG  Length,
        IN PHYSICAL_ADDRESS  LogicalAddress,
        IN PVOID  VirtualAddress,
        IN BOOLEAN  CacheEnabled
        );

HalFreeCommonBuffer frees a common buffer and all resources it uses.

Parameters

AdapterObject
Points to the adapter object returned by the HalGetAdapter for which the common buffer was allocated.
Length
Specifies the number of bytes to deallocate.
LogicalAddress
Specifies the logical address of the allocated memory range.
VirtualAddress
Points to the corresponding virtual address of the allocated memory range.
CacheEnabled
Indicates whether the allocated memory is cached.

Comments

When a common buffer is to be released, the driver calls HalFreeCommonBuffer to unmap both its logical and virtual addresses. The parameters passed to HalFreeCommonBuffer must match exactly those passed to and returned from HalAllocateCommonBuffer. A driver cannot free part of an allocated common buffer.

Callers of HalFreeCommonBuffer must be running at IRQL <= DISPATCH_LEVEL. However, this routine is usually called when the driver is being unloaded and is running at IRQL PASSIVE_LEVEL.

See Also

HalAllocateCommonBuffer, HalGetAdapter