Previous Next

FreeMapRegisters

The FreeMapRegisters routine releases a set of map registers that were saved from a call to AllocateAdapterChannel.

VOID
  FreeMapRegisters(
    IN PDMA_ADAPTER  DmaAdapter,
    PVOID  MapRegisterBase,
    ULONG  NumberOfMapRegisters
    );

Parameters

DmaAdapter
Pointer to the DMA_ADAPTER structure returned by IoGetDmaAdapter that represents the bus-master adapter or DMA controller .
MapRegisterBase
Specifies the map registers allocated for the DMA operation. The system passes this value to the driver's AdapterControl routine.
NumberOfMapRegisters
Specifies the number of map registers to be released. This value must match the number specified in an earlier call to AllocateAdapterChannel.

Return Value

None

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

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

When the driver of a bus-master device has completed the current packet-based DMA transfer request, it calls FreeMapRegisters to release the map registers previously allocated by a call to AllocateAdapterChannel and retained because its AdapterControl routine returned DeallocateObjectKeepRegisters. The driver must call FreeMapRegisters after calling FlushAdapterBuffers.

Callers of FreeMapRegisters must be running at IRQL = DISPATCH_LEVEL.

See Also

AllocateAdapterChannel, IoGetDmaAdapter, MapTransfer, DMA_OPERATIONS