Virtual Game Controller driver

Discussion in 'Windows Vista Drivers' started by Thomas Hansen, Jun 1, 2010.

  1. 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.
    Thomas Hansen, Jun 1, 2010
    #1
    1. Advertising

  2. 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:...

    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.
    Doron Holan [MSFT], Jun 1, 2010
    #2
    1. Advertising

  3. Thomas Hansen

    Paul Kerchen Guest

    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:...
    >
    > 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.
    >
    > .
    >
    Paul Kerchen, Jun 15, 2010
    #3
  4. 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:...

    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:...
    >
    > 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.
    >
    > .
    >
    Doron Holan [MSFT], Jun 15, 2010
    #4
  5. Thomas Hansen

    Paul Kerchen Guest

    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.
    >
    Paul Kerchen, Jun 16, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PatrickV

    Game detection in Game Explorer

    PatrickV, Jul 26, 2006, in forum: Windows Vista Games
    Replies:
    2
    Views:
    751
    George Geczy
    Aug 14, 2006
  2. Rasmus Bertelsen

    How to remove a game from games folder (Hide game doesn't work)

    Rasmus Bertelsen, Aug 12, 2006, in forum: Windows Vista Games
    Replies:
    1
    Views:
    1,487
    Rasmus Bertelsen
    Aug 18, 2006
  3. nameless

    Vista Game Controller - Changing the default controller.

    nameless, Feb 19, 2008, in forum: Windows Vista Hardware
    Replies:
    0
    Views:
    413
    nameless
    Feb 19, 2008
  4. Rob

    Adding "Game" desktop icons to Game folder.

    Rob, Dec 4, 2007, in forum: Windows Vista File Management
    Replies:
    0
    Views:
    534
  5. GafferUK

    Virtual MIDI Driver, Connect Virtual MIDI Controller.

    GafferUK, Jun 25, 2007, in forum: Windows Vista Drivers
    Replies:
    3
    Views:
    2,943
    GafferUK
    Jun 29, 2007
Loading...

Share This Page