Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > USB Device_Descriptor

Reply
Thread Tools

USB Device_Descriptor

 
 
koushi007@gmail.com
Guest
Posts: n/a
 
      10-22-2007
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);

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      10-22-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) 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


 
Reply With Quote
 
 
 
 
koushi007@gmail.com
Guest
Posts: n/a
 
      10-23-2007
On Oct 22, 8:11 pm, "Victor Bazarov" <(E-Mail Removed)> wrote:
> (E-Mail Removed) 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!!

 
Reply With Quote
 
red floyd
Guest
Posts: n/a
 
      10-23-2007
(E-Mail Removed) wrote:
> On Oct 22, 8:11 pm, "Victor Bazarov" <(E-Mail Removed)> wrote:
>> (E-Mail Removed) 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.
 
Reply With Quote
 
Kai-Uwe Bux
Guest
Posts: n/a
 
      10-23-2007
(E-Mail Removed) wrote:

> On Oct 22, 8:11 pm, "Victor Bazarov" <(E-Mail Removed)> wrote:
>> (E-Mail Removed) 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
 
Reply With Quote
 
koushi007@gmail.com
Guest
Posts: n/a
 
      10-23-2007
On Oct 23, 10:42 am, Kai-Uwe Bux <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > On Oct 22, 8:11 pm, "Victor Bazarov" <(E-Mail Removed)> wrote:
> >> (E-Mail Removed) 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!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable usb-storage not usb-mouse? mc??? MCSD 2 08-31-2006 01:48 PM
Re: USB issue ... some USB 2 ports working only in USB 1 mode hungsolo2005@yahoo.com A+ Certification 0 06-14-2006 07:26 PM
Swissbit Cirrus WHITE USB 512mb USB Drive @ ThinkComputers.org Silverstrand Front Page News 0 01-20-2006 02:49 AM
Connecting Two PCs Using an USB-USB Cable Silverstrand Front Page News 0 11-16-2005 09:51 PM
USB High Speed against USB Non High Speed DannyD1355 Computer Support 1 09-07-2003 02:59 AM



Advertisments