HwStorResetBus, locking, and virtual storport drivers

I believe that for virtual storport drivers, storport doesn’t acquire
locks when calling HwStorStartIo etc. I think I read that somewhere, and
I certainly get crashes under SMP when I don’t acquire the StartIo lock
myself, and I don’t get deadlocks when I do acquire the StartIo lock.

I assumed that the HwStorResetBus routine was also called with no locks
held, but as soon as I try and acquire the StartIo lock in there I
deadlock, indicating that storport is acquiring the lock for me already.

Is this documented somewhere or are we developers expected to work this
stuff out by trial and error?

Thanks

James

The differences between a real miniport port and a virtual miniport are poorly documented. Regarding locks, these are the only two mentions that I’m aware of.

http://msdn.microsoft.com/en-us/library/ff559166(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ff567549(VS.85).aspx

"The differences between a real miniport port and a virtual miniport are poorly
documented. "

Not only that, they are poorly thought out. For example, if you call StorPortAllocateNoncachedExtension in a virtual miniport, it will succeed. Then, on unload, the memory will leak, because its deallocation is explicitly bypassed.