guys, I have a USB composite device with 2 interfaces(one keyboard and one smartcard). I redirect it to a remote machine with usb port level redirection. Sometimes, the keyboard becomes unusable in remote machine. The device manager shows “no drivers are installed for the device” for the keyboard interface.
Windbg output shows that it got stuck in DeviceNodeDriversAdded state.
kd> !devstack 0x84bc2d08
!DevObj !DrvObj !DevExt ObjectName
84d9d538 \Driver\kbdclass 84d9d5f0 KeyboardClass2
84c7dcf0 \Driver\vmkbd 84c7dda8
84e47020 \Driver\kbdhid 84e470d8
84bc2d08 \Driver\HidUsb 84bc2dc0 000000b0
!DevNode 84d60ca8 :
DeviceInst is “HID\VID_03F0&PID_1024&MI_00\4&11cb298&0&0000”
ServiceName is “kbdhid”
kd> !DevNode 84d60ca8
DevNode 0x84d60ca8 for PDO 0x84bc2d08
Parent 0x851c5670 Sibling 0000000000 Child 0000000000
InstancePath is “HID\VID_03F0&PID_1024&MI_00\4&11cb298&0&0000”
ServiceName is “kbdhid”
State = DeviceNodeDriversAdded (0x303)
Previous State = DeviceNodeInitialized (0x302)
StateHistory[01] = DeviceNodeInitialized (0x302)
StateHistory[00] = DeviceNodeUninitialized (0x301)
StateHistory[19] = Unknown State (0x0)
StateHistory[18] = Unknown State (0x0)
StateHistory[17] = Unknown State (0x0)
StateHistory[16] = Unknown State (0x0)
StateHistory[15] = Unknown State (0x0)
StateHistory[14] = Unknown State (0x0)
StateHistory[13] = Unknown State (0x0)
StateHistory[12] = Unknown State (0x0)
StateHistory[11] = Unknown State (0x0)
StateHistory[10] = Unknown State (0x0)
StateHistory[09] = Unknown State (0x0)
StateHistory[08] = Unknown State (0x0)
StateHistory[07] = Unknown State (0x0)
StateHistory[06] = Unknown State (0x0)
StateHistory[05] = Unknown State (0x0)
StateHistory[04] = Unknown State (0x0)
StateHistory[03] = Unknown State (0x0)
StateHistory[02] = Unknown State (0x0)
Flags (0x2c000030) DNF_ENUMERATED, DNF_IDS_QUERIED,
DNF_NO_LOWER_DEVICE_FILTERS, DNF_NO_LOWER_CLASS_FILTERS,
DNF_NO_UPPER_DEVICE_FILTERS
CapabilityFlags (0x00000281) DeviceD1, SilentInstall,
SurpriseRemovalOK
When the device works correctly, its output is something like:
kd> !devnode 85293180
DevNode 0x85293180 for PDO 0x86749600
Parent 0x851c5670 Sibling 0000000000 Child 0000000000
InstancePath is “HID\VID_03F0&PID_1024&MI_00\4&11cb298&0&0000”
ServiceName is “kbdhid”
TargetDeviceNotify List - f 0xa20eef48 b 0xa5b39358
State = DeviceNodeStarted (0x308)
Previous State = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[12] = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[11] = DeviceNodeEnumeratePending (0x30c)
StateHistory[10] = DeviceNodeStarted (0x308)
StateHistory[09] = DeviceNodeEnumerateCompletion (0x30d)
StateHistory[08] = DeviceNodeEnumeratePending (0x30c)
StateHistory[07] = DeviceNodeStarted (0x308)
StateHistory[06] = DeviceNodeStartPostWork (0x307)
StateHistory[05] = DeviceNodeStartCompletion (0x306)
StateHistory[04] = DeviceNodeStartPending (0x305)
StateHistory[03] = DeviceNodeResourcesAssigned (0x304)
StateHistory[02] = DeviceNodeDriversAdded (0x303)
StateHistory[01] = DeviceNodeInitialized (0x302)
StateHistory[00] = DeviceNodeUninitialized (0x301)
StateHistory[19] = Unknown State (0x0)
StateHistory[18] = Unknown State (0x0)
StateHistory[17] = Unknown State (0x0)
StateHistory[16] = Unknown State (0x0)
StateHistory[15] = Unknown State (0x0)
StateHistory[14] = Unknown State (0x0)
StateHistory[13] = Unknown State (0x0)
Flags (0x2c000130) DNF_ENUMERATED, DNF_IDS_QUERIED,
DNF_NO_RESOURCE_REQUIRED, DNF_NO_LOWER_DEVICE_FILTERS,
DNF_NO_LOWER_CLASS_FILTERS, DNF_NO_UPPER_DEVICE_FILTERS
UserFlags (0x00000008) DNUF_NOT_DISABLEABLE
CapabilityFlags (0x00000281) DeviceD1, SilentInstall,
SurpriseRemovalOK
DisableableDepends = 1 (including self)
kd> !devobj 86749600
Device object (86749600) is for:
000000b6 \Driver\HidUsb DriverObject 85215550
Current Irp 00000000 RefCount 1 Type 00000022 Flags 00003050
Dacl 89a5a9e0 DevExt 867496b8 DevObjExt 867498b8 DevNode 85293180
ExtensionFlags (0x00000800) DOE_DEFAULT_SD_PRESENT
Characteristics (0x00000080) FILE_AUTOGENERATED_DEVICE_NAME
AttachedDevice (Upper) 84ba2240 \Driver\kbdhid
Device queue is not busy.
kd> !devstack 86749600
!DevObj !DrvObj !DevExt ObjectName
84e3ae28 \Driver\kbdclass 84e3aee0 KeyboardClass2
851bb710 \Driver\vmkbd 851bb7c8
84ba2240 \Driver\kbdhid 84ba22f8
86749600 \Driver\HidUsb 867496b8 000000b6
!DevNode 85293180 :
DeviceInst is “HID\VID_03F0&PID_1024&MI_00\4&11cb298&0&0000”
ServiceName is “kbdhid”
The difference I see is that, in working case, the PNP state is DeviceNodeStarted (0x308). In failure case, the pnp state is DeviceNodeDriversAdded (0x303).
In the failure case, a 'scan for hardware changes" in device manager will hang.