StorPortGetDeviceBase Failed Call After PowerState Change

Hi all,

I work with PCIe based SSD and Storport Miniport Drivers.

I have a query.
We have a method to issue reset to PCIe based SSD through an external power state change. The device goes down and comes back up. Once the device is back up, I issue StorPortGetDeviceBase to re map the BAR address. I have also issued StorPortFreeDeviceBase to free the base before the reset.

Sometime this call fails and the BAR is not remapped, and it returns NULL. Any reason why? Is multiple times unmapping and Remapping the BAR not allowed?

Thanks and Regards,