Virtual Storport Miniport

When I call StorPortInitialize in DriverEntry of my virtual storport minport driver , HwStorFindAdapter is called followed by HwStorInitializeAdapter and HwStorStartIo.

1> When I return SP_RETURN_NOT_FOUND or any other error status in HwStorFindAdapter, Storport ignores the error status and still calls HwStorInitializeAdapter and HwStorStartIo.

2> In the same way, When I return FALSE in HwStorInitializeAdapter still HwStorStartIo is getting called.

Because of the above behaviour, I am not able to handling error conditions in my driver, like failure of memory allocation in HwStorInitializeAdapter.

Is it a expected behaviour in VIRTUAL storport miniport driver or am I doing something wrong?

Thanks,
Nirranjan.K

You need to look at the srb function field being sent to HwStorStartIo. It
will likely be SRB_FUNCTION_PNP if your initilization fails, meaning your
getting a StorRemoveDevice in the SCSI_PNP_REQUEST_BLOCK (srb) due to a
failed PnP start.

Yes, this would be expected behaivor.

An uglier case is storport doesn’t like something set by HwStorFindAdapter
and HwStorInitializeAdapter isn’t even called, just HwStorStartIo with
StorRemoveDevice.

Hint hint Microsoft, a state transition diagram would be nice.

Jan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Friday, March 20, 2009 11:17 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Virtual Storport Miniport

When I call StorPortInitialize in DriverEntry of my virtual
storport minport driver , HwStorFindAdapter is called
followed by HwStorInitializeAdapter and HwStorStartIo.

1> When I return SP_RETURN_NOT_FOUND or any other error
status in HwStorFindAdapter, Storport ignores the error
status and still calls HwStorInitializeAdapter and HwStorStartIo.

2> In the same way, When I return FALSE in
HwStorInitializeAdapter still HwStorStartIo is getting called.

Because of the above behaviour, I am not able to handling
error conditions in my driver, like failure of memory
allocation in HwStorInitializeAdapter.

Is it a expected behaviour in VIRTUAL storport miniport
driver or am I doing something wrong?

Thanks,
Nirranjan.K

Thanks Jan!

You are right! I am receiving SCSI_PNP_REQUEST_BLOCK in HwStorStartIo. Now I am able to do error handling properly.

-nirranjan