DMA: freeing map registers and adapter object

Hello to all dma specialists

I set up a DMA read and write transfer to and from a PCI card. The PCI
card is busmaster capable but not scatter/gather. I actually can do dma
read and write transfers but have problem freeing the map registers and
adapter channels. Basically I saw there are two commands to do this:

a) FreeMapRegisters()


b) FreeAdapterChannel()

according to the “Walter Oney” book with a) only the map registers are
released while with b) both the adapter object and the map registers
will be released. Do I understand that correctly so far?

First I tried just with b) to release the adapter objects after the
whole dma transfer was finished. It worked in the first few transfers,
but after a few more transfers, the adaptercontrol routine (provided
from my driver) was not called anymore from the system and I suspected
that there are no more dma resources. I had to restart the system again
and voilà I could to dma again, for a while…

I added a) before b) and now the driver verifier complains:

“Driver has freed too many simultaneous adapter channels”

the next thing what I see is a blue screen…

Can somebody help me?