Modifying PnP device drivers
This post is related to an earlier one I sent almost one year ago trying
to get information from a USB mouse to be used as an optical encoder. In
the mean time I was reading a lot about hacking a mouse and just came to
the conclusion that my mouse is a pure USB mouse not able to be used on
PS/2 interfaces (with the famous old green USB to PS/2 converter block).
My USB mouse announces itself to the PC to which it is connected as a
mouse. On the USB buss I understand that it sends it device ID and the
Plug-and-Play system links to the device ID a driver. The driver is a
piece of code that is able to communicate to the mouse and get a lot of
information from it, including the dX and dY (changes in X and Y position)
I need to get out.
The driver contains specific codes for registers to be used in the
specific case of a mouse using a particular image sensor. For USB mice the
datasheet (see for instance the ADNS 5000 optical mouse sensor datasheet)
lists the series of packets to be sent to the mouse over USB and what the
reaction of the mouse is.
During my previous exchange on this subject it was stated that the only
way out was trying to modify the controller in the mouse in a way that it
no longer announces itself as a mouse. This is impossible because I
understood after some reading that Windows OS concludes that a mouse is
talking from the Device and Hardware ID sent from the mouse over the USB
bus to the PC. Wit these two IDs the OS is able to find the required
driver.
When I am able to modify the driver linked to the mouse connected as
ENCODER then I can obtain dX and dY information (and may be also the
picture frame) from the mouse but not passing this info on to the RAW
INPUT API to be used as mouse-derived info but to another piece of
software developed by me for managing the mice as encoders.
Does this makes sense you think? Where can I find information about
programming drivers used for PnP?
Thanks in advance,
Stefan
No comments:
Post a Comment