How does a WDF driver release the resource acquired by user program?

255 views Asked by At

The driver in the title works with a PCIe card to get some data from outside world to a PC.

The driver will allocate tens of MB's memory when it starts up, then user program can map these memory to its own address space, then the data can be put there by the card to be accessed by user program.

My question:

  1. Suppose user program crashs after it mapped the memory or it forgets to unmap the memory before it exits, will that cause any resource leaking?
  2. If the answer of first question is true, is there anything can be done in the driver to avoid the leaking?

Any suggestion will be appreciated.

0

There are 0 answers