I'm trying to write a force feedback driver for a custom joystick that
is not connected through a USB port.
I've adapted the vhidmini example from the 2003 DDK and copied a report
descriptor from an existing joystick.
I'm using this setup:
* 2003 DDK
* Testing on a Windows 2000 professional and a Windows XP professional
machine.
* DevicesArePolled is set to TRUE in my driver.
The joystick driver works great. DirectX enumerates it as a force
feedback joystick and starts to poll it for it's positions as soon as I
start one of the joystick samples from the DirectX SDK.
Now to my problems:
If I register my own driver as the joysticks force feedback driver.
DirectX sends force commands to the driver perfectly (I'm using the
ffdrv1 example from the DDK here) but for some reason DirectX stops
polling my kernel mode driver for the position of the joystick.
If I stick with the default force feedback driver (pid.dll) the polling
works fine. I get a couple of feature report requests for my "pid pool
report" and then a couple of write reports to my "PID Device Control
Report" and "Set Device Gain Report" but I never get any other calls
from DirectX. The Joystick that I copied the report descriptor from
doesn't use pid.dll so I suspect that the report descriptor isn't 100%
compatible with pid.dll and therefore pid.dll doesn't know how to send
the forces to my kernel mode driver.
The debug output from DirectX shows an error "Device is not acquired in
exclusive mode" when I use pid.dll as force feedback driver.
I'm using a standard example from the DirectX SDK to test that works
fine for the other joystick.
I've not opened any handle to the driver from any other application.
The joystick looks fine both in DXDiag and DX Caps Viewer.
My questions:
* Why does DirectX stop to poll my joystick for it's positions when I
use a custom Force Feedback driver? To register a custom Force Feedback
driver I simply change the CLSID under the OEMForceFeedback of my
joystick regkey to the CLSID of my ffdrv1.dll. Is there anything else
that I have to do?
* Where can I get my hands on a working report descriptor that is
compatible with pid.dll? (The one in the PID document on usb.org isn't
recognized as a force feedback joystick at all by DirectX)
If anyone can help me with this I'd be very grateful.
/Frasse.