I’m seeing a problem with a StorPort Miniport where the device context I receive from StorPort has a value of 8.
The context of what’s going on is that I’m running tests with a third party test tool (DriveMaster) and the script in question is issuing a lot of commands that cause my driver to be unloaded and reloaded.
The result of all these resets is eventually I get a StartIo call (for a PnP Remove) that has this goofy device context. However, I already completed a remove, adapter control was called several times, and DriverEntry of the new instance has been called.
I’m wondering if anyone else has experienced something similar and could suggest what I might be doing wrong to cause this to happen. This has the smell of a problem from another thread in the archives although the details are a bit different. http://www.osronline.com/showThread.cfm?link=161318
Here’s a little trace
STORMINI: BuildIo: Exit. return FALSE
STORMINI: BuildIo: Enter.
STORMINI: ExecuteScsi: Enter. SRB=FFFFFA8006866490
STORMINI: ScsiWrite10: Enter.
STORMINI: ScsiWrite: Enter.
STORMINI: BuildScsiMessage: Enter.
STORMINI: BuildScsiMessage: Exit.
STORMINI: ScsiWrite: Exit.
STORMINI: ScsiWrite10: Exit.
STORMINI: ExecuteScsi: Exit. return TRUE
STORMINI: BuildIo: Exit. return FALSE
STORMINI: BuildIo: Enter.
STORMINI: BuildIo: Pass PnP request to StartIO
STORMINI: BuildIo: Exit. return TRUE
STORMINI: StartIo: Enter. SRB Function=0x00000025, SrbStatus=0, TimeoutValue=10
STORMINI: StartIo: pnp action = 2
STORMINI: StartIo: Send halt command
STORMINI: StartIo: Exit. return TRUE
STORMINI: StateChangeIsr: Complete PnP SRB.
STORMINI: AdapterControl: Enter.
STORMINI: AdapterControl: ControlType=1
STORMINI: AdapterControl: Exit. status=0x00000000
STORMINI: AdapterControl: Enter.
STORMINI: AdapterControl: ControlType=0
STORMINI: AdapterControl: Exit. status=0x00000000
STORMINI: AdapterControl: Enter.
STORMINI: AdapterControl: ControlType=3
STORMINI: AdapterControl: Exit. status=0x00000000
STORMINI: DriverEntry: Enter.
STORMINI: DriverEntry: Enter
STORMINI: DriverEntry: Built at Dec 9 2011 09:30:39
STORMINI: DriverEntry: Exit. status=0x00000000
*** Fatal System Error: 0x0000007e
(0xFFFFFFFFC0000005,0xFFFFFA6000E0C5D0,0xFFFFFA6002DD23B8,0xFFFFFA6002DD1D90)
<** The exception is caused by my driver trying to dereference a device context value of 8. **>
SIDisk!StartIo+0xd0 [\startio.c @ 109]
storport!RaidAdapterPostScatterGatherExecute+0x150
storport!RaidPnPPassToMiniPort+0x22c
storport!RaidAdapterReleaseResources+0x35
storport!RaidAdapterRemoveDeviceIrp+0x5f
storport!RaidAdapterPnpIrp+0x127
storport!RaDriverPnpIrp+0x95
nt!IopSynchronousCall+0x10a
nt!IopRemoveDevice+0x101
nt!PnpRemoveLockedDeviceNode+0x1a6
nt!PnpDeleteLockedDeviceNode+0x44
nt!PnpDeleteLockedDeviceNodes+0xa0
nt!PnpProcessQueryRemoveAndEject+0xbe7
nt!PnpProcessTargetDeviceEvent+0x4c
nt! ?? ::NNGAKEGL::string'+0x4e537<br>nt!ExpWorkerThread+0xfb<br>nt!PspSystemThreadStartup+0x57<br>nt!KiStartSystemThread+0x16<br><br>3: kd> dt _SCSI_PNP_REQUEST_BLOCK 0xfffffa800680a810<br>SIDisk!_SCSI_PNP_REQUEST_BLOCK<br> +0x000 Length : 0x58<br> +0x002 Function : 0x25 'Unknown format characterUnknown format control character<br> +0x003 SrbStatus : 0 ''<br> +0x004 PnPSubFunction : 0 ''<br> +0x005 PathId : 0 ''<br> +0x006 TargetId : 0 ''<br> +0x007 Lun : 0 ''<br> +0x008 PnPAction : 2 ( StorRemoveDevice )<br> +0x00c SrbFlags : 0x100<br> +0x010 DataTransferLength : 0<br> +0x014 TimeOutValue : 0xa<br> +0x018 DataBuffer : (null) <br> +0x020 SenseInfoBuffer : (null) <br> +0x028 NextSrb : (null) <br> +0x030 OriginalRequest : 0xfffffa60
08b84010
+0x038 SrbExtension : 0xfffffa60`08b84380
+0x040 SrbPnPFlags : 1
+0x044 Reserved : 0
+0x048 Reserved4 : [16] “”
3: kd> !devnode 0xfffffa8005f96730
DevNode 0xfffffa8005f96730 for PDO 0xfffffa8005f97060
Parent 0xfffffa8005f777b0 Sibling 0000000000 Child 0000000000
State = DeviceNodeStartCompletion (0x306)
Previous State = DeviceNodeStartCompletion (0x306)
StateHistory[18] = DeviceNodeAwaitingQueuedRemoval (0x30f)
StateHistory[17] = DeviceNodeStartCompletion (0x306)
StateHistory[16] = DeviceNodeStartPending (0x305)
StateHistory[15] = DeviceNodeResourcesAssigned (0x304)
StateHistory[14] = DeviceNodeDriversAdded (0x303)
StateHistory[13] = DeviceNodeInitialized (0x302)
StateHistory[12] = DeviceNodeUninitialized (0x301)
StateHistory[11] = DeviceNodeRemoved (0x312)
StateHistory[10] = DeviceNodeQueryRemoved (0x310)
StateHistory[09] = DeviceNodeStarted (0x308)
StateHistory[08] = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[07] = DeviceNodeEnumeratePending (0x30c)
StateHistory[06] = DeviceNodeStarted (0x308)
StateHistory[05] = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[04] = DeviceNodeEnumeratePending (0x30c)
StateHistory[03] = DeviceNodeStarted (0x308)
StateHistory[02] = DeviceNodeStartPostWork (0x307)
StateHistory[01] = DeviceNodeStartCompletion (0x306)
StateHistory[00] = DeviceNodeStartPending (0x305)
StateHistory[19] = DeviceNodeResourcesAssigned (0x304)
Flags (0x00000030) DNF_ENUMERATED, DNF_IDS_QUERIED
CapabilityFlags (0x00000003) DeviceD1, DeviceD2