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. C / C++ / MFC
  4. Getting VID and PID from device using UsbSer

Getting VID and PID from device using UsbSer

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminjsonperformancequestionworkspace
1 Posts 1 Posters 0 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.
  • R Offline
    R Offline
    Roger Stoltz
    wrote on last edited by
    #1

    I'm struggling with some USB devices that work like a serial devices. The driver used is UsbSer.sys. So I register for device notifications and in OnDeviceChange() I get the "filename" for the device so I can open it with ::CreateFile(). I now need a way to get the vendor and product ids from the device, preferably by using ::DeviceIoControl() or the Setup API. Actually it's a composite device so it registers as a few different devices. This means I can access it using different drivers, using different "filenames", but it should be used as a serial device. Even if I got the vendor id by using another device class I haven't found a way to map that device to the serial driver for the same device. Is there some I/O control code or a neat method using the setup API I've overlooked, I would be most grateful to be pointed in the right direction. Previously the "filename" has been parsed since it seemed to be built using the vendor and product ids, but this method breaks when the device presents itself as a composite device. So I assume using the registry is not the way to do it. Ideas anyone?

    "It's supposed to be hard, otherwise anybody could do it!" - selfquote
    "High speed never compensates for wrong direction!" - unknown

    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