Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. USB "lockout" when connecting and disconnecting HID device

USB "lockout" when connecting and disconnecting HID device

Scheduled Pinned Locked Moved Hardware & Devices
helpquestioncomdata-structurestools
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dybs
    wrote on last edited by
    #1

    What is the best way to go about debugging this issue (in addition to google?) When we unplug and replug a custom HID device enough times on a low-ish-end machine (XP Pro SP3), Windows stops recognizing new USB connects and disconnects on any USB port (any device class). We turned on the Driver Verifier, and got a 0xC9 bugcheck (DRIVER_VERIFIER_IOMANAGER_VIOLATION), with an error code of 0x21D (An IRP dispatch handler has not properly detached from the stack below it upon receiving a remove IRP - Not entirely sure what that means, but from what I've read on MSDN (See Summary of Guidelines for Pending IRPs)[^], it looks like something is keeping the "post-processing" from running on a disconnect). The driver file that was referenced is HIDCORE.SYS (I think...I didn't actually see the error, this is what my colleague told me). We are using the HID driver built into Windows. The problem only occurs when a utility we wrote is running that sends a few commands to the device. While this utility is running, we can connect and disconnect the device any from 3 to 30 times before the USB "locks up". Any connected devices still work, but no new connect/disconnect events are recognized. It's most reproducible on lower-end machines, but will occasionally happen on a medium-end PC. The only way out of this is to reboot. We've made sure we're closing all our file handles to the device when we get a disconnect event. We don't have a whole lot of experience debugging low-level driver-related problems. Any suggestions would be greatly appreciated. I'm sure there's some bit of information I'm missing, but any suggestions would be greatly appreciated. Dybs

    The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen

    L 1 Reply Last reply
    0
    • D dybs

      What is the best way to go about debugging this issue (in addition to google?) When we unplug and replug a custom HID device enough times on a low-ish-end machine (XP Pro SP3), Windows stops recognizing new USB connects and disconnects on any USB port (any device class). We turned on the Driver Verifier, and got a 0xC9 bugcheck (DRIVER_VERIFIER_IOMANAGER_VIOLATION), with an error code of 0x21D (An IRP dispatch handler has not properly detached from the stack below it upon receiving a remove IRP - Not entirely sure what that means, but from what I've read on MSDN (See Summary of Guidelines for Pending IRPs)[^], it looks like something is keeping the "post-processing" from running on a disconnect). The driver file that was referenced is HIDCORE.SYS (I think...I didn't actually see the error, this is what my colleague told me). We are using the HID driver built into Windows. The problem only occurs when a utility we wrote is running that sends a few commands to the device. While this utility is running, we can connect and disconnect the device any from 3 to 30 times before the USB "locks up". Any connected devices still work, but no new connect/disconnect events are recognized. It's most reproducible on lower-end machines, but will occasionally happen on a medium-end PC. The only way out of this is to reboot. We've made sure we're closing all our file handles to the device when we get a disconnect event. We don't have a whole lot of experience debugging low-level driver-related problems. Any suggestions would be greatly appreciated. I'm sure there's some bit of information I'm missing, but any suggestions would be greatly appreciated. Dybs

      The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Is your app registering for device plug and play events using RegisterDeviceNotification? And dont forgwet its a two stage, first you register for events by device classm then by handle when your device arrives. Faiing to handle this wil screw up the windows plug and play state and leave drivers locked in memory (which is what you have here).

      "It is a remarkable fact that despite the worldwide expenditure of perhaps US$50 billion since 1990, and the efforts of tens of thousands of scientists worldwide, no human climate signal has yet been detected that is distinct from natural variation." Bob Carter, Research Professor of Geology, James Cook University, Townsville

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups