• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 927
  • Last Modified:

Driver for Joystick Device

I have a piece of hardware (a joystick) that connects to the PC through the USB port.  There is a dll interface that talks to the joystick.  

When I plug the device in, the drivers install, and I am able to communicate with the device using the interfaces in the dlls (eg, WriteDevice(), ReadDevice(), etc).  This works fine.

My problem is, I want the device to be installed in the Game Controllers section of the Control Panel.  In other words, I don't want to have to write special code to use this joystick, I want to use it like any other joystick device.  

I assume I will have to write a driver layer to go between Windows and the dlls I'm using now to talk to the device.

I have bought "Programming the Microsoft WDM" and have searched everywhere on the net, but cannot find any information on how I should go about this.  The 2000 DDK comes with source code for HID devices, but this device is not HID compliant.

So, if anyone could provide me some direction, that would be great, eg what steps do I need to take?  Source code examples would be even better.

Just so you know your audience:  I know Win32 API programming very well, and am experienced with MASM32 assembly programming, but have never coded anything at the kernel level before, so I'm not even sure what direction to go in with a problem like this.


  • 2
  • 2
1 Solution
I would expect that an USB joystick identifies itself as a HID joystick from its firmware. Windows can handle such devices with its HID class drivers.
It may be that the drivers which you installed manipulate the identification of the device so it is not identified anymore as a HID joystick.

Try uninstalling the driver assignment by deleting the device while plugged in through the device manager.
After that the device is handled as if it has never been plugged to your computer.
Now find the INF file for your device and delete it because on next plug it would reinstall the drivers. do not forget to delete the PNF file also.

Plug the joystick and let Windows install its standard drivers.
Now have a look if it shows up in game controllers.

Access to a HID joystick is possible through the standard HID API, but Direct Input will read it also and will get a copy of the data.
I suspect that is the reason for hiding the device from the Game Controllers.
teleplayrAuthor Commented:
robert:  Thanks, but as I wrote in my first post, the device is NOT HID compliant.  I have contacted the manufacturer of the chip I am using, and there is no way to change the HID descriptor to make it detect as an HID device.  Which is why I want to write this driver to install it into the control panel.

So, I know why it is not getting installed into the control panel.  I want to write a driver to put it there.  I know it can be done, because my MS Sidewinder gameport joystick is not a HID device and it shows up there.
It should be possible to make the device HID through driver. You will have to place a USB filter driver which creates the HID descriptor on the fly.
This is a job for a driver expert which i am not.
I recomment the drivers newsgroup of Microsoft msnews.microsoft.com microsoft.public.development.device.drivers and the USB IF forum http://www.usb.org/phpbb/viewforum.php?f=1
teleplayrAuthor Commented:
Since you're the only one nice enough to answer, points for ya :)

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now