I wrote a bus driver that generated virtual USB PDO for Printer, Scanner, and
SmartCard. It worked fine before. Recently, I was requested to provide a
virtual USB mouse PDO. What I did was as following steps
1. An usermode application access bus driver to add a new PDO
2. bus driver use IoCreateDeviceSecure to create a new device and invalid
bus relation.
3. PNP manager found this new device, it will query the hardwareid, device
instanceid, and compatible id.
4. I provide USB\Class_03&SubClass_01&Prot_02 as compatible ID
5. System find this is a HID device and start to query Device Descriptor,
Configuration Descriptor, and HID descriptor.
6. Since this is a virtual mouse, bus driver gives HID descriptor without
hardware. I copy a standard mouse device's HID descriptor (3button usb
mouse) to caller.
7. From Device Manager, I can see a HID device shows up, but there is not
mouse device shows up.
If I plug in a real usb mouse, I can see system create a HID device first,
then HIDClass driver create a PDO for mouhid driver. Is anyting wrong I did?
I have carefully checked the USB data sent to caller, everything is ok, but
system doesn't like this device as mouse, Just consider it as generic USB
HID device.
Could someone give me help?
Thanks!