How to override HID device driver to my own?

Hey everyone,

Just for fun I’m trying to write a KMDF windows 7 driver that will override the default HID (input.inf) driver that installs when I plug in the nintendo wii drumset.

So far, I have installed a skeleton KMDF driver with a skeleton.inf information file that lists the Wii’s device hardware id. Then when I plug in the wii drumset, windows 7 still insists that it install it’s own default HID driver for the wii drumset.

I am surprised that it doesn’t use my skeleton driver that I installed, since I am certain the hardware ID matches in the skeleton.inf file.

My question is how can I make windows 7 use my driver for the wii drumset?

Here’s what I plan to do:

  1. Get my skeleton driver talking to the drumset (configuring interface, querying endpoints, setting up a continuous reader to get the “drum down” interrupts).
  2. Don’t bother writing an actual HID driver. Instead, just supply the drum set with whatever data I MUST supply in order to get the thing in a state where it will just keep sending me data. Once it is sending me data I know how to determine which drum (red blue green yellow) is down because I have sniffed the USB traffic when it was working correctly.

So is there anything I am missing? I haven’t looked exhaustively at the HID spec. but I’m hoping I can just send the initialization data to the drums without implementing the HID spec. From there I just aim to set up a continous reader that polls every 0.009 seconds and receives a HID report from the drums which contains the data about the current state of the drums. (I learned this from sniffing the USB traffic.)

So can anyone answer my above question, and perhaps indicate whether or not what I am trying to do is possible?

Thanks so much for your help.

This isn’t really my thing, but what’s your target OS?

If it’s a 64 bit build, I would think that you’re trying to override a
signed, probably WHQL’d driver, which isn’t going to happen automatically.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Sunday, October 31, 2010 10:10 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to override HID device driver to my own?

Hey everyone,

Just for fun I’m trying to write a KMDF windows 7 driver that will override
the default HID (input.inf) driver that installs when I plug in the nintendo
wii drumset.

So far, I have installed a skeleton KMDF driver with a skeleton.inf
information file that lists the Wii’s device hardware id. Then when I plug
in the wii drumset, windows 7 still insists that it install it’s own default
HID driver for the wii drumset.

I am surprised that it doesn’t use my skeleton driver that I installed,
since I am certain the hardware ID matches in the skeleton.inf file.

My question is how can I make windows 7 use my driver for the wii drumset?

Here’s what I plan to do:

  1. Get my skeleton driver talking to the drumset (configuring interface,
    querying endpoints, setting up a continuous reader to get the “drum down”
    interrupts).
  2. Don’t bother writing an actual HID driver. Instead, just supply the drum
    set with whatever data I MUST supply in order to get the thing in a state
    where it will just keep sending me data. Once it is sending me data I know
    how to determine which drum (red blue green yellow) is down because I have
    sniffed the USB traffic when it was working correctly.

So is there anything I am missing? I haven’t looked exhaustively at the HID
spec. but I’m hoping I can just send the initialization data to the drums
without implementing the HID spec. From there I just aim to set up a
continous reader that polls every 0.009 seconds and receives a HID report
from the drums which contains the data about the current state of the drums.
(I learned this from sniffing the USB traffic.)

So can anyone answer my above question, and perhaps indicate whether or not
what I am trying to do is possible?

Thanks so much for your help.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

It is a 64 bit Windows 7.

In order to install my driver I had to hold f8 when it was booting and
choose “Allow unsiged drivers to be installed” option.

I’m stuck because I’m not sure how to force windows to use my custom driver
for this HID Wii Drumset, and even if I did make it work,
I can’t get DebugView to display any messages (kernel or otherwise), so I
wouldn’t even know if my driver was able to make a connection
and query the interfaces of the Wii Drumset.

So these two things have really got me stuck.

  1. How to make windows use my driver for the drumset.
  2. How to see some kdPrints() (or any kind of debug print?) since DebugView
    doesn’t seem to like Windows 7 x64.

On Sun, Oct 31, 2010 at 10:20 PM, Martin O’Brien <
xxxxx@gmail.com> wrote:

This isn’t really my thing, but what’s your target OS?

If it’s a 64 bit build, I would think that you’re trying to override a
signed, probably WHQL’d driver, which isn’t going to happen automatically.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Sunday, October 31, 2010 10:10 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to override HID device driver to my own?

Hey everyone,

Just for fun I’m trying to write a KMDF windows 7 driver that will override
the default HID (input.inf) driver that installs when I plug in the
nintendo
wii drumset.

So far, I have installed a skeleton KMDF driver with a skeleton.inf
information file that lists the Wii’s device hardware id. Then when I plug
in the wii drumset, windows 7 still insists that it install it’s own
default
HID driver for the wii drumset.

I am surprised that it doesn’t use my skeleton driver that I installed,
since I am certain the hardware ID matches in the skeleton.inf file.

