Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
4.1 KiB

  1. <HTML>
  2. <HEAD>
  3. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
  4. <META NAME="Generator" CONTENT="Microsoft Word 97">
  5. <TITLE>HIDGAME</TITLE>
  6. <META NAME="Template" CONTENT="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
  7. </HEAD>
  8. <BODY TEXT="#000000" LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff" leftmargin="8">
  9. <FONT FACE="Verdana"><H2><A NAME="MYSAMPLE">HIDGAME</A> </H2>
  10. <span style="color:#FF0000">[This is preliminary documentation and subject to change.]</span>
  11. <H3>Summary</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
  12. HidGame is the WDM/HID minidriver for analog joysticks.
  13. This driver registers with the HID class driver and responds to IRPs put out by HIDclass.
  14. It informs HID class about the capabilities of the joystick and polls
  15. the joystick in response to a read IOCTL.
  16. </p>
  17. <p>This driver is loaded in reponse to a "New hardware Found" Plug and Play (PnP) event,
  18. and consequently must have an entry in an .inf file that binds a
  19. PnP hardware ID to this driver. Gameport joysticks are not true PnP devices,
  20. so the user (through the GameControllers Control Panel) informs the system
  21. about a joystick attached to the gameport. An example of how a new joystick
  22. type can be created is provided in the accompanying .inf file. Once a user
  23. selects a joystick and gameport, the GameControllers CPL sends an IOCTL to
  24. the gameport bus driver (GameEnum), specifying the number of
  25. Axis / Buttons and a PnPHardware ID for the joystick.
  26. The Gameport Bus informs PnP of a new device arrival.
  27. PnP searches the system for a match for the hardwareID and loads the appropriate driver.
  28. <p>
  29. <h3>BUILDING THE SAMPLE</h3></FONT><FONT FACE="Verdana" SIZE=2><P>
  30. <p> Use standard Windows NT&#174;/Windows&#174; 2000 build tools. In the hidgame directory, type <B>build</B>.
  31. The build script will generate the driver Hidgame.sys </p>
  32. <h3>TOOLS</h3></FONT><FONT FACE="Verdana" SIZE=2><P>
  33. <p> You can test your driver using the the following apps/tools.
  34. <p><li><B>Game Controllers Control panel</b> from the Standard Control panel</p>
  35. <p><li><b>Diquick.exe</b> (from the IDW directory or the Microsoft DirectX SDK at
  36. <a href=http://www.microsoft.com/directx/resources>Microsoft DirectX Resources</a>)
  37. </p>
  38. <p><li><b>Shipping Microsoft DirectX games</b>
  39. <h3>RESOURCES</h3></FONT><FONT FACE="Verdana" SIZE=2><P>
  40. <p><a href=http://www.usb.org/>Universal Serial Bus</a>
  41. HID Usage Tables</cite>, Version 1.0,
  42. USB Implementers Forum.
  43. <p>
  44. <a href=http://www.microsoft.com/directx/resources>
  45. Microsoft DirectX Resources</a>
  46. </p>
  47. <h3>CODE TOUR</h3>
  48. <h4>File Manifest</h4>
  49. <pre><FONT FACE="Courier" SIZE=2>
  50. <u>Files Description</u>
  51. Hidgame.htm The documentation for this sample (this file)
  52. Sources The generic file for building the code sample
  53. Makefile Used as part of the build process
  54. OEMsetup.inf The .inf file for installing the code sample
  55. HidGame.c DriverEntry, CreateClose, AddDevice and Unload routines
  56. PnP.c Support routines for PnP IOCTLs
  57. RemLock.c Support routines to enhance checking for removal locking
  58. Ioctl.c Support routines for Non PnP IOCTLs ( read/Device descriptor/Device Attributes, and so on)
  59. HidJoy.c Support routines to configure the joystick
  60. Poll.c Support routine for analog joystick polling
  61. i386\timing.c Support routines to use x86 time stamp counter
  62. Hidgame.h Common include file
  63. Debug.h Definitions to aid debugging
  64. Analog.h Definitions specific to analog joystick devices
  65. Hidgame.rtf Autodoc doumentation for Hidgame
  66. </font><font
  67. FACE="VERDANA,ARIAL,HELVETICA" SIZE="2"> </pre>
  68. <h4>Programming Tour</h4>
  69. <p>
  70. This sample has embedded comments in the source code. The AutoDoc utility was used to generate
  71. the following <a href=hidgame.rtf>AutoDoc comments RTF</a> file from the source code.
  72. </p>
  73. </FONT><P ALIGN="CENTER"><A HREF="#top"><FONT FACE="Verdana" SIZE=2>Top of page</FONT></A><FONT FACE="Verdana" SIZE=2> </P></FONT>
  74. <TABLE CELLSPACING=0 BORDER=0 WIDTH=624>
  75. <TR><TD VALIGN="MIDDLE" BGCOLOR="#00ffff" HEIGHT=2>
  76. <P></TD>
  77. </TR>
  78. </TABLE>
  79. <FONT FACE="MS Sans Serif" SIZE=1><P>&copy; 1999 Microsoft Corporation</FONT><FONT FACE="Verdana" SIZE=2> </P></FONT></BODY>
  80. </HTML>