title: How does a WDF driver release the resource acquired by user program?
body: <p>The driver in the title works with a PCIe card to get some data from outside world to a PC.</p>
  
  <p>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.</p>
  
  <p>My question:</p>
  
  <ol>
  <li>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?</li>
  <li>If the answer of first question is true, is there anything can be done in the driver to avoid the leaking?</li>
  </ol>
  
  <p>Any suggestion will be appreciated.</p>