My question is how can I make windows 7 use my driver for the wii drumset?

Here’s what I plan to do:

  1. Get my skeleton driver talking to the drumset (configuring interface,
    querying endpoints, setting up a continuous reader to get the “drum down”
    interrupts).
  2. Don’t bother writing an actual HID driver. Instead, just supply the
    drum
    set with whatever data I MUST supply in order to get the thing in a state
    where it will just keep sending me data. Once it is sending me data I know
    how to determine which drum (red blue green yellow) is down because I have
    sniffed the USB traffic when it was working correctly.

So is there anything I am missing? I haven’t looked exhaustively at the
HID
spec. but I’m hoping I can just send the initialization data to the drums
without implementing the HID spec. From there I just aim to set up a
continous reader that polls every 0.009 seconds and receives a HID report
from the drums which contains the data about the current state of the
drums.
(I learned this from sniffing the USB traffic.)

So can anyone answer my above question, and perhaps indicate whether or not
what I am trying to do is possible?

Thanks so much for your help.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Regarding (2), I’m not sure either, but under windbg, you’d almost certainly
need to set the debug filters via ‘ed nt!Kd_DEFAULT_Mask 0xFF.’

In the words of the esteemed Hector Rodriquez:

http://www.osronline.com/article.cfm?id=295

Regarding (1), I don’t have your driver in front of me to look at, but I
would guess that the one that you are trying to replace is both signed and
WHQL’d, so left to its own devices, it’s going to be chosen by the OS every
time ahead of yours.

mm

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Albus Dumbledore
Sent: Sunday, October 31, 2010 11:40 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] How to override HID device driver to my own?

It is a 64 bit Windows 7.

In order to install my driver I had to hold f8 when it was booting and
choose “Allow unsiged drivers to be installed” option.

I’m stuck because I’m not sure how to force windows to use my custom driver
for this HID Wii Drumset, and even if I did make it work,

I can’t get DebugView to display any messages (kernel or otherwise), so I
wouldn’t even know if my driver was able to make a connection

and query the interfaces of the Wii Drumset.

So these two things have really got me stuck.

  1. How to make windows use my driver for the drumset.

  2. How to see some kdPrints() (or any kind of debug print?) since DebugView
    doesn’t seem to like Windows 7 x64.

On Sun, Oct 31, 2010 at 10:20 PM, Martin O’Brien
wrote:

This isn’t really my thing, but what’s your target OS?

If it’s a 64 bit build, I would think that you’re trying to override a
signed, probably WHQL’d driver, which isn’t going to happen automatically.

mm

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@gmail.com
Sent: Sunday, October 31, 2010 10:10 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to override HID device driver to my own?

Hey everyone,

Just for fun I’m trying to write a KMDF windows 7 driver that will override
the default HID (input.inf) driver that installs when I plug in the nintendo
wii drumset.

So far, I have installed a skeleton KMDF driver with a skeleton.inf
information file that lists the Wii’s device hardware id. Then when I plug
in the wii drumset, windows 7 still insists that it install it’s own default
HID driver for the wii drumset.

I am surprised that it doesn’t use my skeleton driver that I installed,
since I am certain the hardware ID matches in the skeleton.inf file.

My question is how can I make windows 7 use my driver for the wii drumset?

Here’s what I plan to do:
1. Get my skeleton driver talking to the drumset (configuring interface,
querying endpoints, setting up a continuous reader to get the “drum down”
interrupts).
2. Don’t bother writing an actual HID driver. Instead, just supply the drum
set with whatever data I MUST supply in order to get the thing in a state
where it will just keep sending me data. Once it is sending me data I know
how to determine which drum (red blue green yellow) is down because I have
sniffed the USB traffic when it was working correctly.

So is there anything I am missing? I haven’t looked exhaustively at the HID
spec. but I’m hoping I can just send the initialization data to the drums
without implementing the HID spec. From there I just aim to set up a
continous reader that polls every 0.009 seconds and receives a HID report
from the drums which contains the data about the current state of the drums.
(I learned this from sniffing the USB traffic.)

So can anyone answer my above question, and perhaps indicate whether or not
what I am trying to do is possible?

Thanks so much for your help.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

On Mon, Nov 1, 2010 at 11:39 AM, Albus Dumbledore
wrote:
> It is a 64 bit Windows 7.
> In order to install my driver I had to hold f8 when it was booting and
> choose “Allow unsigned drivers to be installed” option.
>
> 1. How to make windows use my driver for the drumset.

Try to manually update the driver in device manager and replace the
inbox HID driver with your driver. If your driver works, then it should be
okay to do it this way.


Xiaofan

Thanks so much everyone for giving me those pointers!

Your suggestions worked out for me and now I have a working driver for the drumset as well as it is outputting my debug prints to debugview!

Yay! Pat yourselves on the back! =D

Another satisfied customer!

Peter
OSR