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.

681 lines
66 KiB

  1. {\rtf1\ansi \deff0\deflang1033
  2. {\fonttbl
  3. {\f0\froman Times New Roman;}
  4. {\f2\fswiss Arial;}
  5. {\f19\fmodern\fcharset0\fprq1 Courier New;}
  6. }
  7. {\colortbl;
  8. \red0\green0\blue0;
  9. \red0\green0\blue255;
  10. \red0\green255\blue255;
  11. \red0\green255\blue0;
  12. \red255\green0\blue255;
  13. \red255\green0\blue0;
  14. \red255\green255\blue0;
  15. \red255\green255\blue255;
  16. \red0\green0\blue127;
  17. \red0\green127\blue127;
  18. \red0\green127\blue0;
  19. \red127\green0\blue127;
  20. \red127\green0\blue0;
  21. \red127\green127\blue0;
  22. \red127\green127\blue127;
  23. \red192\green192\blue192;
  24. }
  25. {\stylesheet
  26. {\s243\li-1800\sl-210\tqr\tx6960 \b\f2\fs19\lang1033 header;}
  27. {\s251\sb160\sa40\sl-280\keepn \b\f2\lang1033 heading 4;}
  28. {\s252\sb160\sa40\sl-340\keepn \b\f2\fs30\lang1033 heading 3;}
  29. {\s253\li-1800\sb160\sa60\sl-380\keepn \b\f0\fs34\lang1033 heading 2;}
  30. {\s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 heading 1;}
  31. {\*\cs10 \additive Default Paragraph Font;}
  32. {\sa160\sl240 \fs21\lang1033 Normal;}
  33. {\s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 Ex;}
  34. {\s44\li-1770\ri30\sb50\sl-80\brdrt\brdrs\brdrw15\brdrcf2 \fs12\lang1033 header rule;}
  35. {\s45\li-1800\sa180\sl-440\keepn\tx0 \b\f2\fs40\up8\lang1033 Rh1;}
  36. {\s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Rmh;}
  37. {\s50\sl-240\keepn \f0\fs21\lang1033 Term1;}
  38. {\s53\li280\sl-240\keepn \f0\fs21\lang1033 Term2;}
  39. {\s54\li280\sa80\sl-240 \f0\fs21\lang1033 Def1;}
  40. {\s55\li560\sa80\sl-240 \f0\fs21\lang1033 Def2;}
  41. {\s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 Rule;}
  42. {\s93\sl240 \fs21\lang1033
  43. Index Link;}
  44. {\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 Table Text;}
  45. }
  46. \paperw12240\paperh15840\margl3330\margr1530\margt-2540\margb-2220\gutter420
  47. \facingp\deftab280\widowctrl\ftnbj
  48. \sectd \binfsxn1\binsxn1\linex0\headery1990\footery360\endnhere\titlepg
  49. {\headerl \pard\plain \s243\li-1800\sl-210\tqr\tx6960 \b\f2\fs19\lang1033
  50. {\field\flddirty{\*\fldinst PAGE}{\fldrslt 4}}{\expnd50 }Autodoc Output - 03/24/99\par
  51. \pard\plain \s44\li-1770\ri30\sb50\sl-80\brdrt\brdrs\brdrw15\brdrcf2 \fs12\lang1033 \par }
  52. {\headerr \pard\plain \s243\li-1800\sl-210\tqr\tx6960 \b\f2\fs19\lang1033
  53. \tab Autodoc Output - 03/24/99{\expnd50 }
  54. {\field\flddirty{\*\fldinst PAGE}{\fldrslt 3}}
  55. \par \pard\plain \s44\li-1770\ri30\sb50\sl-80\brdrt\brdrs\brdrw15\brdrcf2 \fs12\lang1033
  56. \par }
  57. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  58. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 Module HidGame\par
  59. \pard\plain \sa160\sl240 \fs21\lang1033 Filename: C:/NTDDK/SRC/WDM/HID/HIDGAME/HIDGAME.H\par
  60. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Description\par
  61. \pard\plain \sa160\sl240 \fs21\lang1033 Analog WDM/HID Joystick driver.\par
  62. HidGame is the HID minidriver for analog joysticks.
  63. This driver registers with the HID class driver and
  64. responds to IRPs put out by HIDclass. It informs HIDClass
  65. about the capabilities of the joystick and polls the joystick
  66. in response to a read IOCTL.\par
  67. This driver is loaded in reponse to a "New hardware Found"
  68. PnP event, and consequently must have an entry in an inf file
  69. that binds a PnP hardware ID to this driver.\par
  70. Gameport joysticks are not true PnP devices, so the user has to
  71. inform the system about the joystick that was added to the
  72. gameport by using the Game Controllers CPL "Add" a joystick.
  73. An example of how a new joystick type can be created is provided
  74. in the accompanying inf file.\par
  75. Once a user selects a joystick and gameport, the GameCPL passes
  76. this information to DirectInput which sends an IOCTL to the
  77. gameport bus driver (GameEnum), specifying the number of axes,
  78. buttons and a PnPHardware ID for the joystick. The Gameport Bus
  79. informs PnP of a new device arrival. PnP searches the system for
  80. a match for the hardwareID and loads the appropriate driver.\par
  81. The following files are part of this driver.\par
  82. \line HidGame.c
  83. \line DriverEntry, CreateClose, AddDevice and Unload Routines.
  84. This code performs functions required for any device driver
  85. and so can probably be used without changes for any game
  86. other game device.\par
  87. \line PnP.c
  88. \line Support routines for PnP IOCTLs.\par
  89. \line Ioctl.c
  90. \line Support routines for Non PnP IOCTLs
  91. These deal with all the HID IOCTLs required for an ordinary
  92. game device and so could be used without change as there is
  93. no analog specific funtionality in these routines.
  94. Drivers for some devices may need to add code to support more
  95. complex devices.\par
  96. \line HidJoy.c
  97. \line Support routines to translate legacy joystick flags and
  98. data into HID descriptors. The majority of this code is
  99. needed to support the wide variety of analog joysticks
  100. available so is not relevant to drivers written for specific
  101. devices.\par
  102. \line Poll.c
  103. \line Support routines to read analog joystick data from a
  104. gameport. These functions are likely to be of little use
  105. in a digital joystick driver.\par
  106. \line i386\\timing.c
  107. \line Support routines to use x86 Time Stamp Counter.
  108. Includes code to check for the presence of, calibrate and
  109. read the high speed CPU timer.\par
  110. \line Hidgame.h
  111. \line Common include file.
  112. The general definitions are likely to be of use in most
  113. drivers for game devices but some customization will be needed.\par
  114. \line Debug.h
  115. \line Definitions to aid debugging.
  116. This contains the tag for the driver name used in debug output
  117. which must be changed.\par
  118. \line Analog.h
  119. \line Specific include file.
  120. Definitions specific to analog joystick devices.\par
  121. \line OemSetup.inf
  122. \line Sample inf file.
  123. See comments in this file for how to install devices.\par
  124. \line Source
  125. \line Source file for the NT build utility\par
  126. \line Makefile
  127. \line Used as part of the build process\par
  128. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  129. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 DriverEntry\par
  130. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b DriverEntry(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b , IN PUNICODE_STRINT} {\i RegistryPath}{\b ) }\par
  131. \pard\plain \sa160\sl240 \fs21\lang1033 Installable driver initialization entry point.
  132. \line This entry point is called directly by the I/O system.\par
  133. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidgame.c\par
  134. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  135. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  136. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i RegistryPath}\par
  137. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to a unicode string representing the path,
  138. to driver-specific key in the registry.\par
  139. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  140. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 ???\cell returned HidRegisterMinidriver()\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  141. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  142. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_AddDevice\par
  143. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_AddDevice(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b , IN PDEVICE_OBJECT} {\i FunctionalDeviceObject}{\b ) }\par
  144. \pard\plain \sa160\sl240 \fs21\lang1033 Called by hidclass, allows us to initialize our device extensions.\par
  145. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidgame.c\par
  146. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  147. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  148. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i FunctionalDeviceObject}\par
  149. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to a functional device object created by hidclass.\par
  150. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  151. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  152. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  153. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_ChangeHandler\par
  154. \pard \plain \sa160\sl240 \fs21\lang1033 {\b VOID} {\b HGM_ChangeHandler(}{\b IN OUT PDEVICE_EXTENSION} {\i DeviceExtension}{\b ) }\par
  155. \pard\plain \sa160\sl240 \fs21\lang1033 Use IOCTL_GAMEENUM_EXPOSE_SIBLING and IOCTL_GAMEENUM_REMOVE_SELF
  156. to change the attributes of the device.\par
  157. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  158. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceExtension}\par
  159. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the mini-driver device extension.\par
  160. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  161. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_CreateClose\par
  162. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_CreateClose(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  163. \pard\plain \sa160\sl240 \fs21\lang1033 Process the create and close IRPs sent to this device.\par
  164. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidgame.c\par
  165. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  166. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  167. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  168. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O Request Packet.\par
  169. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  170. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_INVALID_PARAMETER\cell Irp not handled\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  171. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  172. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_DeviceChanged\par
  173. \pard \plain \sa160\sl240 \fs21\lang1033 {\b VOID} {\b HGM_DeviceChanged(}{\b IN OUT PDEVICE_EXTENSION} {\i DeviceExtension}{\b ) }\par
  174. \pard\plain \sa160\sl240 \fs21\lang1033 Start the process of changing the device attributes by stashing
  175. away all the data needed and then initializing and queuing a work
  176. item to call the IOCTL at the required PASSIVE_LEVEL.\par
  177. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  178. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceExtension}\par
  179. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the mini-driver device extension.\par
  180. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  181. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_DriverInit\par
  182. \pard \plain \sa160\sl240 \fs21\lang1033 {\b VOID} {\b HGM_DriverInit(void}{\b ) }\par
  183. \pard\plain \sa160\sl240 \fs21\lang1033 Perform global initialization.
  184. \line This is called from DriverEntry. Try to initialize a CPU specific
  185. timer but if it fails set up default\par
  186. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  187. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  188. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_Game2HID\par
  189. \pard \plain \sa160\sl240 \fs21\lang1033 {\b VOID} {\b HGM_Game2HID(}{\b IN PDEVICE_EXTENSION} {\i DeviceExtension}{\b , IN OUT PUHIDGAME_INPUT_DATA} {\i pHIDData}{\b ) }\par
  190. \pard\plain \sa160\sl240 \fs21\lang1033 Process the data returned from polling the gameport into values
  191. and buttons for returning to HID.
  192. \line The meaning of the data is interpreted according to the
  193. characteristics of the device described in the hardware settings
  194. flags.\par
  195. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  196. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceExtension}\par
  197. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the mini-driver device extension.\par
  198. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i pHIDData}\par
  199. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the buffer into which the HID report should be written.
  200. This buffer must be assumed to be unaligned.\par
  201. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  202. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_GenerateReport\par
  203. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_GenerateReport(}{\b IN PDEVICE_OBJECT} {\i DeviceObject}{\b , IN OUT UCHAR *} {\i rgGameReport[MAXBYTES_GAME_REPORT]}{\b , OUT PUSHORT} {\i pCbReport}{\b ) }\par
  204. \pard\plain \sa160\sl240 \fs21\lang1033 Generates a hid report descriptor for a n-axis, m-button joystick,
  205. depending on number of buttons and joy_hws_flags field.\par
  206. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  207. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  208. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device object\par
  209. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i rgGameReport[MAXBYTES_GAME_REPORT]}\par
  210. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Array that receives the HID report descriptor\par
  211. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i pCbReport}\par
  212. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Address of a short integer that receives size of
  213. HID report descriptor.\par
  214. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  215. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_BUFFER_TOO_SMALL\cell Need more memory for HID descriptor\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  216. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  217. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_GetAttributes\par
  218. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_GetAttributes(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  219. \pard\plain \sa160\sl240 \fs21\lang1033 Respond to IOCTL_HID_GET_ATTRIBUTES, by filling
  220. the HID_DEVICE_ATTRIBUTES struct\par
  221. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/ioctl.c\par
  222. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  223. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  224. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  225. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O Request Packet.\par
  226. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  227. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 ???\cell ???\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  228. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  229. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_GetDeviceDescriptor\par
  230. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_GetDeviceDescriptor(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  231. \pard\plain \sa160\sl240 \fs21\lang1033 Respond to HIDCLASS IOCTL_HID_GET_DEVICE_DESCRIPTOR
  232. by returning a device descriptor\par
  233. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/ioctl.c\par
  234. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  235. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  236. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  237. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O Request Packet.\par
  238. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  239. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_BUFFER_TOO_SMALL\cell need more memory\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  240. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  241. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_GetReportDescriptor\par
  242. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_GetReportDescriptor(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  243. \pard\plain \sa160\sl240 \fs21\lang1033 Respond to HIDCLASS IOCTL_HID_GET_REPORT_DESCRIPTOR
  244. by returning appropriate the report descriptor\par
  245. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/ioctl.c\par
  246. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  247. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  248. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  249. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O Request Packet.\par
  250. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  251. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 ???\cell ???\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  252. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  253. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_GetResources\par
  254. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_GetResources(}{\b IN PDEVICE_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  255. \pard\plain \sa160\sl240 \fs21\lang1033 Gets gameport resource information from the GameEnum driver\par
  256. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/pnp.c\par
  257. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  258. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device object.\par
  259. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  260. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O request packet.\par
  261. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  262. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 ???\cell Return from IoCallDriver()\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  263. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  264. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_InitAnalog\par
  265. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_InitAnalog(}{\b IN PDEVICE_OBJECT} {\i DeviceObject}{\b ) }\par
  266. \pard\plain \sa160\sl240 \fs21\lang1033 Check that the configuration is valid whilst there is still time
  267. to refuse it.
  268. \line Detect and validate sibling relationships and call
  269. HGM_JoystickConfig for the rest of the work.\par
  270. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  271. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  272. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device object\par
  273. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  274. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DEVICE_CONFIGURATION_ERROR\cell Invalid configuration specified\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  275. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  276. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_InitDevice\par
  277. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_InitDevice(}{\b IN PDEVICE_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  278. \pard\plain \sa160\sl240 \fs21\lang1033 Get the device information and attempt to initialize a configuration
  279. for a device. If we cannot identify this as a valid HID device or
  280. configure the device, our start device function is failed.\par
  281. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/pnp.c\par
  282. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  283. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device object.\par
  284. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  285. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O request packet.\par
  286. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  287. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DEVICE_CONFIGURATION_ERROR\cell Resources overlap\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 ???\cell Return from HGM_GetResources() or HGM_JoystickConfig()\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  288. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  289. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_InternalIoctl\par
  290. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_InternalIoctl(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  291. \pard\plain \sa160\sl240 \fs21\lang1033 Process the Control IRPs sent to this device.
  292. \line This function cannot be pageable because reads/writes
  293. can be made at dispatch-level\par
  294. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/ioctl.c\par
  295. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  296. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  297. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  298. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O Request Packet.\par
  299. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  300. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_NOT_SUPPORT\cell Irp function not supported\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 ???\cell ???\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  301. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  302. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_JoystickConfig\par
  303. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_JoystickConfig(}{\b IN PDEVICE_OBJECT} {\i DeviceObject}{\b ) }\par
  304. \pard\plain \sa160\sl240 \fs21\lang1033 Check that the configuration is valid whilst there is still time
  305. to refuse it.
  306. \line HGM_GenerateReport uses the results generated here if the
  307. settings are OK.\par
  308. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  309. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  310. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device object\par
  311. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  312. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DEVICE_CONFIGURATION_ERROR\cell Invalid configuration specified\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  313. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  314. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_MapAxesFromDevExt\par
  315. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_MapAxesFromDevExt(}{\b IN OUT PDEVICE_EXTENSION} {\i DeviceExtension}{\b ) }\par
  316. \pard\plain \sa160\sl240 \fs21\lang1033 Use the flags in the DeviceExtension to generate mappings for each
  317. axis.
  318. \line This is called both from HGM_JoystickConfig to validate the
  319. configuration and HGM_GenerateReport to use the axis maps.\par
  320. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  321. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceExtension}\par
  322. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the minidriver device extension\par
  323. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  324. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DEVICE_CONFIGURATION_ERROR\cell The configuration is invalid\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  325. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  326. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_PnP\par
  327. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_PnP(}{\b IN PDEVICE_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  328. \pard\plain \sa160\sl240 \fs21\lang1033 Plug and Play dispatch routine for this driver.\par
  329. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/pnp.c\par
  330. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  331. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device object.\par
  332. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  333. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O request packet.\par
  334. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  335. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DELETE_PENDING\cell PnP IRP received after device was removed\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 ???\cell Return from IoCallDriver() or HGM_InitDevice()\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  336. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  337. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_PnPComplete\par
  338. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_PnPComplete(}{\b IN PDEVICE_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  339. \pard\plain \sa160\sl240 \fs21\lang1033 Completion routine for PnP IRPs.\par
  340. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/pnp.c\par
  341. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  342. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device object.\par
  343. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  344. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O request packet.\par
  345. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  346. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_MORE_PROCESSING_REQUIRED\cell We want the IRP back\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  347. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  348. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_Power\par
  349. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_Power(}{\b IN PDEVICE_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  350. \pard\plain \sa160\sl240 \fs21\lang1033 The power dispatch routine.
  351. \line This driver does not recognize power IRPS. It merely sends them down,
  352. unmodified to the next device on the attachment stack.
  353. As this is a POWER irp, and therefore a special irp, special power irp
  354. handling is required. No completion routine is required.\par
  355. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/pnp.c\par
  356. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  357. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device object.\par
  358. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  359. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O request packet.\par
  360. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  361. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 ???\cell Return from PoCallDriver()\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  362. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  363. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_ReadReport\par
  364. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_ReadReport(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b , IN PIRP} {\i Irp}{\b ) }\par
  365. \pard\plain \sa160\sl240 \fs21\lang1033 Poll the gameport, remap the axis and button data and package
  366. into the defined HID report field.
  367. \line This routine cannot be pageable as HID can make reads at
  368. dispatch-level.\par
  369. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/ioctl.c\par
  370. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  371. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  372. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Irp}\par
  373. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to an I/O Request Packet.\par
  374. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  375. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DEVICE_NOT_CONNECTED\cell Device Failed to Quiesce
  376. ( not connected )\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_TIMEOUT\cell Could not determine exact transition time for
  377. one or more axis but not a failure.\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  378. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  379. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_RemoveDevice\par
  380. \pard \plain \sa160\sl240 \fs21\lang1033 {\b VOID} {\b HGM_RemoveDevice(}{\b IN PDEVICE_EXTENSION} {\i DeviceExtension}{\b ) }\par
  381. \pard\plain \sa160\sl240 \fs21\lang1033 FDO Remove routine\par
  382. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/pnp.c\par
  383. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceExtension}\par
  384. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device extension.\par
  385. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  386. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_SetupButtons\par
  387. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_SetupButtons(}{\b IN OUT PDEVICE_EXTENSION} {\i DeviceExtension}{\b ) }\par
  388. \pard\plain \sa160\sl240 \fs21\lang1033 Use the flags in the DeviceExtension to check and set up buttons.
  389. \line This is called both from HGM_JoystickConfig to validate the
  390. configuration and HGM_GenerateReport to prepare for polling.\par
  391. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidjoy.c\par
  392. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceExtension}\par
  393. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the minidriver device extension\par
  394. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  395. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DEVICE_CONFIGURATION_ERROR\cell The configuration is invalid\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  396. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  397. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_Unload\par
  398. \pard \plain \sa160\sl240 \fs21\lang1033 {\b void} {\b HGM_Unload(}{\b IN PDRIVER_OBJECT} {\i DeviceObject}{\b ) }\par
  399. \pard\plain \sa160\sl240 \fs21\lang1033 Free all the allocated resources, etc.\par
  400. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/hidgame.c\par
  401. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceObject}\par
  402. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the driver object\par
  403. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  404. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HGM_UpdateLatestPollData\par
  405. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HGM_UpdateLatestPollData(}{\b IN OUT PDEVICE_EXTENSION} {\i DeviceExtension}{\b ) }\par
  406. \pard\plain \sa160\sl240 \fs21\lang1033 Do whatever polling is required and possible to update the
  407. LastGoodAxis and LastGoodButton arrays in the DeviceExtension.
  408. Handles synchronization and non-fatal errors.
  409. \line This routine cannot be pageable as HID can make reads at
  410. dispatch-level.\par
  411. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/poll.c\par
  412. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceExtension}\par
  413. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device extension containing the data to be updated
  414. and the functions and to use.\par
  415. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  416. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DEVICE_CONFIGURATION_ERROR\cell Invalid configuration specified\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  417. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  418. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HidAnalogPoll\par
  419. \pard \plain \sa160\sl240 \fs21\lang1033 {\b NTSTATUS} {\b HidAnalogPoll(}{\b IN PDEVICE_EXTENSION} {\i DeviceExtension}{\b , IN UCHAR} {\i resisitiveInputMask}{\b , IN BOOLEAN} {\i fApproximate}{\b , IN OUT ULONG} {\i Axis[MAX_AXES]}{\b , OUT UCHAR} {\i Button[PORT_BUTTONS]}{\b ) }\par
  420. \pard\plain \sa160\sl240 \fs21\lang1033 Polling routine for analog joysticks.
  421. \line Polls the analog device for position and button information.
  422. The position information in analog devices is conveyed by the
  423. duration of a pulse width. Each axis occupies one bit position.
  424. The read operation is started by writing a value to the joystick
  425. io address. Immediately thereafter we begin examing the values
  426. returned and the elapsed time.\par
  427. This sort of device has a few limitations:\par
  428. First, button information is not latched by the device, so if a
  429. button press which occurrs in between polls it will be lost.
  430. There is really no way to prevent this short of devoting
  431. the entire cpu to polling. In reality this does not cause a problem.\par
  432. Second, since it is necessary to measure the duration of the axis pulse,
  433. the most accurate results would be obtained using the smallest possible
  434. sense loop and no interruptions of this loop.
  435. The typical range of pulse lengths is from around 10 uSecs to 1500 uSecs
  436. but depending on the joystick and gameport, this could extend to at least
  437. 8000 uSecs. Keeping interrupts disabled for this length of time causes
  438. many problems, like modems losing connections to sound break ups.\par
  439. Third, because each iteration of the poll loop requires an port read, the
  440. speed of the loop is largely constrained by the speed of the IO bus.
  441. This also means that when there is contention for the IO bus, the loop
  442. will be slowed down. IO contention is usually caused by DMAs (or FDMAs)
  443. which result in a significant slow down.\par
  444. Forth, because of the previous two problems, the poll loop may be slowed
  445. down or interrupted at any time so an external time source is needed to
  446. measure the pulse width for each axis. The only cross-platform high
  447. resolution timer is the read with KeQueryPerformanceCounter.
  448. Unfortunately the implementation of this often uses a 1.18MHz 8253 timer
  449. which requires 3 IO accesses to read, compounding the third problem and
  450. even then, the result may need to be reread if the counters were in the
  451. wrong state. Current CPUs have on board counters that can be used to
  452. provide very accurate timing and more recent HAL implementations tend to
  453. use these to implement KeQueryPerformanceCounter so this will be a problem
  454. on less systems as time goes on. In the majority of cases, a poor
  455. KeQueryPerformanceCounter implementation is made irrelevant by testing
  456. for the availability of a CPU time stamp counter on Intel architechtures
  457. and using it directly if it is available.\par
  458. The algorithm implemented here is not the most obvious but works as
  459. follows:\par
  460. Once started, the axes read a value of one until the completion of their
  461. pulse. The axes are the four lower bits in the byte read from the port.
  462. The state of the axes in each iteration of the poll loop is therefore
  463. represented as a value between 0 and 15. The important time for each
  464. axis is the time at which it changes from 1 to 0. This is done by using
  465. the value representing the state of the axes to index an array into which
  466. time values are stored. For each axis, the duration of its pulse width is
  467. the latest time stored in the array at an index with the bit for that axis
  468. set. However since interrupts can occur at any time, it is not possible
  469. to simultaneously read the port value and record that time in an atomic
  470. operation the in each iteration, the current time is stored in two arrays,
  471. one using the index before the time was recorded and the other using the
  472. index after the time was recorded.
  473. Once all the axes being monitored have become 0, or a timeout value is
  474. reached, the data left in the arrays is analysed to find the best
  475. estimate for the transition time for each axis. If the times before and
  476. after the transition differ by too much, it is judged that an interrupt
  477. must have occured so the last known good axis value is returned unless
  478. that falls outside the range in which it is known that the transition
  479. occured.\par
  480. This routine cannot be pageable as HID can make reads at dispatch-level.\par
  481. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: c:/ntddk/src/wdm/hid/hidgame/poll.c\par
  482. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Parameters\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i DeviceExtension}\par
  483. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Pointer to the device extension.\par
  484. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i resisitiveInputMask}\par
  485. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Mask that describes the axes lines that are to be polled\par
  486. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i fApproximate}\par
  487. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Boolean value indicating if it is OK to approximate some
  488. value of the current axis state with the last axis state
  489. if polling was not successful (we took an interrput during polling)\par
  490. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Axis[MAX_AXES]}\par
  491. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 The state of the axes. On entry the last axis state is passed
  492. into this routine. If the fApproximate flag is turned on, we can
  493. make use of the last axis state to "guess" the current axis state.\par
  494. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\i Button[PORT_BUTTONS]}\par
  495. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Receives the state of the buttons. 0x0 specifies the button is not
  496. pressed and 0x1 indicates an armed button state.\par
  497. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Return Codes\par
  498. \trowd \trgaph72\trleft-72 \cellx3078\cellx7038 \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_SUCCESS\cell success\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_DEVICE_NOT_CONNECTED\cell Device Failed to Quiesce
  499. ( not connected ) This is a failure code.\cell }\pard \intbl \row \pard\plain \intbl\s25\sa80\widctlpar\intbl \f4\fs21\lang1024 \sbasedon0\snext25 {\fs18 STATUS_TIMEOUT\cell Could not determine exact transition time for
  500. one or more axis. This is a success code.\cell }\pard \intbl \row \pard\plain \li240\sa0\sl240 \f2\fs20\lang1033 \par
  501. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  502. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 ANALOG_DEVICE Structure\par
  503. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 typedef struct \{\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab USHORT nAxes;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab USHORT nButtons;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab HIDGAME_OEM_DATA HidGameOemData;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ULONG ScaledTimeout;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ULONG ScaledThreshold;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ULONG LastGoodAxis[MAX_AXES];\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab UCHAR LastGoodButton[PORT_BUTTONS];\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab int AxisMap[MAX_AXES];\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab int povMap;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab UCHAR resistiveInputMask;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab UCHAR bSiblingState;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab BOOLEAN fSiblingFound;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \} ANALOG_DEVICE;\par
  504. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \par
  505. \pard\plain \sa160\sl240 \fs21\lang1033 Analog Device specific data.\par
  506. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: C:/NTDDK/SRC/WDM/HID/HIDGAME/ANALOG.H\par
  507. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Members\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b nAxes}\par
  508. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Number of axis this device has.\par
  509. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b nButtons}\par
  510. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Number of buttons this device has.\par
  511. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b HidGameOemData}\par
  512. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 The OEM Data field ( Contains joy_hws_dwFlags, vid & pid )\par
  513. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b ScaledTimeout}\par
  514. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 The number value at which an axis is considered to be not present.\par
  515. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b ScaledThreshold}\par
  516. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 The minimum resolution of a polling cycle.
  517. This is used to detect if we've been
  518. pre-empted or interrupted during a polling loop.\par
  519. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b LastGoodAxis[MAX_AXES]}\par
  520. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Value of the axes on last good poll.\par
  521. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b LastGoodButton[PORT_BUTTONS]}\par
  522. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Value of the buttons on last good poll.\par
  523. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b AxisMap[MAX_AXES]}\par
  524. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Index of axes remapping.\par
  525. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b povMap}\par
  526. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Index of axis where POV is mapped.\par
  527. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b resistiveInputMask}\par
  528. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Resisitive Input mask.\par
  529. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b bSiblingState}\par
  530. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Indicates the state of an expose sibling\\remove self transition\par
  531. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b fSiblingFound}\par
  532. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Set to true if this device has a sibling.\par
  533. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  534. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 DEVICE_EXTENSION Structure\par
  535. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 typedef struct \{\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab PGAMEENUM_READPORT ReadAccessor;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab PGAMEENUM_WRITEPORT WriteAccessor;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab PGAMEENUM_READPORT_DIGITAL ReadAccessorDigital;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab PGAMEENUM_ACQUIRE_PORT AcquirePort;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab PGAMEENUM_RELEASE_PORT ReleasePort;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab PVOID GameContext;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab PVOID PortContext;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab LIST_ENTRY Link;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab KEVENT RemoveEvent;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab LONG RequestCount;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab PDEVICE_OBJECT NextDeviceObject;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab WORK_QUEUE_ITEM WorkItem;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ANALOG_DEVICE unnamed structure see ANALOG_DEVICE;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab BOOLEAN fRemoved;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab BOOLEAN fStarted;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab BOOLEAN fSurpriseRemoved;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \} DEVICE_EXTENSION;\par
  536. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \par
  537. \pard\plain \sa160\sl240 \fs21\lang1033 Device specific data.\par
  538. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: C:/NTDDK/SRC/WDM/HID/HIDGAME/HIDGAME.H\par
  539. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Members\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b ReadAccessor}\par
  540. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Read Accessor function for the gameport. Obtained in the return from
  541. IOCTL to the gameport.\par
  542. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b WriteAccessor}\par
  543. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Write Accessor function for the gameport. Obtained in the return from
  544. IOCTL to the gameport.\par
  545. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b ReadAccessorDigital}\par
  546. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Digital read accessor for the gameport. Obtained as part of return from
  547. IOCTL to the gameport\par
  548. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b AcquirePort}\par
  549. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Function to call before reading/writing to the port. Obtained as
  550. part of return from IOCTL to the gameport\par
  551. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b ReleasePort}\par
  552. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Function to call when done reading/writing to the port. Obtained as
  553. part of return from IOCTL to the gameport\par
  554. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b GameContext}\par
  555. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Token to read this game port. Obtained as part of the return from
  556. IOCTL to the gameport.\par
  557. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b PortContext}\par
  558. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Context to pass to AcquirePort and ReleasePort. Obtained as part
  559. of the return from IOCTL to the gameport.\par
  560. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b Link}\par
  561. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Link to other hidgame devices on the system.\par
  562. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b RemoveEvent}\par
  563. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 The remove plugplay request must use this event to make sure all
  564. other requests have completed before it deletes the device object.\par
  565. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b RequestCount}\par
  566. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Number of IRPs underway.\par
  567. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b NextDeviceObject}\par
  568. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 NOTE: Only present if CHANGE_DEVICE is defined\par
  569. DeviceObject to send self created IRPs down to\par
  570. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b WorkItem}\par
  571. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 NOTE: Only present if CHANGE_DEVICE is defined\par
  572. Work item used for expose sibling/remove self\par
  573. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b unnamed structure see ANALOG_DEVICE}\par
  574. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Structure containing analog device specific information.\par
  575. NOTE: this structure is placed after the DWORD aligned elements.\par
  576. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b fRemoved}\par
  577. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Set to true if the device has been removed => all requests should be failed\par
  578. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b fStarted}\par
  579. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Set to true is device has started.\par
  580. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b fSurpriseRemoved}\par
  581. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Set to true if the device has been surprise removed by PnPs device has started.\par
  582. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 See Also\par \pard\plain \sa160\sl240 \fs21\lang1033 {\b ANALOG_DEVICE}.\par
  583. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  584. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HIDGAME_GLOBAL Structure\par
  585. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 typedef struct \{\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab FAST_MUTEX Mutex;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab LIST_ENTRY DeviceListHead;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab KSPIN_LOCK SpinLock;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab COUNTER_FUNCTION ReadCounter;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ULONG CounterScale;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \} HIDGAME_GLOBAL;\par
  586. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \par
  587. \pard\plain \sa160\sl240 \fs21\lang1033 Global struct to store driver wide data.
  588. Stuff we need to share across multiple instances of this driver.\par
  589. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: C:/NTDDK/SRC/WDM/HID/HIDGAME/HIDGAME.H\par
  590. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Members\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b Mutex}\par
  591. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Mutex to synchronize access to the following list entry\par
  592. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b DeviceListHead}\par
  593. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Keeps a list of all devices.\par
  594. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b SpinLock}\par
  595. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Spinlock used to stop multiple processors polling gameports at
  596. once. It would be better to keep a list of spinlocks, one for
  597. each gameport but then processors could contend for IO access
  598. and we'd have to maintain another list.\par
  599. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b ReadCounter}\par
  600. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Function to retrieve clock time\par
  601. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b CounterScale}\par
  602. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 The scale to be used.\par
  603. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  604. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 HIDGAME_INPUT_DATA Structure\par
  605. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 typedef struct \{\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ULONG Axis[MAX_AXES];\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab UCHAR hatswitch[2];\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab UCHAR Button[MAX_BUTTONS];\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \} HIDGAME_INPUT_DATA;\par
  606. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \par
  607. \pard\plain \sa160\sl240 \fs21\lang1033 Our HID reports always have 4 axis values (one of which may be a
  608. polled POV), 2 digital POVs and 10 buttons.
  609. Depending on the HWS flags and number of buttons some of the
  610. fields will report constant data.\par
  611. Note, this structure should be byte aligned so that the
  612. sizeof(it) is the same as HID will calculate given the report
  613. descriptor. (In this case it happens to be aligned anyway.)\par
  614. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: C:/NTDDK/SRC/WDM/HID/HIDGAME/ANALOG.H\par
  615. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Members\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b Axis[MAX_AXES]}\par
  616. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Axes data values.\par
  617. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b hatswitch[2]}\par
  618. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 digital POVs (derived from button combos)\par
  619. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b Button[MAX_BUTTONS]}\par
  620. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Button data values.\par
  621. \pard\plain \s57\li-1770\ri30\sb280\sa250\sl-120\keepn\brdrb\brdrs\brdrw15\brdrcf2 \fs8\cf8\lang1033 \par
  622. \pard\plain \s254\li-1800\sb200\sa80\sl-440\keepn \b\f0\fs40\lang1033 OEMDATA Structure\par
  623. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 typedef struct \{\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab USHORT VID;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab USHORT PID;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ULONG joy_hws_dwFlags;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ULONG Timeout;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \tab ULONG Reserved;\par \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \} OEMDATA;\par
  624. \pard\plain \s28\sl-220\tx380\tx760\tx1140\tx1520\tx1900\tx2280\tx2660\tx3040\tx3420\tx3800 \f19\fs16\lang1033 \par
  625. \pard\plain \sa160\sl240 \fs21\lang1033 OEMData is send to gameEnum as a parameter to IOCTL_EXPOSE_HARDWARE.
  626. Defined as 8 DWORDS. We interpert them here\par
  627. \pard\plain \sa160\sl240 \fs21\lang1033 Defined in: C:/NTDDK/SRC/WDM/HID/HIDGAME/ANALOG.H\par
  628. \pard\plain \s46\sb20\sl-220\keepn\pvpara\phpg\posy0\absw1560\dxfrtext240\dfrmtxtx240\dfrmtxty240 \b\f2\fs21\lang1033 Members\par \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b VID}\par
  629. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Vendor ID\par
  630. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b PID}\par
  631. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Product ID\par
  632. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b joy_hws_dwFlags}\par
  633. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 The dwFlags fields for the device ( Usually read from the registry )\par
  634. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b Timeout}\par
  635. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Global timeout for device polling in micro seconds\par
  636. \pard\plain \s50\sl-240\keepn \f0\fs21\lang1033 {\b Reserved}\par
  637. \pard\plain \s54\li280\sa80\sl-240 \f0\fs21\lang1033 Reserved for future use.\par
  638. }