I'm working on a driver for a USB device based on the Cypress FX2 chip for
WinXP Pro. The driver is based largely on the bulkusb example in the DDK
(W2k3 version). In the course of testing, I turned on Driver Verifier not
only for my (function) driver, but for the bus driver (usbhub.sys) (maybe
that was my first mistake...).
When running the pnpdtest.exe stress test option, with low-resource
simulation turned on, I get a lot of WDM driver errors, code-coverage
breakpoints, and even bug checks (0xC9, code 0x21E) in usbhub.sys (but none
in my driver). Call this Case 1.
If verifier is OFF for usbhub.sys, the only problem is that at some point my
driver will fail, for example, in DriverEntry (cannot allocate memory to
store the registry string), and pnpdtest will try in vain to connect. But no
bug checks. After the test is terminated, the device can be unplugged and
replugged, and things start up agin ok. Call this Case 2.
If low-resource simulation is off, everything is perfect, even if usbhub.sys
is verified too. Call this Case 3.
Any ideas what is going on? Do I need to worry about this, or can I just
turn off the extra verifier settings (like Case 3) and proceed?
Thanks in advance!
A sample debug session output for case 1 follows (Tecusb.SYS is my driver):
----------------------------------------------------------------------
Tecusb.SYS: exit Tecusb_ConfigureDevice (0)
PNPFILTR: Completing Start request with status == 0x2 PDO = 0x82f2b648
PNPFILTR: Received IRP_MN_QUERY_PNP_DEVICE_STATE for stack with PDO 0x82f2b648
PNPFILTR: Completing IRP_MN_QUERY_PNP_DEVICE_STATE for PDO 0x82f2b648 with
status 0x0 and information 0x0
PNPFILTR: Passing down unhandled POWER IRP - minor function = 0xff
PNPFILTR: Passing down unhandled PNP IRP - minor function = 0xff
PNPFILTR: Received IRP_MN_QUERY_REMOVE_DEVICE for stack with PDO 0x82f2b648
PNPFILTR: FilterQueryRemove returning 0x4 for stack with PDO 0x82f2b648
PNPFILTR: Received IRP_MN_REMOVE_DEVICE for stack with PDO 0x82f2b648
'xMP.SYS: port[1] disable (1) 1005
PNPFILTR: FilterRemove returning 0x4 for stack with PDO 0x82f2b648
USBH: Code coverage trap d:\xpsprtm\drivers\wdm\usb\driver\hub.pnp\usbhub.c
line: 6095
Break instruction exception - code 80000003 (first chance)
nt!DbgBreakPoint:
80aba260 cc int 3
kd>
*******************************************************************************
*
* This is the string you add to your checkin description
* Driver Verifier: Enabled for tecsa.sys on Build 2600 XPKRxPSwxwFS0kpto2QjwD
*******************************************************************************
\Driver\TecusbSA running with DDK+ enabled
PNPFILTR: Received IRP_MN_START_DEVICE for stack with PDO 0x82f2b648
'xMP.SYS: port[1] reset (1) 1101
'xMP.SYS: port[1] reset (3) 1005
'xMP.SYS: port[1] reset (4) 1005
USBHUB.SYS: 'port 1 failed to reset --> retry
USBHUB.SYS: 'device still present -- retry reset
'xMP.SYS: port[1] reset (1) 1101
{snip}
USBHUB.SYS: '-->device removed during reset
USBHUB.SYS: 'Warning: device/port reset failed
USBHUB: Warning **************************************************************
USB device failed first reset attempt in USBH_RestoreDevice
******************************************************************************
'xMP.SYS: port[1] reset (1) 1101
'xMP.SYS: port[1] reset (3) 1005
{snip}
'xMP.SYS: port[1] reset (4) 1005
USBHUB.SYS: 'port 1 failed to reset --> retry
USBHUB: Warning **************************************************************
Port RESET timed out --> this is bad
******************************************************************************
USBHUB.SYS: 'Warning: device/port reset failed
'xMP.SYS: port[1] reset (1) 1101
{snip}
USBHUB.SYS: 'Warning: device/port reset failed
USBHUB.SYS: 'Warning: device/port restore failed
PNPFILTR: Completing Start request with status == 0xc000009a PDO = 0x82f2b648
PNPFILTR: Received IRP_MN_REMOVE_DEVICE for stack with PDO 0x82f2b648
PNPFILTR: FilterRemove returning 0x4 for stack with PDO 0x82f2b648
***********************************************************************
* THIS VALIDATION BUG IS FATAL AND WILL CAUSE THE VERIFIER TO HALT *
* WINDOWS (BUGCHECK) WHEN THE MACHINE IS NOT UNDER A KERNEL DEBUGGER! *
***********************************************************************
WDM DRIVER ERROR: [usbhub.sys @ 0xF73A593E] An IRP dispatch handler has not
properly deleted it's device object upon receiving a
remove IRP. DeviceObject = 82F2B648 - Dispatch = F73A593E
- Irp = 83768F48
IRP_MJ_PNP.IRP_MN_REMOVE_DEVICE -
[ DevObj=00000000, FileObject=00000000, Parameters=00000000 00000000
00000000 00000000 ]
http://www.microsoft.com/hwdq/bc/default.asp?os=5.1.2600&major=0xc9&minor=0x21e&lang=0x9
--
C Gregory
Tecmag, Inc.