Thursday, 8 August 2013

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

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

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.

No comments:

Post a Comment