Changing USB device credentials

Hi All!

I’m trying to write a driver that will monitor USB bus and when some
device is attached to a specific hub, I want to replace vendor ID and
model ID of this device by some constant (so windows will load my
driver instead of the driver for this device). To do this, I want to
catch
a first Get Device Descriptor sent to the device. How do I do this?
I tried to do this using lower class driver, but it only monitors
transfers after PDO is already created.

Do anyone has an idea how can I monitor device enumeration process?

Umm, wasn’t there a thread on exactly this, just a few days ago? Just read those responses.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@cellebrite.com
Sent: Friday, September 08, 2006 10:38 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Changing USB device credentials

Hi All!

I’m trying to write a driver that will monitor USB bus and when some device is attached to a specific hub, I want to replace vendor ID and model ID of this device by some constant (so windows will load my driver instead of the driver for this device). To do this, I want to catch a first Get Device Descriptor sent to the device. How do I do this?
I tried to do this using lower class driver, but it only monitors transfers after PDO is already created.

Do anyone has an idea how can I monitor device enumeration process?


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

xxxxx@cellebrite.com wrote:

Hi All!

I’m trying to write a driver that will monitor USB bus and when some
device is attached to a specific hub, I want to replace vendor ID and
model ID of this device by some constant (so windows will load my
driver instead of the driver for this device).

Why don’t you just change your INF file to match the actual VID and PID
of the device? That’s a much simpler solution than modifying
descriptors on the fly. The host controller/hub exchange protocol is
not documented.


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


Arlie Davis
xxxxx@microsoft.com

Join Date: 03 May 2006
Posts To This List: 36
RE: Changing USB device credentials
Umm, wasn’t there a thread on exactly this, just a few days ago? Just read those responses.

I believe you’re talking about “Creating PDO” thread. This is not exactly what I want. I want to do something much simplier - just to monitor all USB control transfers issued through a specific hub, and change data returned by the device. If I use class filter drivers I get to monitor only transfers that issued after attached device is already enumerated, but I want to monitor the enumeration process itself… Can bus filter help here?


Tim Roberts
xxxxx@probo.com

Join Date: 28 Jan 2005
Posts To This List: 695

Why don’t you just change your INF file to match the actual VID and PID of the device? That’s a much simpler solution than modifying descriptors on the fly. The host controller/hub exchange protocol is not documented.

Because I don’t know actual VID and PID. I want to change credentials of EVERY device connected to a specific hub…

wrote in message news:xxxxx@ntdev…
> I want to monitor the enumeration process itself… Can bus filter help here?
>

VMWare does something like that in order to redirect USB devices to
virtual machines. Have a look at their solution.

—PA

Yep, VMWare does exactly what I want to do. But where can I see their
solution? I have no idea how they
Implemented this.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pavel A.
Sent: Saturday, September 09, 2006 14:59
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Changing USB device credentials

wrote in message news:xxxxx@ntdev…
> I want to monitor the enumeration process itself… Can bus filter help
here?
>

VMWare does something like that in order to redirect USB devices to virtual
machines. Have a look at their solution.

—PA


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

> descriptors on the fly. The host controller/hub exchange protocol is

not documented.

Documented in USB spec, the chapter on hubs.

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

So, does anyone knows how VMWare redirects connected USB devices to it’s
virtual machine? I.e. how it forces windows to load their driver instead of
the driver registered with the device?

I think VMWare emulates the OHCI/UHCI/EHCI hardware.

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

----- Original Message -----
From: “Ilia Lotosh”
To: “Windows System Software Devs Interest List”
Sent: Sunday, September 10, 2006 10:59 PM
Subject: RE: [ntdev] Changing USB device credentials

> So, does anyone knows how VMWare redirects connected USB devices to it’s
> virtual machine? I.e. how it forces windows to load their driver instead of
> the driver registered with the device?
>
>
>
> —
> 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