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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. USB mass storage vs USB HID

USB mass storage vs USB HID

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiohelptutorialquestion
4 Posts 2 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.
  • S Offline
    S Offline
    Subrat Patnaik
    wrote on last edited by
    #1

    hi all, i have an application which requires to monitor USB activities(only USB mass storage devices). i need a small help on how to differentiate between USB mass storage devices and USB Mouse/Keyboard/Printer (USB HUMAN INTERFACE DEVICES) etc... could it be done through device ID?? some code will help a great deal... Thank You all.

    _ 1 Reply Last reply
    0
    • S Subrat Patnaik

      hi all, i have an application which requires to monitor USB activities(only USB mass storage devices). i need a small help on how to differentiate between USB mass storage devices and USB Mouse/Keyboard/Printer (USB HUMAN INTERFACE DEVICES) etc... could it be done through device ID?? some code will help a great deal... Thank You all.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      In USB terminology, an interface is what we normally would call a device. For example, a printer can have a scanner and mass storage in a single unit. Each interface has a property called an interface class. For mass storage, this property will have a value of 8. You can see a list here - http://www.usb.org/developers/defined_class[^] You can get this by reading the configuration descriptor of the device.

      «_Superman_»
      I love work. It gives me something to do between weekends.

      Microsoft MVP (Visual C++)

      Polymorphism in C

      S 1 Reply Last reply
      0
      • _ _Superman_

        In USB terminology, an interface is what we normally would call a device. For example, a printer can have a scanner and mass storage in a single unit. Each interface has a property called an interface class. For mass storage, this property will have a value of 8. You can see a list here - http://www.usb.org/developers/defined_class[^] You can get this by reading the configuration descriptor of the device.

        «_Superman_»
        I love work. It gives me something to do between weekends.

        Microsoft MVP (Visual C++)

        Polymorphism in C

        S Offline
        S Offline
        Subrat Patnaik
        wrote on last edited by
        #3

        Hi _Superman_, i already know the device descriptor properties... however, if i could get some code help it would be great....code on how to enumerate the base class of a USB device....

        _ 1 Reply Last reply
        0
        • S Subrat Patnaik

          Hi _Superman_, i already know the device descriptor properties... however, if i could get some code help it would be great....code on how to enumerate the base class of a USB device....

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          The interface class is one of the fields in the interface descriptor. The field name is bInterfaceClass. So after you get the interface descriptor, check if bInterfaceClass is 8 for Mass Storage.

          «_Superman_»
          I love work. It gives me something to do between weekends.

          Microsoft MVP (Visual C++)

          Polymorphism in C

          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