At USB port detection

Hi All,
can anyone tell me how can we differentiate between a pan(flash)
drive is attach at USB port OR a media player(like ipod) is attached, either
at Driver level or at Application level???

Thanks in advance…

Manish K. Sharma

Life is Small and Lots of Things to Learn
Lets Share the Knowledge

Manish Sharma wrote:

Hi All,
can anyone tell me how can we differentiate between a
pan(flash) drive is attach at USB port OR a media player(like ipod) is
attached, either at Driver level or at Application level???

Given what? What I mean is, are you asking how to determine what the
device is, based on the drive letter? That has turned into one of the
more frequently asked questions recently, and there is no good answer.
There is no generic way to answer the question I think you are asking.
You can go registry-diving to find out the USB VID and PID of the
device, but that only helps if you know what the VID and PID mean.

I think this is a case of over-abstraction on the part of Microsoft.
They would like us to treat all mass storage devices like mass storage
devices, but there really are legitimate reasons for knowing more about
the precise device I’m working with. One of my clients makes a series
of cameras; some of them implement their picture storage as a custom
pipe on their capture device, while others implement picture storage as
a USB mass storage device. They asked me to write a generic downloader
application that would automatically download pictures from any of their
devices, regardless of storage method. In the end, I had to go registry
diving (and relying on those undocumented PnP strings) in order to find
out whether the client’s device was attached, and what drive letter it
happened to be. It shouldn’t have to be so hard. All the information
is there.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

The device could always store a marker file in the file system that told
you what it was.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, December 20, 2006 11:49 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] At USB port detection

Manish Sharma wrote:

Hi All,
can anyone tell me how can we differentiate between a
pan(flash) drive is attach at USB port OR a media player(like ipod) is
attached, either at Driver level or at Application level???

Given what? What I mean is, are you asking how to determine what the
device is, based on the drive letter? That has turned into one of the
more frequently asked questions recently, and there is no good answer.
There is no generic way to answer the question I think you are asking.
You can go registry-diving to find out the USB VID and PID of the
device, but that only helps if you know what the VID and PID mean.

I think this is a case of over-abstraction on the part of Microsoft.
They would like us to treat all mass storage devices like mass storage
devices, but there really are legitimate reasons for knowing more about
the precise device I’m working with. One of my clients makes a series
of cameras; some of them implement their picture storage as a custom
pipe on their capture device, while others implement picture storage as
a USB mass storage device. They asked me to write a generic downloader
application that would automatically download pictures from any of their
devices, regardless of storage method. In the end, I had to go registry
diving (and relying on those undocumented PnP strings) in order to find
out whether the client’s device was attached, and what drive letter it
happened to be. It shouldn’t have to be so hard. All the information
is there.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

No difference. Both are USB storage.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

“Manish Sharma” wrote in message news:xxxxx@ntdev…
> Hi All,
> can anyone tell me how can we differentiate between a pan(flash)
> drive is attach at USB port OR a media player(like ipod) is attached, either
> at Driver level or at Application level???
>
> Thanks in advance…
> –
> Manish K. Sharma
>
> Life is Small and Lots of Things to Learn
> Lets Share the Knowledge
>