USB Device_Descriptor

Discussion in 'C++' started by koushi007@gmail.com, Oct 22, 2007.

  1. Guest

    Hi

    I am trying to get the device descriptor of a storage device in order
    to extract the vendor ID and Product ID. In the actual program the
    handle for the device is obtained through another module which gets
    the handle for the user specified mass storage device.



    I had tried to get USB_DEVICE_DESCRIPTOR, DEVICE_DESCRIPTOR using
    IOCTL_GET_USB_DESCRIPTOR and ICOTL_GET_DEVICE_DESCRIPTOR. however both
    the Device IO functions exit with the error "The request is not
    supported".



    Can some one please help me out in getting the Vendor ID and Product
    ID of a storage device?



    Thanks and Regards

    Sundaram



    PS: The portion of the code I have attached



    //DEVICE_DESCRIPTOR

    bResult = DeviceIoControl(hDevice,

    IOCTL_GET_DEVICE_DESCRIPTOR,

    DevDescriptor, sizeof(*DevDescriptor),

    DevDescriptor, sizeof(*DevDescriptor),

    &lpBytesReturned,

    (LPOVERLAPPED) NULL);

    CloseHandle(hDevice);



    //USB_DEVICE_DESCRIPTOR

    ScanDesc.DescriptorType = USB_STRING_DESCRIPTOR_TYPE;

    ScanDesc.Index = 4;

    ScanDesc.LanguageId = 0;

    DevDescriptor->bDescriptorType = USB_STRING_DESCRIPTOR_TYPE;



    bResult = DeviceIoControl(hDevice,

    IOCTL_GET_USB_DESCRIPTOR,

    &ScanDesc, sizeof(ScanDesc),

    DevDescriptor, sizeof(*DevDescriptor),

    &lpBytesReturned,

    (LPOVERLAPPED) NULL);
     
    , Oct 22, 2007
    #1
    1. Advertising

  2. wrote:
    > [..]
    > Can some one please help me out in getting the Vendor ID and Product
    > ID of a storage device?
    > [..]


    Yes, someone in the newsgroup dedicated to your OS programming can.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Oct 22, 2007
    #2
    1. Advertising

  3. Guest

    On Oct 22, 8:11 pm, "Victor Bazarov" <> wrote:
    > wrote:
    > > [..]
    > > Can some one please help me out in getting the Vendor ID and Product
    > > ID of a storage device?
    > > [..]

    >
    > Yes, someone in the newsgroup dedicated to your OS programming can.
    >
    > V
    > --
    > Please remove capital 'A's when replying by e-mail
    > I do not respond to top-posted replies, please don't ask


    I just need to know is there a way to read the product id and vendor
    id.! Not the code snippet!!
     
    , Oct 23, 2007
    #3
  4. red floyd Guest

    wrote:
    > On Oct 22, 8:11 pm, "Victor Bazarov" <> wrote:
    >> wrote:
    >>> [..]
    >>> Can some one please help me out in getting the Vendor ID and Product
    >>> ID of a storage device?
    >>> [..]

    >> Yes, someone in the newsgroup dedicated to your OS programming can.


    > I just need to know is there a way to read the product id and vendor
    > id.! Not the code snippet!!
    >


    Hints:

    1. If the answer to your question is pretty much the same, regardless
    of the language you use (i.e. Delphi, C++, VB) ... it's OT in
    comp.lang.c++. Ask in a newsgroup dedicated to your platform, or in
    comp.programming.*.

    2. If the answer to your question would not make sense on a different
    platform (i.e. Windows vs. Linux), ... it's OT in comp.lang.c++. Ask in
    a newsgroup dedicated to your platform.

    Your question fails both tests. Try a Windows newsgroup or a Linux
    newsgroup.
     
    red floyd, Oct 23, 2007
    #4
  5. Kai-Uwe Bux Guest

    wrote:

    > On Oct 22, 8:11 pm, "Victor Bazarov" <> wrote:
    >> wrote:
    >> > [..]
    >> > Can some one please help me out in getting the Vendor ID and Product
    >> > ID of a storage device?
    >> > [..]

    >>
    >> Yes, someone in the newsgroup dedicated to your OS programming can.
    >>
    >> V
    >> --
    >> Please remove capital 'A's when replying by e-mail
    >> I do not respond to top-posted replies, please don't ask

    >
    > I just need to know is there a way to read the product id and vendor
    > id.! Not the code snippet!!


    The answer to your question topical in this group would be: standard C++ has
    no built-in means of dealing with USB devices. You will need to use a
    non-standard library, which is off-topic in this group.

    That is why Victor directed you to a news group where the topical answer
    would, for instance, include a hint as to which library might be suitable
    and where you could find it.


    Best

    Kai-Uwe Bux
     
    Kai-Uwe Bux, Oct 23, 2007
    #5
  6. Guest

    On Oct 23, 10:42 am, Kai-Uwe Bux <> wrote:
    > wrote:
    > > On Oct 22, 8:11 pm, "Victor Bazarov" <> wrote:
    > >> wrote:
    > >> > [..]
    > >> > Can some one please help me out in getting the Vendor ID and Product
    > >> > ID of a storage device?
    > >> > [..]

    >
    > >> Yes, someone in the newsgroup dedicated to your OS programming can.

    >
    > >> V
    > >> --
    > >> Please remove capital 'A's when replying by e-mail
    > >> I do not respond to top-posted replies, please don't ask

    >
    > > I just need to know is there a way to read the product id and vendor
    > > id.! Not the code snippet!!

    >
    > The answer to your question topical in this group would be: standard C++ has
    > no built-in means of dealing with USB devices. You will need to use a
    > non-standard library, which is off-topic in this group.
    >
    > That is why Victor directed you to a news group where the topical answer
    > would, for instance, include a hint as to which library might be suitable
    > and where you could find it.
    >
    > Best
    >
    > Kai-Uwe Bux- Hide quoted text -
    >
    > - Show quoted text -


    Thank you!
     
    , Oct 23, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SneakerNet

    USB Controller

    SneakerNet, Aug 29, 2003, in forum: VHDL
    Replies:
    0
    Views:
    656
    SneakerNet
    Aug 29, 2003
  2. Om
    Replies:
    3
    Views:
    3,304
    Antti Lukats
    Oct 22, 2003
  3. ALuPin

    USB CRC5 / CRC16

    ALuPin, Jan 8, 2004, in forum: VHDL
    Replies:
    7
    Views:
    15,224
    OutputLogic
    May 22, 2009
  4. galapogos
    Replies:
    4
    Views:
    407
    Kenny McCormack
    May 11, 2007
  5. LittleAlex
    Replies:
    0
    Views:
    456
    LittleAlex
    Sep 15, 2008
Loading...

Share This Page