Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there sample of driver-filter for hid devices in ddk or wdk?

233 views
Skip to first unread message

Kostya

unread,
May 14, 2009, 2:09:07 PM5/14/09
to
Hello.

I want to get information about buttons pressed in usb joystick. So is there
driver-filter which can provide me this functional?

Sorry for my English.

Thanks.

Kerem Gümrükcü

unread,
May 14, 2009, 9:18:33 PM5/14/09
to
Hi,

first read this:

[WDM Driver Layers: An Example]
http://msdn.microsoft.com/en-us/library/aa490242.aspx

then this:

[Filter Drivers]
http://msdn.microsoft.com/en-us/library/aa490247.aspx

In your case you may need a upper level filter for the Joystick
HID Device,...

Have a look at the filter samples in the WDK/DDK. I am not
really sure, but i guess a joystick will be connected as
a Mouse Device, but i am not sure. Either its a Mouse
or a Multimedia Device:

{4d36e96c-e325-11ce-bfc1-08002be10318}::[MEDIA]
{4d36e96f-e325-11ce-bfc1-08002be10318}::[Mouse]

Its one of those. I guess its the MEDIA one,...

Well, maybe you dont need a driver at all to get that
data. There is the SDL Layer for Joystick, DirectX is
available and other Media/Game Libraries. Sometimes
it can be done in User Mode with no Driver needed
for that. But there is alos the Windows Multimedia
Interface holding these functions that will do a great job

joyConfigChanged
joyGetDevCaps
joyGetNumDevs
joyGetPos
joyGetPosEx
joyGetThreshold
joyReleaseCapture
joySetCapture
joySetThreshold

and will work on any windows ranging from Windows
95!!! to latest Windows 7! So why write a driver, exception
would be if you really want to "filter out" some button or
switch on the Joystick,...

regards

Kerem

--
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project: http://www.pro-it-education.de/software/deviceremover
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Kostya" <Kos...@discussions.microsoft.com> schrieb im Newsbeitrag
news:0A6E9149-51DA-4601...@microsoft.com...

timrobot

unread,
May 14, 2009, 11:57:31 PM5/14/09
to
Hi, Kerem:

in case the questioner has some composite stuff such as usb audio
to be implemented. is that a miniport hid driver needed?

as you may know, xbox 360 controller has implement a virtual hub node
in it, but i am not sure where i read it. in this case, what is your answer?

thanks.


"Kerem G�mr�kc�" <kare...@hotmail.com> wrote in message
news:e%23QWgsP1...@TK2MSFTNGP06.phx.gbl...

> Beste Gr�sse / Best regards / Votre bien devoue
> Kerem G�mr�kc�

Kostya

unread,
May 15, 2009, 2:20:11 AM5/15/09
to
Thanks, all.

I think, i need lower-level filter that enables the joystick to emulate a
keyboard (it is my target). So the code that emulates it is already written
in kbfilter by me. In this msdn article
http://msdn.microsoft.com/en-us/library/aa490242.aspx is written "and the
lower-level filter driver is written by the joystick vendor. ". As I
understand sources of these filters are not in free access.

I found in ddk sample called "vhidmini". But it is for virtual hid device.
Also I found "hidgame" sample. It is functional driver, so it doesn't match
my purpose. In addition iI couldn't add this driver to a system by modifying
inf-file.
There is anoter one sample in ddk called "firefly". It contains the upper
filter driver of Microsoft USB Intellimouse Optical. Is it realy to use this
driver for joystick?

Thanks, Kostya.

timrobot

unread,
May 15, 2009, 3:24:37 AM5/15/09
to
if emulating a keyboard is your target, the upper filter driver is the
way to go, i guess.


"Kostya" <Kos...@discussions.microsoft.com> wrote in message
news:4D38A431-FB66-43D7...@microsoft.com...

Kostya

unread,
May 15, 2009, 5:34:19 PM5/15/09
to
Thanks.

I have compile this driver and add to system. But when I am pressing the
button on joystick, I can't handle it in driver. I added DbgPrint to begging
of each function. So in this driver there are 3 defined functions (for
IRP_MJ_PNP, IRP_MJ_POWER, IRP_MJ_SYSTEM_CONTROL) and function that send down
unmodifyed IRPs. I don't get into the last function, when I press the button
(I don't get into any function at all). But buttons are handled by system (I
can see it in control panel). What's the problem?

Kostya

unread,
May 17, 2009, 12:17:09 PM5/17/09
to
I've installed this driver called "devfilter" as lowerfilter. It has been
installed as upperfilter before. Now function that send down unmodifyed IRPs
call when I press some button in gamepad. IRP majorFunction is
IRP_MJ_INTERNAL_DEVICE_CONTROL in this functions. But structure Parameters in
irpStack contains such values:
Output buffer length = 0x814e7588
Input buffer length = 0
IoContolCode = 2228227.

Output buffer length is very big value and unaccessable. So I have no idea
how to get information about buttons pressed on gamepad in this filter. Does
anybody deal with this problem?

0 new messages