How to dynamically update memory resources with PnP

Hi All,

I am updating a NT 4.0 driver to a WDM driver and have looked at various
ways to do it. The driver controls a PCI bridge to a memory device. User
apps can open a window into the memory device through the PCI bridge.
Multiple windows can be opened each with their own size.

The NT 4.0 driver used IoAssignResources and IoReportResourceUsage to open
and close a window to the memory device. IoAssignResources gave me an
available memory range which allowed me to map the returned physical address
to the user space. The User app could then read and write using the returned

I was hoping to have an easy port to WDM using PnP to handle the PCI bridge
device (which it does ok), but it looks like I have to do a lot of work to
dynamically map memory. I don’t want to stop and start my PCI bridge device
to re-allocate memory resources because more than one user app can have a
window open and I don’t want to interfere with their operation when a new
app requests a window.

I’ve looked into creating PDOs for each memory window from a function driver
which would then require a FDO driver for the PDOs which seems like overkill
me. Looking through past posts the answer for this type of device seems to
a bus driver, again a lot of work to replace an obsolete function.

Anyone have a suggestion that doesn’t require a complete rewrite?