I have a device named
\.\ezusb-0
and associated with that name there is another name that looks like:
\?\USB#Vid_0547&Pid_1002#6&37364359&0&3#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
and which I want.
How do I use what I have, to get what I want?
Eric
The first (\.\exusb-0<file:>) is the traditional pre win2k symbolic link that is not generically discoverable. You have to know that it is there to open it (or have some proprietary way to find it like enumerating values in a well known reg key). You also do not know when they arrive or disappear.
The latter (\?\USB#<file:>…) is also a symbolic linke, but a symbolic link that is generated by pnp on behalf of a device driver. It is a device interface link (and should be regarded as opaque and different from machine to machine). A device interface link can be enumerated by using setupapi functions (SetupDiEnumDeviceInterfaces) in a generic fashion (as long as you know the device interface guid). Furthermore you can be notified of their arrival and departure dynamically (RegisterDeviceNotification).
These 2 styles of links are not cross correlated. There is no way to generically match them up. Why do you want to do that? Typicall you use one or the other. For a pnp device which can come and go, the device interface way is usually the best.
d
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Eric Fowler
Sent: Monday, November 12, 2007 2:43 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to map between device names
I have a device named
\.\ezusb-0
and associated with that name there is another name that looks like:
\?\USB#Vid_0547&Pid_1002#6&37364359&0&3#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
and which I want.
How do I use what I have, to get what I want?
Eric
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</file:></file:>
Eric Fowler wrote:
I have a device named
\.\ezusb-0
and associated with that name there is another name that looks like:
\?\USB#Vid_0547&Pid_1002#6&37364359&0&3#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
and which I want.
How do I use what I have, to get what I want?
It’s an interesting question, because folks almost always want to do the
reverse. The Cypress utilities, for example, always use the EzUsb-X
names to open the device. What leads you to want to do this?
Also remember that you MUST change the VID and PID to numbers that
belong to your company before releasing this device into the wild.
0547-1002 is the generic VID and PID for an unconfigured FX2 device. It
belongs to Cypress, and you are not allowed to use it.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Thanks.
I am working on some legacy code that opens devices using the old symlink
and stores some device information indexed on the symlink, then handles
device notifications later. I need to be able to figure out which symlink
goes with which pnp style name so when the notification comes in I can do a
lookup.
I figure one way is to use the symlink or device handle to get the full pnp
name but am not sure how to do that. I have been staring at the SetupDi*()
functions for a while but it’s not real clear.
Eric
On Nov 12, 2007 2:51 PM, Doron Holan wrote:
> The first (\.\exusb-0) is the traditional pre win2k symbolic link that
> is not generically discoverable. You have to know that it is there to open
> it (or have some proprietary way to find it like enumerating values in a
> well known reg key). You also do not know when they arrive or disappear.
>
>
>
> The latter (\?\USB#…) is also a symbolic linke, but a symbolic link
> that is generated by pnp on behalf of a device driver. It is a device
> interface link (and should be regarded as opaque and different from machine
> to machine). A device interface link can be enumerated by using setupapi
> functions (SetupDiEnumDeviceInterfaces) in a generic fashion (as long as you
> know the device interface guid). Furthermore you can be notified of their
> arrival and departure dynamically (RegisterDeviceNotification).
>
>
>
> These 2 styles of links are not cross correlated. There is no way to
> generically match them up. Why do you want to do that? Typicall you use
> one or the other. For a pnp device which can come and go, the device
> interface way is usually the best.
>
>
>
> d
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *Eric Fowler
> Sent: Monday, November 12, 2007 2:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How to map between device names
>
>
>
> I have a device named
>
> \.\ezusb-0
>
> and associated with that name there is another name that looks like:
>
>
> \?\USB#Vid_0547&Pid_1002#6&37364359&0&3#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
>
> and which I want.
>
> How do I use what I have, to get what I want?
>
>
> Eric
>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
Actually, being able to “go the other way” would help me in my situation. I
need to build a bridge, and don’t care which end I start at.
The device are for now being kept in guarded cages. But we will tame them
before we turn them loose.
Thanks again
Eric
On Nov 12, 2007 3:31 PM, Tim Roberts wrote:
> Eric Fowler wrote:
> > I have a device named
> > \.\ezusb-0
> > and associated with that name there is another name that looks like:
> >
> >
> \?\USB#Vid_0547&Pid_1002#6&37364359&0&3#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
> > and which I want.
> >
> > How do I use what I have, to get what I want?
>
> It’s an interesting question, because folks almost always want to do the
> reverse. The Cypress utilities, for example, always use the EzUsb-X
> names to open the device. What leads you to want to do this?
>
> Also remember that you MUST change the VID and PID to numbers that
> belong to your company before releasing this device into the wild.
> 0547-1002 is the generic VID and PID for an unconfigured FX2 device. It
> belongs to Cypress, and you are not allowed to use it.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
The setupdi* functions really require a device interface path to work. Do you control the driver? If so, you could open up a handle using each instance of each type of name and query for a driver supplied unique “id”. The driver would have to guarantee they are unique between each instance (it could call ExCreateUuid to generate a GUID on startup to generate such a unique value).
d
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Eric Fowler
Sent: Monday, November 12, 2007 3:35 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to map between device names
Thanks.
I am working on some legacy code that opens devices using the old symlink and stores some device information indexed on the symlink, then handles device notifications later. I need to be able to figure out which symlink goes with which pnp style name so when the notification comes in I can do a lookup.
I figure one way is to use the symlink or device handle to get the full pnp name but am not sure how to do that. I have been staring at the SetupDi*() functions for a while but it’s not real clear.
Eric
On Nov 12, 2007 2:51 PM, Doron Holan > wrote:
The first (\.\exusb-0) is the traditional pre win2k symbolic link that is not generically discoverable. You have to know that it is there to open it (or have some proprietary way to find it like enumerating values in a well known reg key). You also do not know when they arrive or disappear.
The latter (\?\USB#…) is also a symbolic linke, but a symbolic link that is generated by pnp on behalf of a device driver. It is a device interface link (and should be regarded as opaque and different from machine to machine). A device interface link can be enumerated by using setupapi functions (SetupDiEnumDeviceInterfaces) in a generic fashion (as long as you know the device interface guid). Furthermore you can be notified of their arrival and departure dynamically (RegisterDeviceNotification).
These 2 styles of links are not cross correlated. There is no way to generically match them up. Why do you want to do that? Typicall you use one or the other. For a pnp device which can come and go, the device interface way is usually the best.
d
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of Eric Fowler
Sent: Monday, November 12, 2007 2:43 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to map between device names
I have a device named
\.\ezusb-0
and associated with that name there is another name that looks like:
\?\USB#Vid_0547&Pid_1002#6&37364359&0&3#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
and which I want.
How do I use what I have, to get what I want?
Eric
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
OK, but - I don’t get it. What is that monster device name I got in the
device notification, and how does it relate to the SetupDi*() functions?
There must be *some* kind of mapping.
Eric
On Nov 12, 2007 11:11 PM, Doron Holan wrote:
> The setupdi* functions really require a device interface path to work.
> Do you control the driver? If so, you could open up a handle using each
> instance of each type of name and query for a driver supplied unique “id”.
> The driver would have to guarantee they are unique between each instance (it
> could call ExCreateUuid to generate a GUID on startup to generate such a
> unique value).
>
>
>
> d
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of Eric Fowler
> Sent: Monday, November 12, 2007 3:35 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] How to map between device names
>
>
>
> Thanks.
>
> I am working on some legacy code that opens devices using the old symlink
> and stores some device information indexed on the symlink, then handles
> device notifications later. I need to be able to figure out which symlink
> goes with which pnp style name so when the notification comes in I can do a
> lookup.
>
> I figure one way is to use the symlink or device handle to get the full
> pnp name but am not sure how to do that. I have been staring at the
> SetupDi() functions for a while but it’s not real clear.
>
> Eric
>
> On Nov 12, 2007 2:51 PM, Doron Holan wrote:
>
> The first (\.\exusb-0) is the traditional pre win2k symbolic link that is
> not generically discoverable. You have to know that it is there to open it
> (or have some proprietary way to find it like enumerating values in a well
> known reg key). You also do not know when they arrive or disappear.
>
>
>
> The latter (\?\USB#…) is also a symbolic linke, but a symbolic link
> that is generated by pnp on behalf of a device driver. It is a device
> interface link (and should be regarded as opaque and different from machine
> to machine). A device interface link can be enumerated by using setupapi
> functions (SetupDiEnumDeviceInterfaces) in a generic fashion (as long as you
> know the device interface guid). Furthermore you can be notified of their
> arrival and departure dynamically (RegisterDeviceNotification).
>
>
>
> These 2 styles of links are not cross correlated. There is no way to
> generically match them up. Why do you want to do that? Typicall you use
> one or the other. For a pnp device which can come and go, the device
> interface way is usually the best.
>
>
>
> d
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *Eric Fowler
> Sent: Monday, November 12, 2007 2:43 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] How to map between device names
>
>
>
> I have a device named
>
> \.\ezusb-0
>
> and associated with that name there is another name that looks like:
>
>
> \?\USB#Vid_0547&Pid_1002#6&37364359&0&3#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
>
> and which I want.
>
> How do I use what I have, to get what I want?
>
>
> Eric
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging
> and other seminars visit: http://www.osr.com/seminars To unsubscribe,
> visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
This device (actually a symlink) name is invented by PnP in the kernel when
the driver calls IoRegisterDeviceInterface and IoSetDeviceInterfaceState(TRUE)
Just use it in CreateFile
–
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
“Eric Fowler” wrote in message news:xxxxx@ntdev…
> OK, but - I don’t get it. What is that monster device name I got in the
> device notification, and how does it relate to the SetupDi*() functions?
> There must be some kind of mapping.
>
> Eric
>
> On Nov 12, 2007 11:11 PM, Doron Holan wrote:
>
> > The setupdi* functions really require a device interface path to work.
> > Do you control the driver? If so, you could open up a handle using each
> > instance of each type of name and query for a driver supplied unique “id”.
> > The driver would have to guarantee they are unique between each instance
(it
> > could call ExCreateUuid to generate a GUID on startup to generate such a
> > unique value).
> >
> >
> >
> > d
> >
> >
> >
> > From: xxxxx@lists.osr.com [mailto:
> > xxxxx@lists.osr.com] *On Behalf Of Eric Fowler
> > Sent: Monday, November 12, 2007 3:35 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] How to map between device names
> >
> >
> >
> > Thanks.
> >
> > I am working on some legacy code that opens devices using the old symlink
> > and stores some device information indexed on the symlink, then handles
> > device notifications later. I need to be able to figure out which symlink
> > goes with which pnp style name so when the notification comes in I can do a
> > lookup.
> >
> > I figure one way is to use the symlink or device handle to get the full
> > pnp name but am not sure how to do that. I have been staring at the
> > SetupDi() functions for a while but it’s not real clear.
> >
> > Eric
> >
> > On Nov 12, 2007 2:51 PM, Doron Holan wrote:
> >
> > The first (\.\exusb-0) is the traditional pre win2k symbolic link that is
> > not generically discoverable. You have to know that it is there to open it
> > (or have some proprietary way to find it like enumerating values in a well
> > known reg key). You also do not know when they arrive or disappear.
> >
> >
> >
> > The latter (\?\USB#…) is also a symbolic linke, but a symbolic link
> > that is generated by pnp on behalf of a device driver. It is a device
> > interface link (and should be regarded as opaque and different from machine
> > to machine). A device interface link can be enumerated by using setupapi
> > functions (SetupDiEnumDeviceInterfaces) in a generic fashion (as long as
you
> > know the device interface guid). Furthermore you can be notified of their
> > arrival and departure dynamically (RegisterDeviceNotification).
> >
> >
> >
> > These 2 styles of links are not cross correlated. There is no way to
> > generically match them up. Why do you want to do that? Typicall you use
> > one or the other. For a pnp device which can come and go, the device
> > interface way is usually the best.
> >
> >
> >
> > d
> >
> >
> >
> > From: xxxxx@lists.osr.com [mailto:
> > xxxxx@lists.osr.com] *On Behalf Of *Eric Fowler
> > Sent: Monday, November 12, 2007 2:43 PM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] How to map between device names
> >
> >
> >
> > I have a device named
> >
> > \.\ezusb-0
> >
> > and associated with that name there is another name that looks like:
> >
> >
> >
\?\USB#Vid_0547&Pid_1002#6&37364359&0&3#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
> >
> > and which I want.
> >
> > How do I use what I have, to get what I want?
> >
> >
> > Eric
> >
> > — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging
> > and other seminars visit: http://www.osr.com/seminars To unsubscribe,
> > visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> > — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
> > other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> > the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
>