I have written a usb function driver. if I want any usb device that plugged in my computer load this driver rather than its real driver, what should I do? I only know if I change vid/pid when bus driver create pdo, I can make it. But I don't know if there is a easy way to do it. How to change the bus's behaviour? Can a filter driver make it? The platform is Windows.
Asked
Active
Viewed 863 times
1 Answers
1
Your best bet is to implement a HID (Human Interface Device) driver. By following the HID guidelines, most functionality you need is already supported, without having to write a custom device driver.
Here are some links to get you started:
Using the HID class eases the job of writing USB device drivers
http://www.edn.com/design/communications-networking/4336292/Using-the-HID-class-eases-the-job-of-writing-USB-device-drivers
Touch, Input, and HID: Architecture and Driver Support
http://msdn.microsoft.com/en-us/library/windows/hardware/gg487435.aspx
For redirection over a network, have a look at the FreeRDP project. It's open-source, under the Apache license, so you can pretty much do whatever you want with the code.

cp.engr
- 2,291
- 4
- 28
- 42

Robert Harvey
- 178,213
- 47
- 333
- 501
-
thanks for your answer, but what my program to do is redirect usb, that is, plugged in one computer and use in another computer. I need a custom fuction driver to deal with the usb request from the remote pc. – Jack Oct 16 '12 at 03:06
-
If you're connecting a computer to another computer, you need [more than just a software driver.](http://en.kioskea.net/faq/342-connecting-two-computers-with-a-usb-cable) – Robert Harvey Oct 16 '12 at 03:09
-
I transmit urb request via internet; each computer has a driver. – Jack Oct 16 '12 at 03:13
-
I think you need to tell us a little bit more about what you are trying to do. – Robert Harvey Oct 16 '12 at 03:13
-
to write a program like this product. http://www.incentivespro.com/usb-redirector.html – Jack Oct 16 '12 at 03:19
-
Well, why don't you study [this code](https://github.com/FreeRDP/FreeRDP)? It's released under the Apache license, so if you like it, you can adapt it to your application. – Robert Harvey Oct 16 '12 at 03:25
-
how to transmit data is not a problem(via tcp or rdp is fine), the problem is how to deal with data from the remote pc. it needs a driver to sumbit request to the bus, and get response. my question is how to make the device load my custom driver automatic – Jack Oct 16 '12 at 03:44
-
A problem that I'm confident that the FreeRDP project will show you how to solve. – Robert Harvey Oct 16 '12 at 03:44