Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Virtual Game Controller driver

Reply
Thread Tools Display Modes

Virtual Game Controller driver

 
 
Thomas Hansen
Guest
Posts: n/a

 
      06-01-2010
I would like to create a generic virtual game controller to
simulate/prototype a game controller via a serial interface or some other
(user mode, non HW) source. The WDK and USB HID documentation is rather
confusing when it comes to virtual devices. I'm not interested in legacy OS
compatibility, si Windows 7 only is fine.

What would be the correct/easiest way to implement this? I.e. what kind of
driver/filter etc. should I set out to make to acheive this?

Is this possible in user-mode driver only? Are there any samples available
that resemble this? The hisusbfx2 sample in the WDK has some resemblence, but
if possible I would like to avoid the USB HID part, since there are no plans
for a USB HW implementation.
 
Reply With Quote
 
 
 
 
Doron Holan [MSFT]
Guest
Posts: n/a

 
      06-01-2010
it is not yet possible to write a HID Miniport in UMDF. hidusbfx2 is the
driver you want to start with. You definitely need to be HID. to convert
this driver to your needs, you just replace the bottom "Edge" of the driver,
ie the USB part, with whatever you want. you could expose another raw PDO on
your own and have a user mode application inject the data or you could open
up a serial port and read data from it.

d

"Thomas Hansen" wrote in message
news:8B8FA545-7D69-420D-A235-...

I would like to create a generic virtual game controller to
simulate/prototype a game controller via a serial interface or some other
(user mode, non HW) source. The WDK and USB HID documentation is rather
confusing when it comes to virtual devices. I'm not interested in legacy OS
compatibility, si Windows 7 only is fine.

What would be the correct/easiest way to implement this? I.e. what kind of
driver/filter etc. should I set out to make to acheive this?

Is this possible in user-mode driver only? Are there any samples available
that resemble this? The hisusbfx2 sample in the WDK has some resemblence,
but
if possible I would like to avoid the USB HID part, since there are no plans
for a USB HW implementation.

 
Reply With Quote
 
 
 
 
Paul Kerchen
Guest
Posts: n/a

 
      06-15-2010
I want to do the same thing as the OP, so I followed your suggestion to start
with the hidusbfx2 example. What I've done is taken the hidusbfx2 example
and merged it with the nonpnp example (so that I can explicitly load/unload
the driver via an application and inject data into the KMDF driver from user
mode). I've gotten the nonpnp part of my driver working (I'm able to
load/unload the KMDF driver and inject data into it via WriteFile()), but
Windows doesn't seem to recognize a new HID when I load my driver.
First of all, does this approach even make sense? If so, what do I need to
do to get the OS to think that there is a new HID device present? I've
implemented callbacks for getting the HID descriptor, report descriptor and
device attributes, but those don't appear to ever get called, so obviously
there's something else I'm missing. Do I need to implement the PNP power
callbacks even though my device is not PNP? Any help would be appreciated!

Paul


"Doron Holan [MSFT]" wrote:

> it is not yet possible to write a HID Miniport in UMDF. hidusbfx2 is the
> driver you want to start with. You definitely need to be HID. to convert
> this driver to your needs, you just replace the bottom "Edge" of the driver,
> ie the USB part, with whatever you want. you could expose another raw PDO on
> your own and have a user mode application inject the data or you could open
> up a serial port and read data from it.
>
> d
>
> "Thomas Hansen" wrote in message
> news:8B8FA545-7D69-420D-A235-...
>
> I would like to create a generic virtual game controller to
> simulate/prototype a game controller via a serial interface or some other
> (user mode, non HW) source. The WDK and USB HID documentation is rather
> confusing when it comes to virtual devices. I'm not interested in legacy OS
> compatibility, si Windows 7 only is fine.
>
> What would be the correct/easiest way to implement this? I.e. what kind of
> driver/filter etc. should I set out to make to acheive this?
>
> Is this possible in user-mode driver only? Are there any samples available
> that resemble this? The hisusbfx2 sample in the WDK has some resemblence,
> but
> if possible I would like to avoid the USB HID part, since there are no plans
> for a USB HW implementation.
>
> .
>

 
Reply With Quote
 
Doron Holan [MSFT]
Guest
Posts: n/a

 
      06-15-2010
you can't make a non pnp HID miniport driver, so merging it with the non pnp
sample was a non starter. if you want to load/unload it on the fly, look at
the code in the devcon sample on how to enable/disable a pnp device stack.

d

"Paul Kerchen" wrote in message
news:8C331AB0-B772-4CDC-9C9C-...

I want to do the same thing as the OP, so I followed your suggestion to
start
with the hidusbfx2 example. What I've done is taken the hidusbfx2 example
and merged it with the nonpnp example (so that I can explicitly load/unload
the driver via an application and inject data into the KMDF driver from user
mode). I've gotten the nonpnp part of my driver working (I'm able to
load/unload the KMDF driver and inject data into it via WriteFile()), but
Windows doesn't seem to recognize a new HID when I load my driver.
First of all, does this approach even make sense? If so, what do I need to
do to get the OS to think that there is a new HID device present? I've
implemented callbacks for getting the HID descriptor, report descriptor and
device attributes, but those don't appear to ever get called, so obviously
there's something else I'm missing. Do I need to implement the PNP power
callbacks even though my device is not PNP? Any help would be appreciated!

Paul


"Doron Holan [MSFT]" wrote:

> it is not yet possible to write a HID Miniport in UMDF. hidusbfx2 is the
> driver you want to start with. You definitely need to be HID. to convert
> this driver to your needs, you just replace the bottom "Edge" of the
> driver,
> ie the USB part, with whatever you want. you could expose another raw PDO
> on
> your own and have a user mode application inject the data or you could
> open
> up a serial port and read data from it.
>
> d
>
> "Thomas Hansen" wrote in message
> news:8B8FA545-7D69-420D-A235-...
>
> I would like to create a generic virtual game controller to
> simulate/prototype a game controller via a serial interface or some other
> (user mode, non HW) source. The WDK and USB HID documentation is rather
> confusing when it comes to virtual devices. I'm not interested in legacy
> OS
> compatibility, si Windows 7 only is fine.
>
> What would be the correct/easiest way to implement this? I.e. what kind of
> driver/filter etc. should I set out to make to acheive this?
>
> Is this possible in user-mode driver only? Are there any samples available
> that resemble this? The hisusbfx2 sample in the WDK has some resemblence,
> but
> if possible I would like to avoid the USB HID part, since there are no
> plans
> for a USB HW implementation.
>
> .
>


 
Reply With Quote
 
Paul Kerchen
Guest
Posts: n/a

 
      06-16-2010
Ah, I suspected that was the case. I will check out the devcon sample.
Thank you!

"Doron Holan [MSFT]" wrote:

> you can't make a non pnp HID miniport driver, so merging it with the non pnp
> sample was a non starter. if you want to load/unload it on the fly, look at
> the code in the devcon sample on how to enable/disable a pnp device stack.
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista Game Controller - Changing the default controller. nameless Windows Vista Hardware 0 02-19-2008 09:04 PM
Adding "Game" desktop icons to Game folder. Rob Windows Vista File Management 0 12-04-2007 12:14 PM
Virtual MIDI Driver, Connect Virtual MIDI Controller. GafferUK Windows Vista Drivers 3 06-29-2007 03:26 PM
How to remove a game from games folder (Hide game doesn't work) Rasmus Bertelsen Windows Vista Games 1 08-18-2006 08:49 PM
Game detection in Game Explorer PatrickV Windows Vista Games 2 08-14-2006 02:48 AM