Moving more files around.
authorStephaneLenclud
Sun, 15 Mar 2015 20:30:00 +0100
changeset 80e2acfa51664f
parent 79 cdc5f8f1b79e
child 81 baabcd5cdf8c
Moving more files around.
Hid/Tables/HidUsageTableConsumer.txt
Hid/Tables/HidUsageTableGameControls.txt
Hid/Tables/HidUsageTableGenericDesktop.txt
Hid/Tables/HidUsageTableSimulationControls.txt
Hid/Tables/HidUsageTableTelephonyDevice.txt
Hid/Tables/genUsageTableEnum.pl
HidUsageTableConsumer.txt
HidUsageTableGameControls.txt
HidUsageTableGenericDesktop.txt
HidUsageTableSimulationControls.txt
HidUsageTableTelephonyDevice.txt
Win32/PInvoke/pinvoke-input.txt
Win32/PInvoke/pinvoke-interop-assistant-input.c
genUsageTableEnum.pl
pinvoke-input.txt
pinvoke-interop-assistant-input.c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Hid/Tables/HidUsageTableConsumer.txt	Sun Mar 15 20:30:00 2015 +0100
     1.3 @@ -0,0 +1,382 @@
     1.4 +00  Unassigned   
     1.5 +01  Consumer Control  CA  15.1 
     1.6 +02  Numeric Key Pad  NAry  15.2 
     1.7 +03  Programmable Buttons  NAry  15.14 
     1.8 +04  Microphone  CA  15.1 
     1.9 +05  Headphone  CA  15.1 
    1.10 +06  Graphic Equalizer  CA  15.1 
    1.11 +07-1F  Reserved   
    1.12 +20  +10  OSC  15.2 
    1.13 +21  +100  OSC  15.2 
    1.14 +22  AM/PM  OSC  15.2 
    1.15 +23-3F  Reserved   
    1.16 +30  Power  OOC  15.3 
    1.17 +31  Reset  OSC  15.3 
    1.18 +32  Sleep  OSC  15.3 
    1.19 +33  Sleep After  OSC  15.3 
    1.20 +34  Sleep Mode  RTC  15.3 
    1.21 +35  Illumination  OOC  15.3 
    1.22 +36  Function Buttons  NAry  15.3 
    1.23 +37-3F  Reserved   
    1.24 +40  Menu  OOC  15.4 
    1.25 +41  Menu Pick  OSC  15.4 
    1.26 +42  Menu Up  OSC  15.4 
    1.27 +43  Menu Down  OSC  15.4 
    1.28 +44  Menu Left  OSC  15.4 
    1.29 +45  Menu Right  OSC  15.4 
    1.30 +46  Menu Escape  OSC  15.4 
    1.31 +47  Menu Value Increase  OSC  15.4 
    1.32 +48  Menu Value Decrease  OSC  15.4 
    1.33 +49-5F  Reserved   
    1.34 +60  Data On Screen  OOC  15.5 
    1.35 +61  Closed Caption  OOC  15.5 
    1.36 +62  Closed Caption Select  OSC  15.5 
    1.37 +63  VCR/TV  OOC  15.5 
    1.38 +64  Broadcast Mode  OSC  15.5 
    1.39 +65  Snapshot  OSC  15.5 
    1.40 +66  Still  OSC  15.5 
    1.41 +67-7F  Reserved   
    1.42 +80  Selection  NAry  15.6 
    1.43 +81  Assign Selection  OSC  15.6 
    1.44 +82  Mode Step  OSC  15.6 
    1.45 +83  Recall Last  OSC  15.6 
    1.46 +84  Enter Channel  OSC  15.6 
    1.47 +85  Order Movie  OSC  15.6 
    1.48 +86  Channel  LC  15.6 
    1.49 +87  Media Selection  NAry  15.6 
    1.50 +88  Media Select Computer  Sel  15.6 
    1.51 +89  Media Select TV  Sel  15.6 
    1.52 +8A  Media Select WWW  Sel  15.6 
    1.53 +8B  Media Select DVD  Sel  15.6 
    1.54 +8C  Media Select Telephone  Sel  15.6 
    1.55 +8D  Media Select Program Guide  Sel  15.6 
    1.56 +8E  Media Select Video Phone  Sel  15.6 
    1.57 +8F  Media Select Games  Sel  15.6 
    1.58 +90  Media Select Messages  Sel  15.6 
    1.59 +91  Media Select CD  Sel  15.6 
    1.60 +92  Media Select VCR  Sel  15.6 
    1.61 +93  Media Select Tuner  Sel  15.6 
    1.62 +94  Quit  OSC  15.6 
    1.63 +95  Help  OOC  15.6 
    1.64 +96  Media Select Tape  Sel  15.6 
    1.65 +97  Media Select Cable  Sel  15.6 
    1.66 +98  Media Select Satellite  Sel  15.6 
    1.67 +99  Media Select Security  Sel  15.6 
    1.68 +9A  Media Select Home  Sel  15.6 
    1.69 +9B  Media Select Call  Sel  15.6 
    1.70 +9C  Channel Increment  OSC  15.6 
    1.71 +9D  Channel Decrement  OSC  15.6 
    1.72 +9E  Media Select SAP  Sel  15.6 
    1.73 +9F  Reserved   
    1.74 +A0  VCR Plus  OSC  15.6 
    1.75 +A1  Once  OSC  15.6 
    1.76 +A2  Daily  OSC  15.6
    1.77 +A3  Weekly  OSC  15.6 
    1.78 +A4  Monthly  OSC  15.6 
    1.79 +A5-AF  Reserved   
    1.80 +B0  Play  OOC  15.7 
    1.81 +B1  Pause  OOC  15.7 
    1.82 +B2  Record  OOC  15.7 
    1.83 +B3  Fast Forward  OOC  15.7 
    1.84 +B4  Rewind  OOC  15.7 
    1.85 +B5  Scan Next Track  OSC  15.7 
    1.86 +B6  Scan Previous Track  OSC  15.7 
    1.87 +B7  Stop  OSC  15.7 
    1.88 +B8  Eject  OSC  15.7 
    1.89 +B9  Random Play  OOC  15.7 
    1.90 +BA  Select Disc  NAry  15.7 
    1.91 +BB  Enter Disc  MC  15.7 
    1.92 +BC  Repeat  OSC  15.7 
    1.93 +BD  Tracking  LC  15.7 
    1.94 +BE  Track Normal  OSC  15.7 
    1.95 +BF  Slow Tracking  LC  15.7 
    1.96 +C0  Frame Forward  RTC  15.7 
    1.97 +C1  Frame Back  RTC  15.7 
    1.98 +C2  Mark  OSC  15.8 
    1.99 +C3  Clear Mark  OSC  15.8 
   1.100 +C4  Repeat From Mark  OOC  15.8 
   1.101 +C5  Return To Mark  OSC  15.8 
   1.102 +C6  Search Mark Forward  OSC  15.8 
   1.103 +C7  Search Mark Backwards  OSC  15.8 
   1.104 +C8  Counter Reset  OSC  15.8 
   1.105 +C9  Show Counter  OSC  15.8 
   1.106 +CA  Tracking Increment  RTC  15.7 
   1.107 +CB  Tracking Decrement  RTC  15.7 
   1.108 +CC  Stop/Eject  OSC  15.7 
   1.109 +CD  Play/Pause  OSC  15.7 
   1.110 +CE  Play/Skip  OSC  15.7 
   1.111 +CF-DF  Reserved   
   1.112 +E0  Volume  LC  15.9.1 
   1.113 +E1  Balance  LC  15.9.2 
   1.114 +E2  Mute  OOC  15.9.1 
   1.115 +E3  Bass  LC  15.9.3 
   1.116 +E4  Treble  LC  15.9.4 
   1.117 +E5  Bass Boost  OOC  15.9.3 
   1.118 +E6  Surround Mode  OSC  15.9.5 
   1.119 +E7  Loudness  OOC  15.9.5 
   1.120 +E8  MPX  OOC  15.9.5 
   1.121 +E9  Volume Increment  RTC  15.9.1 
   1.122 +EA  Volume Decrement  RTC  15.9.1 
   1.123 +EB-EF  Reserved   
   1.124 +F0  Speed Select  OSC  15.10 
   1.125 +F1  Playback Speed  NAry  15.10 
   1.126 +F2  Standard Play  Sel  15.10 
   1.127 +F3  Long Play  Sel  15.10 
   1.128 +F4  Extended Play  Sel  15.10 
   1.129 +F5  Slow  OSC  15.10 
   1.130 +F6-FF  Reserved   
   1.131 +100  Fan Enable  OOC  15.11 
   1.132 +101  Fan Speed  LC  15.11 
   1.133 +102  Light Enable  OOC  15.11 
   1.134 +103  Light Illumination Level  LC  15.11 
   1.135 +104  Climate Control Enable  OOC  15.11 
   1.136 +105  Room Temperature  LC  15.11 
   1.137 +106  Security Enable  OOC  15.11 
   1.138 +107  Fire Alarm  OSC  15.11 
   1.139 +108  Police Alarm  OSC  15.11 
   1.140 +109  Proximity  LC  15.11 
   1.141 +10A Motion  OSC  15.11 
   1.142 +10B Duress Alarm  OSC  15.11 
   1.143 +10C Holdup Alarm  OSC  15.11 
   1.144 +10D Medical Alarm  OSC  15.11 
   1.145 +10E-14F Reserved    
   1.146 +150  Balance Right  RTC  15.9.2 
   1.147 +151  Balance Left  RTC  15.9.2 
   1.148 +152  Bass Increment  RTC  15.9.3 
   1.149 +153  Bass Decrement  RTC  15.9.3 
   1.150 +154  Treble Increment  RTC  15.9.4 
   1.151 +155  Treble Decrement  RTC  15.9.4 
   1.152 +156-15F  Reserved   
   1.153 +160  Speaker System  CL  15.12.1 
   1.154 +161  Channel Left  CL  15.12.1 
   1.155 +162  Channel Right  CL  15.12.1 
   1.156 +163  Channel Center  CL  15.12.1 
   1.157 +164  Channel Front  CL  15.12.1 
   1.158 +165  Channel Center Front  CL  15.12.1 
   1.159 +166  Channel Side  CL  15.12.1 
   1.160 +167  Channel Surround  CL  15.12.1 
   1.161 +168  Channel Low Frequency Enhancement  CL  15.12.1 
   1.162 +169  Channel Top  CL  15.12.1 
   1.163 +16A  Channel Unknown  CL  15.12.1 
   1.164 +16B-16F  Reserved   
   1.165 +170  Sub-channel  LC  15.13 
   1.166 +171  Sub-channel Increment  OSC  15.13 
   1.167 +172  Sub-channel Decrement  OSC  15.13 
   1.168 +173  Alternate Audio Increment  OSC  15.13 
   1.169 +174  Alternate Audio Decrement  OSC  15.13 
   1.170 +175-17F  Reserved   
   1.171 +180  Application Launch Buttons  NAry  15.15 
   1.172 +181  AL Launch Button Configuration Tool Sel  15.15 
   1.173 +182  AL Programmable Button Configuration Sel  15.15 
   1.174 +183  AL Consumer Control Configuration Sel  15.15 
   1.175 +184  AL Word Processor  Sel  15.15 
   1.176 +185  AL Text Editor  Sel  15.15 
   1.177 +186  AL Spreadsheet  Sel  15.15 
   1.178 +187  AL Graphics Editor  Sel  15.15 
   1.179 +188  AL Presentation App  Sel  15.15 
   1.180 +189  AL Database App  Sel  15.15 
   1.181 +18A  AL Email Reader  Sel  15.15 
   1.182 +18B  AL Newsreader  Sel  15.15 
   1.183 +18C  AL Voicemail  Sel  15.15 
   1.184 +18D  AL Contacts/Address Book  Sel  15.15 
   1.185 +18E  AL Calendar/Schedule  Sel  15.15 
   1.186 +18F  AL Task/Project Manager  Sel  15.15 
   1.187 +190  AL Log/Journal/Timecard  Sel  15.15 
   1.188 +191  AL Checkbook/Finance  Sel  15.15 
   1.189 +192  AL Calculator  Sel  15.15 
   1.190 +193  AL A/V Capture/Playback  Sel  15.15 
   1.191 +194  AL Local Machine Browser  Sel  15.15 
   1.192 +195  AL LAN/WAN Browser  Sel  15.15 
   1.193 +196  AL Internet Browser  Sel  15.15 
   1.194 +197  AL Remote Networking/ISP Connect Sel  15.15 
   1.195 +198  AL Network Conference  Sel  15.15 
   1.196 +199  AL Network Chat  Sel  15.15 
   1.197 +19A  AL Telephony/Dialer  Sel  15.15 
   1.198 +19B  AL Logon  Sel  15.15 
   1.199 +19C  AL Logoff  Sel  15.15 
   1.200 +19D  AL Logon/Logoff  Sel  15.15 
   1.201 +19E  AL Terminal Lock/Screensaver  Sel  15.15 
   1.202 +19F  AL Control Panel  Sel  15.15 
   1.203 +1A0  AL Command Line Processor/Run Sel  15.15 
   1.204 +1A1  AL Process/Task Manager  Sel  15.15 
   1.205 +1A2  AL Select Task/Application  Sel  15.15 
   1.206 +1A3  AL Next Task/Application  Sel  15.15 
   1.207 +1A4  AL Previous Task/Application  Sel  15.15 
   1.208 +1A5  AL Preemptive Halt Task/Application Sel  15.15 
   1.209 +1A6  AL Integrated Help Center  Sel  15.15 
   1.210 +1A7 AL Documents  Sel  15.15 
   1.211 +1A8 AL Thesaurus  Sel  15.15 
   1.212 +1A9 AL Dictionary  Sel  15.15 
   1.213 +1AA AL Desktop  Sel  15.15 
   1.214 +1AB  AL Spell Check  Sel  15.15 
   1.215 +1AC  AL Grammar Check  Sel  15.15 
   1.216 +1AD  AL Wireless Status  Sel  15.15 
   1.217 +1AE  AL Keyboard Layout  Sel  15.15 
   1.218 +1AF  AL Virus Protection  Sel  15.15 
   1.219 +1B0 AL Encryption  Sel  15.15 
   1.220 +1B1  AL Screen Saver  Sel  15.15 
   1.221 +1B2 AL Alarms  Sel  15.15 
   1.222 +1B3 AL Clock  Sel  15.15 
   1.223 +1B4  AL File Browser  Sel  15.15 
   1.224 +1B5  AL Power Status  Sel  15.15 
   1.225 +1B6  AL Image Browser  Sel  15.15 
   1.226 +1B7  AL Audio Browser  Sel  15.15 
   1.227 +1B8  AL Movie Browser  Sel  15.15 
   1.228 +1B9  AL Digital Rights Manager  Sel  15.15
   1.229 +1BA  AL Digital Wallet  Sel  15.15 
   1.230 +1BB Reserved 
   1.231 +1BC  AL Instant Messaging  Sel  15.15 
   1.232 +1BD  AL OEM Features/ Tips/Tutorial Browser Sel  15.15 
   1.233 +1BE  AL OEM Help  Sel  15.15 
   1.234 +1BF  AL Online Community  Sel  15.15 
   1.235 +1C0  AL Entertainment Content Browser Sel  15.15 
   1.236 +1C1  AL Online Shopping Browser  Sel  15.15 
   1.237 +1C2 AL SmartCard Information/Help Sel  15.15 
   1.238 +1C3  AL Market Monitor/Finance Browser Sel  15.15 
   1.239 +1C4  AL Customized Corporate News Browser Sel  15.15 
   1.240 +1C5  AL Online Activity Browser  Sel  15.15 
   1.241 +1C6  AL Research/Search Browser  Sel  15.15 
   1.242 +1C7  AL Audio Player  Sel  15.15 
   1.243 +1C8-1FF Reserved
   1.244 +200  Generic GUI Application Controls Nary  15.16 
   1.245 +201  AC New  Sel  15.16 
   1.246 +202  AC Open  Sel  15.16 
   1.247 +203  AC Close  Sel  15.16 
   1.248 +204  AC Exit  Sel  15.16 
   1.249 +205  AC Maximize  Sel  15.16 
   1.250 +206  AC Minimize  Sel  15.16 
   1.251 +207  AC Save  Sel  15.16 
   1.252 +208  AC Print  Sel  15.16 
   1.253 +209  AC Properties  Sel  15.16 
   1.254 +21A  AC Undo  Sel  15.16 
   1.255 +21B  AC Copy  Sel  15.16 
   1.256 +21C  AC Cut  Sel  15.16 
   1.257 +21D  AC Paste  Sel  15.16 
   1.258 +21E  AC Select All  Sel  15.16 
   1.259 +21F  AC Find  Sel  15.16 
   1.260 +220  AC Find and Replace  Sel  15.16 
   1.261 +221  AC Search  Sel  15.16 
   1.262 +222  AC Go To  Sel  15.16 
   1.263 +223  AC Home  Sel  15.16 
   1.264 +224  AC Back  Sel  15.16
   1.265 +225  AC Forward  Sel  15.16 
   1.266 +226  AC Stop  Sel  15.16 
   1.267 +227  AC Refresh  Sel  15.16 
   1.268 +228  AC Previous Link  Sel  15.16 
   1.269 +229  AC Next Link  Sel  15.16 
   1.270 +22A  AC Bookmarks  Sel  15.16 
   1.271 +22B  AC History  Sel  15.16 
   1.272 +22C  AC Subscriptions  Sel  15.16 
   1.273 +22D  AC Zoom In  Sel  15.16 
   1.274 +22E  AC Zoom Out  Sel  15.16 
   1.275 +22F  AC Zoom  LC  15.16 
   1.276 +230  AC Full Screen View  Sel  15.16 
   1.277 +231  AC Normal View  Sel  15.16 
   1.278 +232  AC View Toggle  Sel  15.16 
   1.279 +233  AC Scroll Up  Sel  15.16 
   1.280 +234  AC Scroll Down  Sel  15.16 
   1.281 +235  AC Scroll  LC  15.16 
   1.282 +236  AC Pan Left  Sel  15.16 
   1.283 +237  AC Pan Right  Sel  15.16 
   1.284 +238  AC Pan  LC  15.16 
   1.285 +239  AC New Window  Sel  15.16 
   1.286 +23A  AC Tile Horizontally  Sel  15.16 
   1.287 +23B  AC Tile Vertically  Sel  15.16 
   1.288 +23C  AC Format  Sel  15.16 
   1.289 +23D AC Edit  Sel  15.14 
   1.290 +23E AC Bold  Sel  15.16 
   1.291 +23F AC Italics  Sel  15.16 
   1.292 +240 AC Underline  Sel  15.16 
   1.293 +241 AC Strikethrough  Sel  15.16 
   1.294 +242 AC Subscript  Sel  15.16 
   1.295 +243 AC Superscript  Sel  15.16 
   1.296 +244  AC All Caps  Sel  15.16 
   1.297 +245 AC Rotate  Sel  15.16 
   1.298 +246 AC Resize  Sel  15.16 
   1.299 +247  AC Flip horizontal  Sel  15.16 
   1.300 +248  AC Flip Vertical  Sel  15.16 
   1.301 +249  AC Mirror Horizontal  Sel  15.16 
   1.302 +24A  AC Mirror Vertical  Sel  15.16 
   1.303 +24B  AC Font Select  Sel  15.16 
   1.304 +24C  AC Font Color  Sel  15.16 
   1.305 +24D  AC Font Size  Sel  15.16 
   1.306 +24E  AC Justify Left  Sel  15.16 
   1.307 +24F  AC Justify Center H  Sel  15.16 
   1.308 +250  AC Justify Right  Sel  15.16 
   1.309 +251  AC Justify Block H  Sel  15.16 
   1.310 +252  AC Justify Top  Sel  15.16 
   1.311 +253  AC Justify Center V  Sel  15.16 
   1.312 +254  AC Justify Bottom  Sel  15.16 
   1.313 +255  AC Justify Block V  Sel  15.16 
   1.314 +256  AC Indent Decrease  Sel  15.16 
   1.315 +257  AC Indent Increase  Sel  15.16 
   1.316 +258 AC Numbered List  Sel  15.16 
   1.317 +259  AC Restart Numbering  Sel  15.16 
   1.318 +25A  AC Bulleted List  Sel  15.16 
   1.319 +25B AC Promote  Sel  15.16 
   1.320 +25C AC Demote  Sel  15.16 
   1.321 +25D AC Yes  Sel  15.16 
   1.322 +25E AC No  Sel  15.16 
   1.323 +25F AC Cancel  Sel  15.16 
   1.324 +260 AC Catalog  Sel  15.16 
   1.325 +261 AC Buy/Checkout  Sel  15.16 
   1.326 +262  AC Add to Cart  Sel  15.16 
   1.327 +263 AC Expand  Sel  15.16 
   1.328 +264  AC Expand All  Sel  15.16 
   1.329 +265 AC Collapse  Sel  15.16 
   1.330 +266  AC Collapse All  Sel  15.16 
   1.331 +267  AC Print Preview  Sel  15.16 
   1.332 +268  AC Paste Special  Sel  15.16 
   1.333 +269  AC Insert Mode  Sel  15.16 
   1.334 +26A AC Delete  Sel  15.16 
   1.335 +26B AC Lock  Sel  15.16 
   1.336 +26C AC Unlock  Sel  15.16 
   1.337 +26D AC Protect  Sel  15.16 
   1.338 +26E AC Unprotect  Sel  15.16 
   1.339 +26F  AC Attach Comment  Sel  15.16 
   1.340 +270  AC Delete Comment  Sel  15.16 
   1.341 +271  AC View Comment  Sel  15.16 
   1.342 +272  AC Select Word  Sel  15.16 
   1.343 +273  AC Select Sentence  Sel  15.16 
   1.344 +274 AC Select Paragraph Sel 15.16
   1.345 +275 AC Select Column Sel 15.16
   1.346 +276 AC Select Row Sel 15.16
   1.347 +277 AC Select Table Sel 15.16
   1.348 +278 AC Select Object Sel 15.16
   1.349 +279 AC Redo/Repeat Sel 15.16
   1.350 +27A AC Sort Sel 15.16
   1.351 +27B AC Sort Ascending Sel 15.16
   1.352 +27C AC Sort Descending Sel 15.16
   1.353 +27D AC Filter Sel 15.16
   1.354 +27E AC Set Clock Sel 15.16
   1.355 +27F AC View Clock Sel 15.16
   1.356 +280 AC Select Time Zone Sel 15.16
   1.357 +281 AC Edit Time Zones Sel 15.16
   1.358 +282 AC Set Alarm Sel 15.16
   1.359 +283 AC Clear Alarm Sel 15.16
   1.360 +284 AC Snooze Alarm Sel 15.16
   1.361 +285 AC Reset Alarm Sel 15.16
   1.362 +286 AC Synchronize Sel 15.16
   1.363 +287 AC Send/Receive Sel 15.16
   1.364 +288 AC Send To Sel 15.16
   1.365 +289 AC Reply Sel 15.16
   1.366 +28A AC Reply All Sel 15.16
   1.367 +28B AC Forward Msg Sel 15.16
   1.368 +28C AC Send Sel 15.16
   1.369 +28D AC Attach File Sel 15.16
   1.370 +28E AC Upload Sel 15.16
   1.371 +28F AC Download Save Target As Sel 15.16
   1.372 +290 AC Set Borders Sel 15.16
   1.373 +291 AC Insert Row Sel 15.16
   1.374 +292 AC Insert Column Sel 15.16
   1.375 +293 AC Insert File Sel 15.16
   1.376 +294 AC Insert Picture Sel 15.16
   1.377 +295 AC Insert Object Sel 15.16
   1.378 +296 AC Insert Symbol Sel 15.16
   1.379 +297 AC Save and Close Sel 15.16
   1.380 +298 AC Rename Sel 15.16
   1.381 +299 AC Merge Sel 15.16
   1.382 +29A AC Split Sel 15.16
   1.383 +29B AC Distribute Horizontally Sel 15.16
   1.384 +29C  AC Distribute Vertically  Sel  15.16 
   1.385 +29D-FFFF Reserved 
   1.386 \ No newline at end of file
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Hid/Tables/HidUsageTableGameControls.txt	Sun Mar 15 20:30:00 2015 +0100
     2.3 @@ -0,0 +1,31 @@
     2.4 +00 Undefined   
     2.5 +01  3D Game Controller  CA  8.1 
     2.6 +02  Pinball Device  CA  8.2 
     2.7 +03  Gun Device  CA  8.3 
     2.8 +04-1F Reserved 
     2.9 +20  Point of View  CP  8.1 
    2.10 +21 Turn Right/Left  DV  8.1 
    2.11 +22  Pitch Forward/Backward  DV  8.1 
    2.12 +23  Roll Right/Left  DV  8.1 
    2.13 +24 Move Right/Left  DV  8.1 
    2.14 +25 Move Forward/Backward DV  8.1 
    2.15 +26 Move Up/Down  DV  8.1 
    2.16 +27 Lean Right/Left  DV  8.1 
    2.17 +28 Lean Forward/Backward DV  8.1 
    2.18 +29  Height of POV  DV  8.1 
    2.19 +2A Flipper  MC  8.2 
    2.20 +2B Secondary Flipper  MC  8.2 
    2.21 +2C Bump  MC  8.2 
    2.22 +2D New Game  OSC  8.2 
    2.23 +2E Shoot Ball  OSC  8.2 
    2.24 +2F Player  OSC  8.2 
    2.25 +30 Gun Bolt  OOC  8.3 
    2.26 +31 Gun Clip  OOC  8.3 
    2.27 +32  Gun Selector  NAry  8.3 
    2.28 +33  Gun Single Shot  Sel  8.3 
    2.29 +34 Gun Burst  Sel  8.3 
    2.30 +35 Gun Automatic  Sel  8.3 
    2.31 +36 Gun Safety  OOC  8.3 
    2.32 +37  Gamepad Fire/Jump  CL  8.4.1 
    2.33 +39  Gamepad Trigger  CL  8.4.1 
    2.34 +3A-FFFF Reserved 
    2.35 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/Hid/Tables/HidUsageTableGenericDesktop.txt	Sun Mar 15 20:30:00 2015 +0100
     3.3 @@ -0,0 +1,75 @@
     3.4 +00 Undefined   
     3.5 +01  Pointer  CP  4.1 
     3.6 +02  Mouse  CA  4.1  03 Reserved   
     3.7 +04  Joystick  CA  4.1 
     3.8 +05  Game Pad  CA  4.1 
     3.9 +06  Keyboard  CA  4.1 
    3.10 +07  Keypad  CA  4.1 
    3.11 +08  Multi-axis Controller  CA  4.1 
    3.12 +09  Tablet PC System Controls  CA  4.1 
    3.13 +0A-2F Reserved 
    3.14 +30 X  DV  4.2 
    3.15 +31 Y  DV  4.2 
    3.16 +32 Z  DV  4.2 
    3.17 +33 Rx  DV  4.2 
    3.18 +34 Ry  DV  4.2 
    3.19 +35 Rz  DV  4.2 
    3.20 +36 Slider  DV  4.3 
    3.21 +37 Dial  DV  4.3 
    3.22 +38 Wheel  DV  4.3 
    3.23 +39 Hat switch  DV  4.3 
    3.24 +3A  Counted Buffer  CL  4.6 
    3.25 +3B Byte Count  DV  4.6 
    3.26 +3C Motion Wakeup  OSC  4.3 
    3.27 +3D Start  OOC  4.3 
    3.28 +3E Select  OOC  4.3  3F Reserved   
    3.29 +40 Vx  DV  4.3.1 
    3.30 +41 Vy  DV  4.3.1 
    3.31 +42 Vz  DV  4.3.1 
    3.32 +43 Vbrx  DV  4.3.1 
    3.33 +44 Vbry  DV  4.3.1 
    3.34 +45 Vbrz  DV  4.3.1 
    3.35 +46 Vno  DV  4.3.1 
    3.36 +47 Feature Notification  DV,DF  4.8 
    3.37 +48 Resolution Multiplier DV 
    3.38 +49-7F Reserved 
    3.39 +80  System Control  CA  4.5 
    3.40 +81 System Power Down OSC  4.5 
    3.41 +82 System Sleep  OSC  4.5.1 
    3.42 +83 System Wake Up  OSC  4.5.1 
    3.43 +84  System Context Menu  OSC  4.5 
    3.44 +85 System Main Menu  OSC  4.5 
    3.45 +86  System App Menu  OSC  4.5 
    3.46 +87 System Menu Help  OSC  4.5 
    3.47 +88 System Menu Exit  OSC  4.5 
    3.48 +89 System Menu Select OSC  4.5 
    3.49 +8A System Menu Right  RTC  4.5 
    3.50 +8B System Menu Left  RTC  4.5 
    3.51 +8C System Menu Up  RTC  4.5 
    3.52 +8D System Menu Down  RTC  4.5 
    3.53 +8E  System Cold Restart  OSC  4.5.1 
    3.54 +8F  System Warm Restart  OSC  4.5.1 
    3.55 +90 D-pad Up  OOC  4.7 
    3.56 +91 D-pad Down  OOC  4.7 
    3.57 +92 D-pad Right  OOC  4.7 
    3.58 +93 D-pad Left  OOC  4.7 
    3.59 +94-9F Reserved 
    3.60 +A0 System Dock  OSC  4.5.1 
    3.61 +A1 System Undock  OSC  4.5.1 
    3.62 +A2 System Setup  OSC  4.5.1 
    3.63 +A3 System Break  OSC  4.9 
    3.64 +A4  System Debugger Break  OSC  4.9 
    3.65 +A5 Application Break  OSC  4.9 
    3.66 +A6  Application Debugger Break  OSC  4.9 
    3.67 +A7  System Speaker Mute  OSC  4.5.1 
    3.68 +A8 System Hibernate  OSC  4.5.1 
    3.69 +A9-AF Reserved 
    3.70 +B0  System Display Invert  OSC  4.10 
    3.71 +B1  System Display Internal  OSC  4.10 
    3.72 +B2  System Display External  OSC  4.10 
    3.73 +B3  System Display Both  OSC  4.10 
    3.74 +B4  System Display Dual  OSC  4.10 
    3.75 +B5  System Display Toggle Int/Ext  OSC  4.10 
    3.76 +B6  System Display Swap Primary/Secondary OSC  4.10 
    3.77 +B7  System Display LCD Autoscale  OSC  4.10 
    3.78 +B8-FFFF Reserved 
    3.79 \ No newline at end of file
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/Hid/Tables/HidUsageTableSimulationControls.txt	Sun Mar 15 20:30:00 2015 +0100
     4.3 @@ -0,0 +1,55 @@
     4.4 +00 Undefined   
     4.5 +01  Flight Simulation Device  CA  5.2 
     4.6 +02  Automobile Simulation Device  CA  5.3 
     4.7 +03  Tank Simulation Device  CA  5.4 
     4.8 +04  Spaceship Simulation Device  CA  5.2 
     4.9 +05  Submarine Simulation Device  CA  5.5 
    4.10 +06  Sailing Simulation Device  CA  5.5 
    4.11 +07  Motorcycle Simulation Device  CA  5.6 
    4.12 +08  Sports Simulation Device  CA  5.1 
    4.13 +09  Airplane Simulation Device  CA  5.2 
    4.14 +0A  Helicopter Simulation Device  CA  5.2 
    4.15 +0B  Magic Carpet Simulation Device CA  5.7 
    4.16 +0C  Bicycle Simulation Device  CA  5.6 
    4.17 +0D – 1F  Reserved   
    4.18 +20  Flight Control Stick  CA  5.2 
    4.19 +21  Flight Stick  CA  5.2 
    4.20 +22  Cyclic Control  CP  5.2 
    4.21 +23  Cyclic Trim  CP  5.2 
    4.22 +24  Flight Yoke  CA  5.2 
    4.23 +25  Track Control  CP  5.4 
    4.24 +26 –AF  Reserved   
    4.25 +B0 Aileron  DV  5.2 
    4.26 +B1 Aileron Trim  DV  5.2 
    4.27 +B2 Anti-Torque Control  DV  5.2 
    4.28 +B3 Autopilot Enable  OOC  5.2 
    4.29 +B4 Chaff Release  OSC  5.2 
    4.30 +B5 Collective Control  DV  5.2 
    4.31 +B6 Dive Brake  DV  5.2 
    4.32 +B7 Electronic Countermeasures OOC  5.2 
    4.33 +B8 Elevator  DV  5.2 
    4.34 +B9 Elevator Trim  DV  5.2 
    4.35 +BA Rudder  DV  5.2 
    4.36 +BB Throttle  DV  5.2 
    4.37 +BC Flight Communications OOC  5.2 
    4.38 +BD Flare Release  OSC  5.2 
    4.39 +BE Landing Gear  OOC  5.2 
    4.40 +BF Toe Brake  DV  5.2 
    4.41 +C0 Trigger  MC  5.2 
    4.42 +C1 Weapons Arm  OOC  5.2 
    4.43 +C2 Weapons Select  OSC  5.2 
    4.44 +C3 Wing Flaps  DV  5.2 
    4.45 +C4 Accelerator  DV  5.3 
    4.46 +C5 Brake  DV  5.3 
    4.47 +C6 Clutch  DV  5.3 
    4.48 +C7 Shifter  DV  5.3 
    4.49 +C8 Steering  DV  5.3 
    4.50 +C9 Turret Direction  DV  5.4 
    4.51 +CA Barrel Elevation  DV  5.4 
    4.52 +CB Dive Plane  DV  5.5 
    4.53 +CC Ballast  DV  5.5 
    4.54 +CD Bicycle Crank  DV  5.6 
    4.55 +CE Handle Bars  DV  5.6 
    4.56 +CF Front Brake  DV  5.6 
    4.57 +D0 Rear Brake  DV  5.6 
    4.58 +D1-FFFF Reserved 
    4.59 \ No newline at end of file
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/Hid/Tables/HidUsageTableTelephonyDevice.txt	Sun Mar 15 20:30:00 2015 +0100
     5.3 @@ -0,0 +1,72 @@
     5.4 +00  Unassigned   
     5.5 +01  Phone  CA  14.1 
     5.6 +02  Answering Machine  CA  14.1 
     5.7 +03  Message Controls  CL  14.1 
     5.8 +04  Handset  CL  14.1 
     5.9 +05  Headset  CL  14.1 
    5.10 +06  Telephony Key Pad  NAry  14.2 
    5.11 +07  Programmable Button  NAry  14.2 
    5.12 +08-1F  Reserved   
    5.13 +20  Hook Switch  OOC  14.3 
    5.14 +21  Flash  MC  14.3 
    5.15 +22  Feature  OSC  14.3 
    5.16 +23  Hold  OOC  14.3 
    5.17 +24  Redial  OSC  14.3 
    5.18 +25  Transfer  OSC  14.3 
    5.19 +26  Drop  OSC  14.3 
    5.20 +27  Park  OOC  14.3 
    5.21 +28  Forward Calls  OOC  14.3 
    5.22 +29  Alternate Function  MC  14.3 
    5.23 +2A  Line  OSC, NAry  14.3 
    5.24 +2B  Speaker Phone  OOC  14.3 
    5.25 +2C  Conference  OOC  14.3 
    5.26 +2D  Ring Enable  OOC  14.3 
    5.27 +2E  Ring Select  OSC  14.3 
    5.28 +2F  Phone Mute  OOC  14.3 
    5.29 +30  Caller ID  MC  14.3 
    5.30 +31  Send  OOC  14.3 
    5.31 +32-4F  Reserved   
    5.32 +50  Speed Dial  OSC  14.4 
    5.33 +51  Store Number  OSC  14.4 
    5.34 +52  Recall Number  OSC  14.4 
    5.35 +53  Phone Directory  OOC  14.4 
    5.36 +54-6F  Reserved   
    5.37 +70  Voice Mail  OOC  14.5 
    5.38 +71  Screen Calls  OOC  14.5 
    5.39 +72  Do Not Disturb  OOC  14.5 
    5.40 +73  Message  OSC  14.5 
    5.41 +74  Answer On/Off  OOC  14.5 
    5.42 +75-8F  Reserved   
    5.43 +90  Inside Dial Tone  MC  14.6 
    5.44 +91  Outside Dial Tone  MC  14.6 
    5.45 +92  Inside Ring Tone  MC  14.6 
    5.46 +93  Outside Ring Tone  MC  14.6 
    5.47 +94  Priority Ring Tone  MC  14.6 
    5.48 +95  Inside Ringback  MC  14.6 
    5.49 +96  Priority Ringback  MC  14.6 
    5.50 +97  Line Busy Tone  MC  14.6 
    5.51 +98  Reorder Tone  MC  14.6 
    5.52 +99  Call Waiting Tone  MC  14.6 
    5.53 +9A  Confirmation Tone 1  MC  14.6 
    5.54 +9B  Confirmation Tone 2  MC  14.6 
    5.55 +9C  Tones Off  OOC  14.6 
    5.56 +9D  Outside Ringback  MC  14.6 
    5.57 +9E  Ringer  OOC  14.6 
    5.58 +9E-AF  Reserved   
    5.59 +B0  Phone Key 0  Sel  14.2 
    5.60 +B1  Phone Key 1  Sel  14.2 
    5.61 +B2  Phone Key 2  Sel  14.2 
    5.62 +B3  Phone Key 3  Sel  14.2 
    5.63 +B4  Phone Key 4  Sel  14.2 
    5.64 +B5  Phone Key 5  Sel  14.2 
    5.65 +B6  Phone Key 6  Sel  14.2 
    5.66 +B7  Phone Key 7  Sel  14.2 
    5.67 +B8  Phone Key 8  Sel  14.2 
    5.68 +B9  Phone Key 9  Sel  14.2 
    5.69 +BA  Phone Key Star  Sel  14.2 
    5.70 +BB  Phone Key Pound  Sel  14.2 
    5.71 +BC  Phone Key A  Sel  14.2 
    5.72 +BD  Phone Key B  Sel  14.2 
    5.73 +BE  Phone Key C  Sel  14.2 
    5.74 +BF  Phone Key D  Sel  14.2 
    5.75 +C0-FFFF  Reserved  
    5.76 \ No newline at end of file
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/Hid/Tables/genUsageTableEnum.pl	Sun Mar 15 20:30:00 2015 +0100
     6.3 @@ -0,0 +1,106 @@
     6.4 +#!/usr/local/bin/perl
     6.5 +#Developed by Stéphane Lenclud
     6.6 +#Generate C# enumeration from parsing Hid Usage Table
     6.7 +#See ../data/gl.h
     6.8 +#Usage example
     6.9 +#perl -S genUsageTableEnum.pl ../data/gl.h
    6.10 +
    6.11 +use strict;
    6.12 +use warnings;	
    6.13 +
    6.14 +
    6.15 +my $inputFile = $ARGV[0];
    6.16 +
    6.17 +#my $dummy="lala";
    6.18 +#$dummy=~s/(^\w)/uc($1)/e;
    6.19 +#print "$dummy";
    6.20 +#exit(0);
    6.21 +
    6.22 +#Open input file
    6.23 +open INPUT, "< $inputFile" or die "Can't read $inputFile\n";
    6.24 +my @lines = <INPUT>;
    6.25 +close INPUT;
    6.26 +
    6.27 +
    6.28 +my %hash = ();
    6.29 +
    6.30 +my $count=0;
    6.31 +foreach my $line(@lines)
    6.32 +	{
    6.33 +	#if ($line=~ /^([a-fA-FxX\d]+)(.+)\s+\w+\s+15\..*$/)	
    6.34 +	if ($line=~ /^([a-fA-FxX\d]+)(.+)\s+\w+\s+\d+\..*$/)
    6.35 +		{
    6.36 +		my $string=$2;
    6.37 +		my $value=$1;
    6.38 +		
    6.39 +		my $varName=FormatVarName($string);	
    6.40 +
    6.41 +		
    6.42 +		$hash{$string}=$value;
    6.43 +		
    6.44 +		print "$varName = 0x$value,\n";			
    6.45 +		}
    6.46 +	else
    6.47 +		{
    6.48 +		#print "NO MATCH $line\n";
    6.49 +		}
    6.50 +	}
    6.51 +
    6.52 +exit(0);	
    6.53 +	
    6.54 +#Output in sorted order	
    6.55 +for my $string ( sort keys %hash )
    6.56 +	{	
    6.57 +    #print "_S8(\"$string\"),$hash{$string}, //$count\n";
    6.58 +    print "_S8(\"$string\"),$string, //$count\n";						
    6.59 +    $count++;	
    6.60 +    }	
    6.61 +	
    6.62 +	
    6.63 +print "$count const found.\n";	
    6.64 +	
    6.65 +exit(0);
    6.66 +
    6.67 +#	
    6.68 +
    6.69 +sub FormatVarName
    6.70 +	{
    6.71 +	my $text=$_[0];	
    6.72 +	my $varName="";
    6.73 +	Trim($text);
    6.74 +	#Make sure AC ends up as AppCtrl
    6.75 +	$text=~s/(^AC)/App Ctrl/;
    6.76 +	#Make sure AL ends up as AppLaunch
    6.77 +	$text=~s/(^AL)/App Launch/;		
    6.78 +	#Replace / by white-space
    6.79 +	$text=~s/\// /g;
    6.80 +	#Replace + with Plus
    6.81 +	$text=~s/\+/Plus/g;
    6.82 +	#Replace - with white-space
    6.83 +	$text=~s/-/ /g;
    6.84 +
    6.85 +	
    6.86 +	$text=lc($text);
    6.87 +	while ($text=~/(\w+)\s+(.+)/)
    6.88 +		{		
    6.89 +		my $word=$1;
    6.90 +		$text=$2;
    6.91 +		#upper case the first letter
    6.92 +		$word=~s/(^\w)/uc($1)/e;	
    6.93 +		$varName.=$word;		
    6.94 +		}
    6.95 +	
    6.96 +	$text=~s/(^\w)/uc($1)/e;					
    6.97 +	$varName.=$text;		
    6.98 +	#get ride of -			
    6.99 +	$varName=~s/-(\w)/uc($1)/e;
   6.100 +
   6.101 +	return $varName;
   6.102 +	}
   6.103 +	
   6.104 +sub Trim
   6.105 +	{
   6.106 +	$_[0] =~ s/^\s+//; #Trim leading space and line return char
   6.107 +	$_[0] =~ s/\s+$//; #Trim trailling space and line return char
   6.108 +	}	
   6.109 +
     7.1 --- a/HidUsageTableConsumer.txt	Sun Mar 15 20:25:58 2015 +0100
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,382 +0,0 @@
     7.4 -00  Unassigned   
     7.5 -01  Consumer Control  CA  15.1 
     7.6 -02  Numeric Key Pad  NAry  15.2 
     7.7 -03  Programmable Buttons  NAry  15.14 
     7.8 -04  Microphone  CA  15.1 
     7.9 -05  Headphone  CA  15.1 
    7.10 -06  Graphic Equalizer  CA  15.1 
    7.11 -07-1F  Reserved   
    7.12 -20  +10  OSC  15.2 
    7.13 -21  +100  OSC  15.2 
    7.14 -22  AM/PM  OSC  15.2 
    7.15 -23-3F  Reserved   
    7.16 -30  Power  OOC  15.3 
    7.17 -31  Reset  OSC  15.3 
    7.18 -32  Sleep  OSC  15.3 
    7.19 -33  Sleep After  OSC  15.3 
    7.20 -34  Sleep Mode  RTC  15.3 
    7.21 -35  Illumination  OOC  15.3 
    7.22 -36  Function Buttons  NAry  15.3 
    7.23 -37-3F  Reserved   
    7.24 -40  Menu  OOC  15.4 
    7.25 -41  Menu Pick  OSC  15.4 
    7.26 -42  Menu Up  OSC  15.4 
    7.27 -43  Menu Down  OSC  15.4 
    7.28 -44  Menu Left  OSC  15.4 
    7.29 -45  Menu Right  OSC  15.4 
    7.30 -46  Menu Escape  OSC  15.4 
    7.31 -47  Menu Value Increase  OSC  15.4 
    7.32 -48  Menu Value Decrease  OSC  15.4 
    7.33 -49-5F  Reserved   
    7.34 -60  Data On Screen  OOC  15.5 
    7.35 -61  Closed Caption  OOC  15.5 
    7.36 -62  Closed Caption Select  OSC  15.5 
    7.37 -63  VCR/TV  OOC  15.5 
    7.38 -64  Broadcast Mode  OSC  15.5 
    7.39 -65  Snapshot  OSC  15.5 
    7.40 -66  Still  OSC  15.5 
    7.41 -67-7F  Reserved   
    7.42 -80  Selection  NAry  15.6 
    7.43 -81  Assign Selection  OSC  15.6 
    7.44 -82  Mode Step  OSC  15.6 
    7.45 -83  Recall Last  OSC  15.6 
    7.46 -84  Enter Channel  OSC  15.6 
    7.47 -85  Order Movie  OSC  15.6 
    7.48 -86  Channel  LC  15.6 
    7.49 -87  Media Selection  NAry  15.6 
    7.50 -88  Media Select Computer  Sel  15.6 
    7.51 -89  Media Select TV  Sel  15.6 
    7.52 -8A  Media Select WWW  Sel  15.6 
    7.53 -8B  Media Select DVD  Sel  15.6 
    7.54 -8C  Media Select Telephone  Sel  15.6 
    7.55 -8D  Media Select Program Guide  Sel  15.6 
    7.56 -8E  Media Select Video Phone  Sel  15.6 
    7.57 -8F  Media Select Games  Sel  15.6 
    7.58 -90  Media Select Messages  Sel  15.6 
    7.59 -91  Media Select CD  Sel  15.6 
    7.60 -92  Media Select VCR  Sel  15.6 
    7.61 -93  Media Select Tuner  Sel  15.6 
    7.62 -94  Quit  OSC  15.6 
    7.63 -95  Help  OOC  15.6 
    7.64 -96  Media Select Tape  Sel  15.6 
    7.65 -97  Media Select Cable  Sel  15.6 
    7.66 -98  Media Select Satellite  Sel  15.6 
    7.67 -99  Media Select Security  Sel  15.6 
    7.68 -9A  Media Select Home  Sel  15.6 
    7.69 -9B  Media Select Call  Sel  15.6 
    7.70 -9C  Channel Increment  OSC  15.6 
    7.71 -9D  Channel Decrement  OSC  15.6 
    7.72 -9E  Media Select SAP  Sel  15.6 
    7.73 -9F  Reserved   
    7.74 -A0  VCR Plus  OSC  15.6 
    7.75 -A1  Once  OSC  15.6 
    7.76 -A2  Daily  OSC  15.6
    7.77 -A3  Weekly  OSC  15.6 
    7.78 -A4  Monthly  OSC  15.6 
    7.79 -A5-AF  Reserved   
    7.80 -B0  Play  OOC  15.7 
    7.81 -B1  Pause  OOC  15.7 
    7.82 -B2  Record  OOC  15.7 
    7.83 -B3  Fast Forward  OOC  15.7 
    7.84 -B4  Rewind  OOC  15.7 
    7.85 -B5  Scan Next Track  OSC  15.7 
    7.86 -B6  Scan Previous Track  OSC  15.7 
    7.87 -B7  Stop  OSC  15.7 
    7.88 -B8  Eject  OSC  15.7 
    7.89 -B9  Random Play  OOC  15.7 
    7.90 -BA  Select Disc  NAry  15.7 
    7.91 -BB  Enter Disc  MC  15.7 
    7.92 -BC  Repeat  OSC  15.7 
    7.93 -BD  Tracking  LC  15.7 
    7.94 -BE  Track Normal  OSC  15.7 
    7.95 -BF  Slow Tracking  LC  15.7 
    7.96 -C0  Frame Forward  RTC  15.7 
    7.97 -C1  Frame Back  RTC  15.7 
    7.98 -C2  Mark  OSC  15.8 
    7.99 -C3  Clear Mark  OSC  15.8 
   7.100 -C4  Repeat From Mark  OOC  15.8 
   7.101 -C5  Return To Mark  OSC  15.8 
   7.102 -C6  Search Mark Forward  OSC  15.8 
   7.103 -C7  Search Mark Backwards  OSC  15.8 
   7.104 -C8  Counter Reset  OSC  15.8 
   7.105 -C9  Show Counter  OSC  15.8 
   7.106 -CA  Tracking Increment  RTC  15.7 
   7.107 -CB  Tracking Decrement  RTC  15.7 
   7.108 -CC  Stop/Eject  OSC  15.7 
   7.109 -CD  Play/Pause  OSC  15.7 
   7.110 -CE  Play/Skip  OSC  15.7 
   7.111 -CF-DF  Reserved   
   7.112 -E0  Volume  LC  15.9.1 
   7.113 -E1  Balance  LC  15.9.2 
   7.114 -E2  Mute  OOC  15.9.1 
   7.115 -E3  Bass  LC  15.9.3 
   7.116 -E4  Treble  LC  15.9.4 
   7.117 -E5  Bass Boost  OOC  15.9.3 
   7.118 -E6  Surround Mode  OSC  15.9.5 
   7.119 -E7  Loudness  OOC  15.9.5 
   7.120 -E8  MPX  OOC  15.9.5 
   7.121 -E9  Volume Increment  RTC  15.9.1 
   7.122 -EA  Volume Decrement  RTC  15.9.1 
   7.123 -EB-EF  Reserved   
   7.124 -F0  Speed Select  OSC  15.10 
   7.125 -F1  Playback Speed  NAry  15.10 
   7.126 -F2  Standard Play  Sel  15.10 
   7.127 -F3  Long Play  Sel  15.10 
   7.128 -F4  Extended Play  Sel  15.10 
   7.129 -F5  Slow  OSC  15.10 
   7.130 -F6-FF  Reserved   
   7.131 -100  Fan Enable  OOC  15.11 
   7.132 -101  Fan Speed  LC  15.11 
   7.133 -102  Light Enable  OOC  15.11 
   7.134 -103  Light Illumination Level  LC  15.11 
   7.135 -104  Climate Control Enable  OOC  15.11 
   7.136 -105  Room Temperature  LC  15.11 
   7.137 -106  Security Enable  OOC  15.11 
   7.138 -107  Fire Alarm  OSC  15.11 
   7.139 -108  Police Alarm  OSC  15.11 
   7.140 -109  Proximity  LC  15.11 
   7.141 -10A Motion  OSC  15.11 
   7.142 -10B Duress Alarm  OSC  15.11 
   7.143 -10C Holdup Alarm  OSC  15.11 
   7.144 -10D Medical Alarm  OSC  15.11 
   7.145 -10E-14F Reserved    
   7.146 -150  Balance Right  RTC  15.9.2 
   7.147 -151  Balance Left  RTC  15.9.2 
   7.148 -152  Bass Increment  RTC  15.9.3 
   7.149 -153  Bass Decrement  RTC  15.9.3 
   7.150 -154  Treble Increment  RTC  15.9.4 
   7.151 -155  Treble Decrement  RTC  15.9.4 
   7.152 -156-15F  Reserved   
   7.153 -160  Speaker System  CL  15.12.1 
   7.154 -161  Channel Left  CL  15.12.1 
   7.155 -162  Channel Right  CL  15.12.1 
   7.156 -163  Channel Center  CL  15.12.1 
   7.157 -164  Channel Front  CL  15.12.1 
   7.158 -165  Channel Center Front  CL  15.12.1 
   7.159 -166  Channel Side  CL  15.12.1 
   7.160 -167  Channel Surround  CL  15.12.1 
   7.161 -168  Channel Low Frequency Enhancement  CL  15.12.1 
   7.162 -169  Channel Top  CL  15.12.1 
   7.163 -16A  Channel Unknown  CL  15.12.1 
   7.164 -16B-16F  Reserved   
   7.165 -170  Sub-channel  LC  15.13 
   7.166 -171  Sub-channel Increment  OSC  15.13 
   7.167 -172  Sub-channel Decrement  OSC  15.13 
   7.168 -173  Alternate Audio Increment  OSC  15.13 
   7.169 -174  Alternate Audio Decrement  OSC  15.13 
   7.170 -175-17F  Reserved   
   7.171 -180  Application Launch Buttons  NAry  15.15 
   7.172 -181  AL Launch Button Configuration Tool Sel  15.15 
   7.173 -182  AL Programmable Button Configuration Sel  15.15 
   7.174 -183  AL Consumer Control Configuration Sel  15.15 
   7.175 -184  AL Word Processor  Sel  15.15 
   7.176 -185  AL Text Editor  Sel  15.15 
   7.177 -186  AL Spreadsheet  Sel  15.15 
   7.178 -187  AL Graphics Editor  Sel  15.15 
   7.179 -188  AL Presentation App  Sel  15.15 
   7.180 -189  AL Database App  Sel  15.15 
   7.181 -18A  AL Email Reader  Sel  15.15 
   7.182 -18B  AL Newsreader  Sel  15.15 
   7.183 -18C  AL Voicemail  Sel  15.15 
   7.184 -18D  AL Contacts/Address Book  Sel  15.15 
   7.185 -18E  AL Calendar/Schedule  Sel  15.15 
   7.186 -18F  AL Task/Project Manager  Sel  15.15 
   7.187 -190  AL Log/Journal/Timecard  Sel  15.15 
   7.188 -191  AL Checkbook/Finance  Sel  15.15 
   7.189 -192  AL Calculator  Sel  15.15 
   7.190 -193  AL A/V Capture/Playback  Sel  15.15 
   7.191 -194  AL Local Machine Browser  Sel  15.15 
   7.192 -195  AL LAN/WAN Browser  Sel  15.15 
   7.193 -196  AL Internet Browser  Sel  15.15 
   7.194 -197  AL Remote Networking/ISP Connect Sel  15.15 
   7.195 -198  AL Network Conference  Sel  15.15 
   7.196 -199  AL Network Chat  Sel  15.15 
   7.197 -19A  AL Telephony/Dialer  Sel  15.15 
   7.198 -19B  AL Logon  Sel  15.15 
   7.199 -19C  AL Logoff  Sel  15.15 
   7.200 -19D  AL Logon/Logoff  Sel  15.15 
   7.201 -19E  AL Terminal Lock/Screensaver  Sel  15.15 
   7.202 -19F  AL Control Panel  Sel  15.15 
   7.203 -1A0  AL Command Line Processor/Run Sel  15.15 
   7.204 -1A1  AL Process/Task Manager  Sel  15.15 
   7.205 -1A2  AL Select Task/Application  Sel  15.15 
   7.206 -1A3  AL Next Task/Application  Sel  15.15 
   7.207 -1A4  AL Previous Task/Application  Sel  15.15 
   7.208 -1A5  AL Preemptive Halt Task/Application Sel  15.15 
   7.209 -1A6  AL Integrated Help Center  Sel  15.15 
   7.210 -1A7 AL Documents  Sel  15.15 
   7.211 -1A8 AL Thesaurus  Sel  15.15 
   7.212 -1A9 AL Dictionary  Sel  15.15 
   7.213 -1AA AL Desktop  Sel  15.15 
   7.214 -1AB  AL Spell Check  Sel  15.15 
   7.215 -1AC  AL Grammar Check  Sel  15.15 
   7.216 -1AD  AL Wireless Status  Sel  15.15 
   7.217 -1AE  AL Keyboard Layout  Sel  15.15 
   7.218 -1AF  AL Virus Protection  Sel  15.15 
   7.219 -1B0 AL Encryption  Sel  15.15 
   7.220 -1B1  AL Screen Saver  Sel  15.15 
   7.221 -1B2 AL Alarms  Sel  15.15 
   7.222 -1B3 AL Clock  Sel  15.15 
   7.223 -1B4  AL File Browser  Sel  15.15 
   7.224 -1B5  AL Power Status  Sel  15.15 
   7.225 -1B6  AL Image Browser  Sel  15.15 
   7.226 -1B7  AL Audio Browser  Sel  15.15 
   7.227 -1B8  AL Movie Browser  Sel  15.15 
   7.228 -1B9  AL Digital Rights Manager  Sel  15.15
   7.229 -1BA  AL Digital Wallet  Sel  15.15 
   7.230 -1BB Reserved 
   7.231 -1BC  AL Instant Messaging  Sel  15.15 
   7.232 -1BD  AL OEM Features/ Tips/Tutorial Browser Sel  15.15 
   7.233 -1BE  AL OEM Help  Sel  15.15 
   7.234 -1BF  AL Online Community  Sel  15.15 
   7.235 -1C0  AL Entertainment Content Browser Sel  15.15 
   7.236 -1C1  AL Online Shopping Browser  Sel  15.15 
   7.237 -1C2 AL SmartCard Information/Help Sel  15.15 
   7.238 -1C3  AL Market Monitor/Finance Browser Sel  15.15 
   7.239 -1C4  AL Customized Corporate News Browser Sel  15.15 
   7.240 -1C5  AL Online Activity Browser  Sel  15.15 
   7.241 -1C6  AL Research/Search Browser  Sel  15.15 
   7.242 -1C7  AL Audio Player  Sel  15.15 
   7.243 -1C8-1FF Reserved
   7.244 -200  Generic GUI Application Controls Nary  15.16 
   7.245 -201  AC New  Sel  15.16 
   7.246 -202  AC Open  Sel  15.16 
   7.247 -203  AC Close  Sel  15.16 
   7.248 -204  AC Exit  Sel  15.16 
   7.249 -205  AC Maximize  Sel  15.16 
   7.250 -206  AC Minimize  Sel  15.16 
   7.251 -207  AC Save  Sel  15.16 
   7.252 -208  AC Print  Sel  15.16 
   7.253 -209  AC Properties  Sel  15.16 
   7.254 -21A  AC Undo  Sel  15.16 
   7.255 -21B  AC Copy  Sel  15.16 
   7.256 -21C  AC Cut  Sel  15.16 
   7.257 -21D  AC Paste  Sel  15.16 
   7.258 -21E  AC Select All  Sel  15.16 
   7.259 -21F  AC Find  Sel  15.16 
   7.260 -220  AC Find and Replace  Sel  15.16 
   7.261 -221  AC Search  Sel  15.16 
   7.262 -222  AC Go To  Sel  15.16 
   7.263 -223  AC Home  Sel  15.16 
   7.264 -224  AC Back  Sel  15.16
   7.265 -225  AC Forward  Sel  15.16 
   7.266 -226  AC Stop  Sel  15.16 
   7.267 -227  AC Refresh  Sel  15.16 
   7.268 -228  AC Previous Link  Sel  15.16 
   7.269 -229  AC Next Link  Sel  15.16 
   7.270 -22A  AC Bookmarks  Sel  15.16 
   7.271 -22B  AC History  Sel  15.16 
   7.272 -22C  AC Subscriptions  Sel  15.16 
   7.273 -22D  AC Zoom In  Sel  15.16 
   7.274 -22E  AC Zoom Out  Sel  15.16 
   7.275 -22F  AC Zoom  LC  15.16 
   7.276 -230  AC Full Screen View  Sel  15.16 
   7.277 -231  AC Normal View  Sel  15.16 
   7.278 -232  AC View Toggle  Sel  15.16 
   7.279 -233  AC Scroll Up  Sel  15.16 
   7.280 -234  AC Scroll Down  Sel  15.16 
   7.281 -235  AC Scroll  LC  15.16 
   7.282 -236  AC Pan Left  Sel  15.16 
   7.283 -237  AC Pan Right  Sel  15.16 
   7.284 -238  AC Pan  LC  15.16 
   7.285 -239  AC New Window  Sel  15.16 
   7.286 -23A  AC Tile Horizontally  Sel  15.16 
   7.287 -23B  AC Tile Vertically  Sel  15.16 
   7.288 -23C  AC Format  Sel  15.16 
   7.289 -23D AC Edit  Sel  15.14 
   7.290 -23E AC Bold  Sel  15.16 
   7.291 -23F AC Italics  Sel  15.16 
   7.292 -240 AC Underline  Sel  15.16 
   7.293 -241 AC Strikethrough  Sel  15.16 
   7.294 -242 AC Subscript  Sel  15.16 
   7.295 -243 AC Superscript  Sel  15.16 
   7.296 -244  AC All Caps  Sel  15.16 
   7.297 -245 AC Rotate  Sel  15.16 
   7.298 -246 AC Resize  Sel  15.16 
   7.299 -247  AC Flip horizontal  Sel  15.16 
   7.300 -248  AC Flip Vertical  Sel  15.16 
   7.301 -249  AC Mirror Horizontal  Sel  15.16 
   7.302 -24A  AC Mirror Vertical  Sel  15.16 
   7.303 -24B  AC Font Select  Sel  15.16 
   7.304 -24C  AC Font Color  Sel  15.16 
   7.305 -24D  AC Font Size  Sel  15.16 
   7.306 -24E  AC Justify Left  Sel  15.16 
   7.307 -24F  AC Justify Center H  Sel  15.16 
   7.308 -250  AC Justify Right  Sel  15.16 
   7.309 -251  AC Justify Block H  Sel  15.16 
   7.310 -252  AC Justify Top  Sel  15.16 
   7.311 -253  AC Justify Center V  Sel  15.16 
   7.312 -254  AC Justify Bottom  Sel  15.16 
   7.313 -255  AC Justify Block V  Sel  15.16 
   7.314 -256  AC Indent Decrease  Sel  15.16 
   7.315 -257  AC Indent Increase  Sel  15.16 
   7.316 -258 AC Numbered List  Sel  15.16 
   7.317 -259  AC Restart Numbering  Sel  15.16 
   7.318 -25A  AC Bulleted List  Sel  15.16 
   7.319 -25B AC Promote  Sel  15.16 
   7.320 -25C AC Demote  Sel  15.16 
   7.321 -25D AC Yes  Sel  15.16 
   7.322 -25E AC No  Sel  15.16 
   7.323 -25F AC Cancel  Sel  15.16 
   7.324 -260 AC Catalog  Sel  15.16 
   7.325 -261 AC Buy/Checkout  Sel  15.16 
   7.326 -262  AC Add to Cart  Sel  15.16 
   7.327 -263 AC Expand  Sel  15.16 
   7.328 -264  AC Expand All  Sel  15.16 
   7.329 -265 AC Collapse  Sel  15.16 
   7.330 -266  AC Collapse All  Sel  15.16 
   7.331 -267  AC Print Preview  Sel  15.16 
   7.332 -268  AC Paste Special  Sel  15.16 
   7.333 -269  AC Insert Mode  Sel  15.16 
   7.334 -26A AC Delete  Sel  15.16 
   7.335 -26B AC Lock  Sel  15.16 
   7.336 -26C AC Unlock  Sel  15.16 
   7.337 -26D AC Protect  Sel  15.16 
   7.338 -26E AC Unprotect  Sel  15.16 
   7.339 -26F  AC Attach Comment  Sel  15.16 
   7.340 -270  AC Delete Comment  Sel  15.16 
   7.341 -271  AC View Comment  Sel  15.16 
   7.342 -272  AC Select Word  Sel  15.16 
   7.343 -273  AC Select Sentence  Sel  15.16 
   7.344 -274 AC Select Paragraph Sel 15.16
   7.345 -275 AC Select Column Sel 15.16
   7.346 -276 AC Select Row Sel 15.16
   7.347 -277 AC Select Table Sel 15.16
   7.348 -278 AC Select Object Sel 15.16
   7.349 -279 AC Redo/Repeat Sel 15.16
   7.350 -27A AC Sort Sel 15.16
   7.351 -27B AC Sort Ascending Sel 15.16
   7.352 -27C AC Sort Descending Sel 15.16
   7.353 -27D AC Filter Sel 15.16
   7.354 -27E AC Set Clock Sel 15.16
   7.355 -27F AC View Clock Sel 15.16
   7.356 -280 AC Select Time Zone Sel 15.16
   7.357 -281 AC Edit Time Zones Sel 15.16
   7.358 -282 AC Set Alarm Sel 15.16
   7.359 -283 AC Clear Alarm Sel 15.16
   7.360 -284 AC Snooze Alarm Sel 15.16
   7.361 -285 AC Reset Alarm Sel 15.16
   7.362 -286 AC Synchronize Sel 15.16
   7.363 -287 AC Send/Receive Sel 15.16
   7.364 -288 AC Send To Sel 15.16
   7.365 -289 AC Reply Sel 15.16
   7.366 -28A AC Reply All Sel 15.16
   7.367 -28B AC Forward Msg Sel 15.16
   7.368 -28C AC Send Sel 15.16
   7.369 -28D AC Attach File Sel 15.16
   7.370 -28E AC Upload Sel 15.16
   7.371 -28F AC Download Save Target As Sel 15.16
   7.372 -290 AC Set Borders Sel 15.16
   7.373 -291 AC Insert Row Sel 15.16
   7.374 -292 AC Insert Column Sel 15.16
   7.375 -293 AC Insert File Sel 15.16
   7.376 -294 AC Insert Picture Sel 15.16
   7.377 -295 AC Insert Object Sel 15.16
   7.378 -296 AC Insert Symbol Sel 15.16
   7.379 -297 AC Save and Close Sel 15.16
   7.380 -298 AC Rename Sel 15.16
   7.381 -299 AC Merge Sel 15.16
   7.382 -29A AC Split Sel 15.16
   7.383 -29B AC Distribute Horizontally Sel 15.16
   7.384 -29C  AC Distribute Vertically  Sel  15.16 
   7.385 -29D-FFFF Reserved 
   7.386 \ No newline at end of file
     8.1 --- a/HidUsageTableGameControls.txt	Sun Mar 15 20:25:58 2015 +0100
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,31 +0,0 @@
     8.4 -00 Undefined   
     8.5 -01  3D Game Controller  CA  8.1 
     8.6 -02  Pinball Device  CA  8.2 
     8.7 -03  Gun Device  CA  8.3 
     8.8 -04-1F Reserved 
     8.9 -20  Point of View  CP  8.1 
    8.10 -21 Turn Right/Left  DV  8.1 
    8.11 -22  Pitch Forward/Backward  DV  8.1 
    8.12 -23  Roll Right/Left  DV  8.1 
    8.13 -24 Move Right/Left  DV  8.1 
    8.14 -25 Move Forward/Backward DV  8.1 
    8.15 -26 Move Up/Down  DV  8.1 
    8.16 -27 Lean Right/Left  DV  8.1 
    8.17 -28 Lean Forward/Backward DV  8.1 
    8.18 -29  Height of POV  DV  8.1 
    8.19 -2A Flipper  MC  8.2 
    8.20 -2B Secondary Flipper  MC  8.2 
    8.21 -2C Bump  MC  8.2 
    8.22 -2D New Game  OSC  8.2 
    8.23 -2E Shoot Ball  OSC  8.2 
    8.24 -2F Player  OSC  8.2 
    8.25 -30 Gun Bolt  OOC  8.3 
    8.26 -31 Gun Clip  OOC  8.3 
    8.27 -32  Gun Selector  NAry  8.3 
    8.28 -33  Gun Single Shot  Sel  8.3 
    8.29 -34 Gun Burst  Sel  8.3 
    8.30 -35 Gun Automatic  Sel  8.3 
    8.31 -36 Gun Safety  OOC  8.3 
    8.32 -37  Gamepad Fire/Jump  CL  8.4.1 
    8.33 -39  Gamepad Trigger  CL  8.4.1 
    8.34 -3A-FFFF Reserved 
    8.35 \ No newline at end of file
     9.1 --- a/HidUsageTableGenericDesktop.txt	Sun Mar 15 20:25:58 2015 +0100
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,75 +0,0 @@
     9.4 -00 Undefined   
     9.5 -01  Pointer  CP  4.1 
     9.6 -02  Mouse  CA  4.1  03 Reserved   
     9.7 -04  Joystick  CA  4.1 
     9.8 -05  Game Pad  CA  4.1 
     9.9 -06  Keyboard  CA  4.1 
    9.10 -07  Keypad  CA  4.1 
    9.11 -08  Multi-axis Controller  CA  4.1 
    9.12 -09  Tablet PC System Controls  CA  4.1 
    9.13 -0A-2F Reserved 
    9.14 -30 X  DV  4.2 
    9.15 -31 Y  DV  4.2 
    9.16 -32 Z  DV  4.2 
    9.17 -33 Rx  DV  4.2 
    9.18 -34 Ry  DV  4.2 
    9.19 -35 Rz  DV  4.2 
    9.20 -36 Slider  DV  4.3 
    9.21 -37 Dial  DV  4.3 
    9.22 -38 Wheel  DV  4.3 
    9.23 -39 Hat switch  DV  4.3 
    9.24 -3A  Counted Buffer  CL  4.6 
    9.25 -3B Byte Count  DV  4.6 
    9.26 -3C Motion Wakeup  OSC  4.3 
    9.27 -3D Start  OOC  4.3 
    9.28 -3E Select  OOC  4.3  3F Reserved   
    9.29 -40 Vx  DV  4.3.1 
    9.30 -41 Vy  DV  4.3.1 
    9.31 -42 Vz  DV  4.3.1 
    9.32 -43 Vbrx  DV  4.3.1 
    9.33 -44 Vbry  DV  4.3.1 
    9.34 -45 Vbrz  DV  4.3.1 
    9.35 -46 Vno  DV  4.3.1 
    9.36 -47 Feature Notification  DV,DF  4.8 
    9.37 -48 Resolution Multiplier DV 
    9.38 -49-7F Reserved 
    9.39 -80  System Control  CA  4.5 
    9.40 -81 System Power Down OSC  4.5 
    9.41 -82 System Sleep  OSC  4.5.1 
    9.42 -83 System Wake Up  OSC  4.5.1 
    9.43 -84  System Context Menu  OSC  4.5 
    9.44 -85 System Main Menu  OSC  4.5 
    9.45 -86  System App Menu  OSC  4.5 
    9.46 -87 System Menu Help  OSC  4.5 
    9.47 -88 System Menu Exit  OSC  4.5 
    9.48 -89 System Menu Select OSC  4.5 
    9.49 -8A System Menu Right  RTC  4.5 
    9.50 -8B System Menu Left  RTC  4.5 
    9.51 -8C System Menu Up  RTC  4.5 
    9.52 -8D System Menu Down  RTC  4.5 
    9.53 -8E  System Cold Restart  OSC  4.5.1 
    9.54 -8F  System Warm Restart  OSC  4.5.1 
    9.55 -90 D-pad Up  OOC  4.7 
    9.56 -91 D-pad Down  OOC  4.7 
    9.57 -92 D-pad Right  OOC  4.7 
    9.58 -93 D-pad Left  OOC  4.7 
    9.59 -94-9F Reserved 
    9.60 -A0 System Dock  OSC  4.5.1 
    9.61 -A1 System Undock  OSC  4.5.1 
    9.62 -A2 System Setup  OSC  4.5.1 
    9.63 -A3 System Break  OSC  4.9 
    9.64 -A4  System Debugger Break  OSC  4.9 
    9.65 -A5 Application Break  OSC  4.9 
    9.66 -A6  Application Debugger Break  OSC  4.9 
    9.67 -A7  System Speaker Mute  OSC  4.5.1 
    9.68 -A8 System Hibernate  OSC  4.5.1 
    9.69 -A9-AF Reserved 
    9.70 -B0  System Display Invert  OSC  4.10 
    9.71 -B1  System Display Internal  OSC  4.10 
    9.72 -B2  System Display External  OSC  4.10 
    9.73 -B3  System Display Both  OSC  4.10 
    9.74 -B4  System Display Dual  OSC  4.10 
    9.75 -B5  System Display Toggle Int/Ext  OSC  4.10 
    9.76 -B6  System Display Swap Primary/Secondary OSC  4.10 
    9.77 -B7  System Display LCD Autoscale  OSC  4.10 
    9.78 -B8-FFFF Reserved 
    9.79 \ No newline at end of file
    10.1 --- a/HidUsageTableSimulationControls.txt	Sun Mar 15 20:25:58 2015 +0100
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,55 +0,0 @@
    10.4 -00 Undefined   
    10.5 -01  Flight Simulation Device  CA  5.2 
    10.6 -02  Automobile Simulation Device  CA  5.3 
    10.7 -03  Tank Simulation Device  CA  5.4 
    10.8 -04  Spaceship Simulation Device  CA  5.2 
    10.9 -05  Submarine Simulation Device  CA  5.5 
   10.10 -06  Sailing Simulation Device  CA  5.5 
   10.11 -07  Motorcycle Simulation Device  CA  5.6 
   10.12 -08  Sports Simulation Device  CA  5.1 
   10.13 -09  Airplane Simulation Device  CA  5.2 
   10.14 -0A  Helicopter Simulation Device  CA  5.2 
   10.15 -0B  Magic Carpet Simulation Device CA  5.7 
   10.16 -0C  Bicycle Simulation Device  CA  5.6 
   10.17 -0D – 1F  Reserved   
   10.18 -20  Flight Control Stick  CA  5.2 
   10.19 -21  Flight Stick  CA  5.2 
   10.20 -22  Cyclic Control  CP  5.2 
   10.21 -23  Cyclic Trim  CP  5.2 
   10.22 -24  Flight Yoke  CA  5.2 
   10.23 -25  Track Control  CP  5.4 
   10.24 -26 –AF  Reserved   
   10.25 -B0 Aileron  DV  5.2 
   10.26 -B1 Aileron Trim  DV  5.2 
   10.27 -B2 Anti-Torque Control  DV  5.2 
   10.28 -B3 Autopilot Enable  OOC  5.2 
   10.29 -B4 Chaff Release  OSC  5.2 
   10.30 -B5 Collective Control  DV  5.2 
   10.31 -B6 Dive Brake  DV  5.2 
   10.32 -B7 Electronic Countermeasures OOC  5.2 
   10.33 -B8 Elevator  DV  5.2 
   10.34 -B9 Elevator Trim  DV  5.2 
   10.35 -BA Rudder  DV  5.2 
   10.36 -BB Throttle  DV  5.2 
   10.37 -BC Flight Communications OOC  5.2 
   10.38 -BD Flare Release  OSC  5.2 
   10.39 -BE Landing Gear  OOC  5.2 
   10.40 -BF Toe Brake  DV  5.2 
   10.41 -C0 Trigger  MC  5.2 
   10.42 -C1 Weapons Arm  OOC  5.2 
   10.43 -C2 Weapons Select  OSC  5.2 
   10.44 -C3 Wing Flaps  DV  5.2 
   10.45 -C4 Accelerator  DV  5.3 
   10.46 -C5 Brake  DV  5.3 
   10.47 -C6 Clutch  DV  5.3 
   10.48 -C7 Shifter  DV  5.3 
   10.49 -C8 Steering  DV  5.3 
   10.50 -C9 Turret Direction  DV  5.4 
   10.51 -CA Barrel Elevation  DV  5.4 
   10.52 -CB Dive Plane  DV  5.5 
   10.53 -CC Ballast  DV  5.5 
   10.54 -CD Bicycle Crank  DV  5.6 
   10.55 -CE Handle Bars  DV  5.6 
   10.56 -CF Front Brake  DV  5.6 
   10.57 -D0 Rear Brake  DV  5.6 
   10.58 -D1-FFFF Reserved 
   10.59 \ No newline at end of file
    11.1 --- a/HidUsageTableTelephonyDevice.txt	Sun Mar 15 20:25:58 2015 +0100
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,72 +0,0 @@
    11.4 -00  Unassigned   
    11.5 -01  Phone  CA  14.1 
    11.6 -02  Answering Machine  CA  14.1 
    11.7 -03  Message Controls  CL  14.1 
    11.8 -04  Handset  CL  14.1 
    11.9 -05  Headset  CL  14.1 
   11.10 -06  Telephony Key Pad  NAry  14.2 
   11.11 -07  Programmable Button  NAry  14.2 
   11.12 -08-1F  Reserved   
   11.13 -20  Hook Switch  OOC  14.3 
   11.14 -21  Flash  MC  14.3 
   11.15 -22  Feature  OSC  14.3 
   11.16 -23  Hold  OOC  14.3 
   11.17 -24  Redial  OSC  14.3 
   11.18 -25  Transfer  OSC  14.3 
   11.19 -26  Drop  OSC  14.3 
   11.20 -27  Park  OOC  14.3 
   11.21 -28  Forward Calls  OOC  14.3 
   11.22 -29  Alternate Function  MC  14.3 
   11.23 -2A  Line  OSC, NAry  14.3 
   11.24 -2B  Speaker Phone  OOC  14.3 
   11.25 -2C  Conference  OOC  14.3 
   11.26 -2D  Ring Enable  OOC  14.3 
   11.27 -2E  Ring Select  OSC  14.3 
   11.28 -2F  Phone Mute  OOC  14.3 
   11.29 -30  Caller ID  MC  14.3 
   11.30 -31  Send  OOC  14.3 
   11.31 -32-4F  Reserved   
   11.32 -50  Speed Dial  OSC  14.4 
   11.33 -51  Store Number  OSC  14.4 
   11.34 -52  Recall Number  OSC  14.4 
   11.35 -53  Phone Directory  OOC  14.4 
   11.36 -54-6F  Reserved   
   11.37 -70  Voice Mail  OOC  14.5 
   11.38 -71  Screen Calls  OOC  14.5 
   11.39 -72  Do Not Disturb  OOC  14.5 
   11.40 -73  Message  OSC  14.5 
   11.41 -74  Answer On/Off  OOC  14.5 
   11.42 -75-8F  Reserved   
   11.43 -90  Inside Dial Tone  MC  14.6 
   11.44 -91  Outside Dial Tone  MC  14.6 
   11.45 -92  Inside Ring Tone  MC  14.6 
   11.46 -93  Outside Ring Tone  MC  14.6 
   11.47 -94  Priority Ring Tone  MC  14.6 
   11.48 -95  Inside Ringback  MC  14.6 
   11.49 -96  Priority Ringback  MC  14.6 
   11.50 -97  Line Busy Tone  MC  14.6 
   11.51 -98  Reorder Tone  MC  14.6 
   11.52 -99  Call Waiting Tone  MC  14.6 
   11.53 -9A  Confirmation Tone 1  MC  14.6 
   11.54 -9B  Confirmation Tone 2  MC  14.6 
   11.55 -9C  Tones Off  OOC  14.6 
   11.56 -9D  Outside Ringback  MC  14.6 
   11.57 -9E  Ringer  OOC  14.6 
   11.58 -9E-AF  Reserved   
   11.59 -B0  Phone Key 0  Sel  14.2 
   11.60 -B1  Phone Key 1  Sel  14.2 
   11.61 -B2  Phone Key 2  Sel  14.2 
   11.62 -B3  Phone Key 3  Sel  14.2 
   11.63 -B4  Phone Key 4  Sel  14.2 
   11.64 -B5  Phone Key 5  Sel  14.2 
   11.65 -B6  Phone Key 6  Sel  14.2 
   11.66 -B7  Phone Key 7  Sel  14.2 
   11.67 -B8  Phone Key 8  Sel  14.2 
   11.68 -B9  Phone Key 9  Sel  14.2 
   11.69 -BA  Phone Key Star  Sel  14.2 
   11.70 -BB  Phone Key Pound  Sel  14.2 
   11.71 -BC  Phone Key A  Sel  14.2 
   11.72 -BD  Phone Key B  Sel  14.2 
   11.73 -BE  Phone Key C  Sel  14.2 
   11.74 -BF  Phone Key D  Sel  14.2 
   11.75 -C0-FFFF  Reserved  
   11.76 \ No newline at end of file
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/Win32/PInvoke/pinvoke-input.txt	Sun Mar 15 20:30:00 2015 +0100
    12.3 @@ -0,0 +1,2226 @@
    12.4 +//
    12.5 +// SL: We use this file to generate P/Invoke using P/Invoke Interop Assistant.
    12.6 +//
    12.7 +
    12.8 +
    12.9 +typedef USHORT USAGE, *PUSAGE;
   12.10 +typedef LONG NTSTATUS;
   12.11 +
   12.12 +#define HIDP_LINK_COLLECTION_ROOT ((USHORT) -1)
   12.13 +#define HIDP_LINK_COLLECTION_UNSPECIFIED ((USHORT) 0)
   12.14 +
   12.15 +
   12.16 +typedef enum _HIDP_REPORT_TYPE
   12.17 +{
   12.18 +    HidP_Input,
   12.19 +    HidP_Output,
   12.20 +    HidP_Feature
   12.21 +} HIDP_REPORT_TYPE;
   12.22 +
   12.23 +typedef struct _USAGE_AND_PAGE
   12.24 +{
   12.25 +    USAGE Usage;
   12.26 +    USAGE UsagePage;
   12.27 +} USAGE_AND_PAGE, *PUSAGE_AND_PAGE;
   12.28 +
   12.29 +#define HidP_IsSameUsageAndPage(u1, u2) ((* (PULONG) &u1) == (* (PULONG) &u2))
   12.30 +
   12.31 +typedef struct _HIDP_BUTTON_CAPS
   12.32 +{
   12.33 +    USAGE    UsagePage;
   12.34 +    UCHAR    ReportID;
   12.35 +    BOOLEAN  IsAlias;
   12.36 +
   12.37 +    USHORT   BitField;
   12.38 +    USHORT   LinkCollection;   // A unique internal index pointer
   12.39 +
   12.40 +    USAGE    LinkUsage;
   12.41 +    USAGE    LinkUsagePage;
   12.42 +
   12.43 +    BOOLEAN  IsRange;
   12.44 +    BOOLEAN  IsStringRange;
   12.45 +    BOOLEAN  IsDesignatorRange;
   12.46 +    BOOLEAN  IsAbsolute;
   12.47 +
   12.48 +    ULONG    Reserved[10];
   12.49 +    union {
   12.50 +        struct {
   12.51 +            USAGE    UsageMin,         UsageMax;
   12.52 +            USHORT   StringMin,        StringMax;
   12.53 +            USHORT   DesignatorMin,    DesignatorMax;
   12.54 +            USHORT   DataIndexMin,     DataIndexMax;
   12.55 +        } Range;
   12.56 +        struct  {
   12.57 +            USAGE    Usage,            Reserved1;
   12.58 +            USHORT   StringIndex,      Reserved2;
   12.59 +            USHORT   DesignatorIndex,  Reserved3;
   12.60 +            USHORT   DataIndex,        Reserved4;
   12.61 +        } NotRange;
   12.62 +    };
   12.63 +
   12.64 +} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
   12.65 +
   12.66 +
   12.67 +typedef struct _HIDP_VALUE_CAPS
   12.68 +{
   12.69 +    USAGE    UsagePage;
   12.70 +    UCHAR    ReportID;
   12.71 +    BOOLEAN  IsAlias;
   12.72 +
   12.73 +    USHORT   BitField;
   12.74 +    USHORT   LinkCollection;   // A unique internal index pointer
   12.75 +
   12.76 +    USAGE    LinkUsage;
   12.77 +    USAGE    LinkUsagePage;
   12.78 +
   12.79 +    BOOLEAN  IsRange;
   12.80 +    BOOLEAN  IsStringRange;
   12.81 +    BOOLEAN  IsDesignatorRange;
   12.82 +    BOOLEAN  IsAbsolute;
   12.83 +
   12.84 +    BOOLEAN  HasNull;        // Does this channel have a null report   union
   12.85 +    UCHAR    Reserved;
   12.86 +    USHORT   BitSize;        // How many bits are devoted to this value?
   12.87 +
   12.88 +    USHORT   ReportCount;    // See Note below.  Usually set to 1.
   12.89 +    USHORT   Reserved2[5];
   12.90 +
   12.91 +    ULONG    UnitsExp;
   12.92 +    ULONG    Units;
   12.93 +
   12.94 +    LONG     LogicalMin,       LogicalMax;
   12.95 +    LONG     PhysicalMin,      PhysicalMax;
   12.96 +
   12.97 +    union {
   12.98 +        struct {
   12.99 +            USAGE    UsageMin,         UsageMax;
  12.100 +            USHORT   StringMin,        StringMax;
  12.101 +            USHORT   DesignatorMin,    DesignatorMax;
  12.102 +            USHORT   DataIndexMin,     DataIndexMax;
  12.103 +        } Range;
  12.104 +
  12.105 +        struct {
  12.106 +            USAGE    Usage,            Reserved1;
  12.107 +            USHORT   StringIndex,      Reserved2;
  12.108 +            USHORT   DesignatorIndex,  Reserved3;
  12.109 +            USHORT   DataIndex,        Reserved4;
  12.110 +        } NotRange;
  12.111 +    };
  12.112 +} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
  12.113 +
  12.114 +//
  12.115 +// Notes:
  12.116 +//
  12.117 +// ReportCount:  When a report descriptor declares an Input, Output, or
  12.118 +// Feature main item with fewer usage declarations than the report count, then
  12.119 +// the last usage applies to all remaining unspecified count in that main item.
  12.120 +// (As an example you might have data that required many fields to describe,
  12.121 +// possibly buffered bytes.)  In this case, only one value cap structure is
  12.122 +// allocated for these associtated fields, all with the same usage, and Report
  12.123 +// Count reflects the number of fields involved.  Normally ReportCount is 1.
  12.124 +// To access all of the fields in such a value structure would require using
  12.125 +// HidP_GetUsageValueArray and HidP_SetUsageValueArray.   HidP_GetUsageValue/
  12.126 +// HidP_SetScaledUsageValue will also work, however, these functions will only
  12.127 +// work with the first field of the structure.
  12.128 +//
  12.129 +
  12.130 +//
  12.131 +// The link collection tree consists of an array of LINK_COLLECTION_NODES
  12.132 +// where the index into this array is the same as the collection number.
  12.133 +//
  12.134 +// Given a collection A which contains a subcollection B, A is defined to be
  12.135 +// the parent B, and B is defined to be the child.
  12.136 +//
  12.137 +// Given collections A, B, and C where B and C are children of A, and B was
  12.138 +// encountered before C in the report descriptor, B is defined as a sibling of
  12.139 +// C.  (This implies, of course, that if B is a sibling of C, then C is NOT a
  12.140 +// sibling of B).
  12.141 +//
  12.142 +// B is defined as the NextSibling of C if and only if there exists NO
  12.143 +// child collection of A, call it D, such that B is a sibling of D and D
  12.144 +// is a sibling of C.
  12.145 +//
  12.146 +// E is defined to be the FirstChild of A if and only if for all children of A,
  12.147 +// F, that are not equivalent to E, F is a sibling of E.
  12.148 +// (This implies, of course, that the does not exist a child of A, call it G,
  12.149 +// where E is a sibling of G).  In other words the first sibling is the last
  12.150 +// link collection found in the list.
  12.151 +//
  12.152 +// In other words, if a collection B is defined within the definition of another
  12.153 +// collection A, B becomes a child of A.  All collections with the same parent
  12.154 +// are considered siblings.  The FirstChild of the parent collection, A, will be
  12.155 +// last collection defined that has A as a parent.  The order of sibling pointers
  12.156 +// is similarly determined.  When a collection B is defined, it becomes the
  12.157 +// FirstChild of it's parent collection.  The previously defined FirstChild of the
  12.158 +// parent collection becomes the NextSibling of the new collection.  As new
  12.159 +// collections with the same parent are discovered, the chain of sibling is built.
  12.160 +//
  12.161 +// With that in mind, the following describes conclusively a data structure
  12.162 +// that provides direct traversal up, down, and accross the link collection
  12.163 +// tree.
  12.164 +//
  12.165 +//
  12.166 +typedef struct _HIDP_LINK_COLLECTION_NODE
  12.167 +{
  12.168 +    USAGE    LinkUsage;
  12.169 +    USAGE    LinkUsagePage;
  12.170 +    USHORT   Parent;
  12.171 +    USHORT   NumberOfChildren;
  12.172 +    USHORT   NextSibling;
  12.173 +    USHORT   FirstChild;
  12.174 +    ULONG    CollectionType: 8;  // As defined in 6.2.2.6 of HID spec
  12.175 +    ULONG    IsAlias : 1; // This link node is an allias of the next link node.
  12.176 +    ULONG    Reserved: 23;
  12.177 +    PVOID    UserContext; // The user can hang his coat here.
  12.178 +} HIDP_LINK_COLLECTION_NODE, *PHIDP_LINK_COLLECTION_NODE;
  12.179 +
  12.180 +//
  12.181 +// When a link collection is described by a delimiter, alias link collection
  12.182 +// nodes are created.  (One for each usage within the delimiter).
  12.183 +// The parser assigns each capability description listed above only one
  12.184 +// link collection.
  12.185 +//
  12.186 +// If a control is defined within a collection defined by
  12.187 +// delimited usages, then that control is said to be within multiple link
  12.188 +// collections, one for each usage within the open and close delimiter tokens.
  12.189 +// Such multiple link collecions are said to be aliases.  The first N-1 such
  12.190 +// collections, listed in the link collection node array, have their IsAlias
  12.191 +// bit set.  The last such link collection is the link collection index used
  12.192 +// in the capabilities described above.
  12.193 +// Clients wishing to set a control in an aliased collection, should walk the
  12.194 +// collection array once for each time they see the IsAlias flag set, and use
  12.195 +// the last link collection as the index for the below accessor functions.
  12.196 +//
  12.197 +// NB: if IsAlias is set, then NextSibling should be one more than the current
  12.198 +// link collection node index.
  12.199 +//
  12.200 +
  12.201 +typedef PUCHAR  PHIDP_REPORT_DESCRIPTOR;
  12.202 +typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA;
  12.203 +
  12.204 +typedef struct _HIDP_CAPS
  12.205 +{
  12.206 +    USAGE    Usage;
  12.207 +    USAGE    UsagePage;
  12.208 +    USHORT   InputReportByteLength;
  12.209 +    USHORT   OutputReportByteLength;
  12.210 +    USHORT   FeatureReportByteLength;
  12.211 +    USHORT   Reserved[17];
  12.212 +
  12.213 +    USHORT   NumberLinkCollectionNodes;
  12.214 +
  12.215 +    USHORT   NumberInputButtonCaps;
  12.216 +    USHORT   NumberInputValueCaps;
  12.217 +    USHORT   NumberInputDataIndices;
  12.218 +
  12.219 +    USHORT   NumberOutputButtonCaps;
  12.220 +    USHORT   NumberOutputValueCaps;
  12.221 +    USHORT   NumberOutputDataIndices;
  12.222 +
  12.223 +    USHORT   NumberFeatureButtonCaps;
  12.224 +    USHORT   NumberFeatureValueCaps;
  12.225 +    USHORT   NumberFeatureDataIndices;
  12.226 +} HIDP_CAPS, *PHIDP_CAPS;
  12.227 +
  12.228 +typedef struct _HIDP_DATA
  12.229 +{
  12.230 +    USHORT  DataIndex;
  12.231 +    USHORT  Reserved;
  12.232 +    union {
  12.233 +        ULONG   RawValue; // for values
  12.234 +        BOOLEAN On; // for buttons MUST BE TRUE for buttons.
  12.235 +    };
  12.236 +} HIDP_DATA, *PHIDP_DATA;
  12.237 +//
  12.238 +// The HIDP_DATA structure is used with HidP_GetData and HidP_SetData
  12.239 +// functions.
  12.240 +//
  12.241 +// The parser contiguously assigns every control (button or value) in a hid
  12.242 +// device a unique data index from zero to NumberXXXDataIndices -1 , inclusive.
  12.243 +// This value is found in the HIDP_BUTTON_CAPS and HIDP_VALUE_CAPS structures.
  12.244 +//
  12.245 +// Most clients will find the Get/Set Buttons / Value accessor functions
  12.246 +// sufficient to their needs, as they will allow the clients to access the
  12.247 +// data known to them while ignoring the other controls.
  12.248 +//
  12.249 +// More complex clients, which actually read the Button / Value Caps, and which
  12.250 +// do a value add service to these routines (EG Direct Input), will need to
  12.251 +// access all the data in the device without interest in the individual usage
  12.252 +// or link collection location.  These are the clients that will find
  12.253 +// HidP_Data useful.
  12.254 +//
  12.255 +
  12.256 +typedef struct _HIDP_UNKNOWN_TOKEN
  12.257 +{
  12.258 +    UCHAR  Token;
  12.259 +    UCHAR  Reserved[3];
  12.260 +    ULONG  BitField;
  12.261 +} HIDP_UNKNOWN_TOKEN, *PHIDP_UNKNOWN_TOKEN;
  12.262 +
  12.263 +typedef struct _HIDP_EXTENDED_ATTRIBUTES
  12.264 +{
  12.265 +    UCHAR   NumGlobalUnknowns;
  12.266 +    UCHAR   Reserved [3];
  12.267 +    PHIDP_UNKNOWN_TOKEN  GlobalUnknowns;
  12.268 +    // ... Additional attributes
  12.269 +    ULONG   Data [1]; // variableLength  DO NOT ACCESS THIS FIELD
  12.270 +} HIDP_EXTENDED_ATTRIBUTES, *PHIDP_EXTENDED_ATTRIBUTES;
  12.271 +
  12.272 +NTSTATUS __stdcall
  12.273 +HidP_GetCaps (
  12.274 +         PHIDP_PREPARSED_DATA      PreparsedData,
  12.275 +        PHIDP_CAPS                Capabilities
  12.276 +   );
  12.277 +/*++
  12.278 +Routine Description:
  12.279 +   Returns a list of capabilities of a given hid device as described by its
  12.280 +   preparsed data.
  12.281 +
  12.282 +Arguments:
  12.283 +   PreparsedData    The preparsed data returned from HIDCLASS.
  12.284 +   Capabilities     a HIDP_CAPS structure
  12.285 +
  12.286 +Return Value:
  12.287 +   HIDP_STATUS_SUCCESS
  12.288 +   HIDP_STATUS_INVALID_PREPARSED_DATA
  12.289 +--*/
  12.290 +
  12.291 +NTSTATUS __stdcall
  12.292 +HidP_GetLinkCollectionNodes (
  12.293 +        PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
  12.294 +      PULONG                     LinkCollectionNodesLength,
  12.295 +         PHIDP_PREPARSED_DATA       PreparsedData
  12.296 +   );
  12.297 +/*++
  12.298 +Routine Description:
  12.299 +   Return a list of PHIDP_LINK_COLLECTION_NODEs used to describe the link
  12.300 +   collection tree of this hid device.  See the above description of
  12.301 +   struct _HIDP_LINK_COLLECTION_NODE.
  12.302 +
  12.303 +Arguments:
  12.304 +   LinkCollectionNodes - a caller allocated array into which
  12.305 +                 HidP_GetLinkCollectionNodes will store the information
  12.306 +
  12.307 +   LinKCollectionNodesLength - the caller sets this value to the length of the
  12.308 +                 the array in terms of number of elements.
  12.309 +                 HidP_GetLinkCollectionNodes sets this value to the actual
  12.310 +                 number of elements set. The total number of nodes required to
  12.311 +                 describe this HID device can be found in the
  12.312 +                 NumberLinkCollectionNodes field in the HIDP_CAPS structure.
  12.313 +
  12.314 +--*/
  12.315 +
  12.316 +NTSTATUS __stdcall
  12.317 +HidP_GetSpecificButtonCaps (
  12.318 +          HIDP_REPORT_TYPE     ReportType,
  12.319 +          USAGE                UsagePage,      // Optional (0 => ignore)
  12.320 +          USHORT               LinkCollection, // Optional (0 => ignore)
  12.321 +          USAGE                Usage,          // Optional (0 => ignore)
  12.322 +   PHIDP_BUTTON_CAPS    ButtonCaps,
  12.323 +     PUSHORT              ButtonCapsLength,
  12.324 +          PHIDP_PREPARSED_DATA PreparsedData
  12.325 +   );
  12.326 +/*++
  12.327 +Description:
  12.328 +   HidP_GetButtonCaps returns all the buttons (binary values) that are a part
  12.329 +   of the given report type for the Hid device represented by the given
  12.330 +   preparsed data.
  12.331 +
  12.332 +Parameters:
  12.333 +   ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  12.334 +
  12.335 +   UsagePage   A usage page value used to limit the button caps returned to
  12.336 +                those on a given usage page.  If set to 0, this parameter is
  12.337 +                ignored.  Can be used with LinkCollection and Usage parameters
  12.338 +                to further limit the number of button caps structures returned.
  12.339 +
  12.340 +   LinkCollection HIDP_LINK_COLLECTION node array index used to limit the
  12.341 +                  button caps returned to those buttons in a given link
  12.342 +                  collection.  If set to 0, this parameter is
  12.343 +                  ignored.  Can be used with UsagePage and Usage parameters
  12.344 +                  to further limit the number of button caps structures
  12.345 +                  returned.
  12.346 +
  12.347 +   Usage      A usage value used to limit the button caps returned to those
  12.348 +               with the specified usage value.  If set to 0, this parameter
  12.349 +               is ignored.  Can be used with LinkCollection and UsagePage
  12.350 +               parameters to further limit the number of button caps
  12.351 +               structures returned.
  12.352 +
  12.353 +   ButtonCaps A _HIDP_BUTTON_CAPS array containing information about all the
  12.354 +               binary values in the given report.  This buffer is provided by
  12.355 +               the caller.
  12.356 +
  12.357 +   ButtonLength   As input, this parameter specifies the length of the
  12.358 +                  ButtonCaps parameter (array) in number of array elements.
  12.359 +                  As output, this value is set to indicate how many of those
  12.360 +                  array elements were filled in by the function.  The maximum number of
  12.361 +                  button caps that can be returned is found in the HIDP_CAPS
  12.362 +                  structure.  If HIDP_STATUS_BUFFER_TOO_SMALL is returned,
  12.363 +                  this value contains the number of array elements needed to
  12.364 +                  successfully complete the request.
  12.365 +
  12.366 +   PreparsedData  The preparsed data returned from HIDCLASS.
  12.367 +
  12.368 +
  12.369 +Return Value
  12.370 +HidP_GetSpecificButtonCaps returns the following error codes:
  12.371 +  HIDP_STATUS_SUCCESS.
  12.372 +  HIDP_STATUS_INVALID_REPORT_TYPE
  12.373 +  HIDP_STATUS_INVALID_PREPARSED_DATA
  12.374 +  HIDP_STATUS_BUFFER_TOO_SMALL (all given entries however have been filled in)
  12.375 +  HIDP_STATUS_USAGE_NOT_FOUND
  12.376 +--*/
  12.377 +NTSTATUS __stdcall
  12.378 +HidP_GetButtonCaps (
  12.379 +          HIDP_REPORT_TYPE     ReportType,
  12.380 +   PHIDP_BUTTON_CAPS ButtonCaps,
  12.381 +       PUSHORT              ButtonCapsLength,
  12.382 +          PHIDP_PREPARSED_DATA PreparsedData
  12.383 +);
  12.384 +
  12.385 +NTSTATUS __stdcall
  12.386 +HidP_GetSpecificValueCaps (
  12.387 +          HIDP_REPORT_TYPE     ReportType,
  12.388 +          USAGE                UsagePage,      // Optional (0 => ignore)
  12.389 +          USHORT               LinkCollection, // Optional (0 => ignore)
  12.390 +          USAGE                Usage,          // Optional (0 => ignore)
  12.391 +          PHIDP_VALUE_CAPS     ValueCaps,
  12.392 +       PUSHORT              ValueCapsLength,
  12.393 +          PHIDP_PREPARSED_DATA PreparsedData
  12.394 +   );
  12.395 +/*++
  12.396 +Description:
  12.397 +   HidP_GetValueCaps returns all the values (non-binary) that are a part
  12.398 +   of the given report type for the Hid device represented by the given
  12.399 +   preparsed data.
  12.400 +
  12.401 +Parameters:
  12.402 +   ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  12.403 +
  12.404 +   UsagePage   A usage page value used to limit the value caps returned to
  12.405 +                those on a given usage page.  If set to 0, this parameter is
  12.406 +                ignored.  Can be used with LinkCollection and Usage parameters
  12.407 +                to further limit the number of value caps structures returned.
  12.408 +
  12.409 +   LinkCollection HIDP_LINK_COLLECTION node array index used to limit the
  12.410 +                  value caps returned to those buttons in a given link
  12.411 +                  collection.  If set to 0, this parameter is
  12.412 +                  ignored.  Can be used with UsagePage and Usage parameters
  12.413 +                  to further limit the number of value caps structures
  12.414 +                  returned.
  12.415 +
  12.416 +   Usage      A usage value used to limit the value caps returned to those
  12.417 +               with the specified usage value.  If set to 0, this parameter
  12.418 +               is ignored.  Can be used with LinkCollection and UsagePage
  12.419 +               parameters to further limit the number of value caps
  12.420 +               structures returned.
  12.421 +
  12.422 +   ValueCaps  A _HIDP_VALUE_CAPS array containing information about all the
  12.423 +               non-binary values in the given report.  This buffer is provided
  12.424 +               by the caller.
  12.425 +
  12.426 +   ValueLength   As input, this parameter specifies the length of the ValueCaps
  12.427 +                  parameter (array) in number of array elements.  As output,
  12.428 +                  this value is set to indicate how many of those array elements
  12.429 +                  were filled in by the function.  The maximum number of
  12.430 +                  value caps that can be returned is found in the HIDP_CAPS
  12.431 +                  structure.  If HIDP_STATUS_BUFFER_TOO_SMALL is returned,
  12.432 +                  this value contains the number of array elements needed to
  12.433 +                  successfully complete the request.
  12.434 +
  12.435 +   PreparsedData  The preparsed data returned from HIDCLASS.
  12.436 +
  12.437 +
  12.438 +Return Value
  12.439 +HidP_GetValueCaps returns the following error codes:
  12.440 +  HIDP_STATUS_SUCCESS.
  12.441 +  HIDP_STATUS_INVALID_REPORT_TYPE
  12.442 +  HIDP_STATUS_INVALID_PREPARSED_DATA
  12.443 +  HIDP_STATUS_BUFFER_TOO_SMALL (all given entries however have been filled in)
  12.444 +  HIDP_STATUS_USAGE_NOT_FOUND
  12.445 +
  12.446 +--*/
  12.447 +
  12.448 +NTSTATUS __stdcall
  12.449 +HidP_GetValueCaps (
  12.450 +          HIDP_REPORT_TYPE     ReportType,
  12.451 +   PHIDP_VALUE_CAPS ValueCaps,
  12.452 +       PUSHORT              ValueCapsLength,
  12.453 +          PHIDP_PREPARSED_DATA PreparsedData
  12.454 +);
  12.455 +
  12.456 +NTSTATUS __stdcall
  12.457 +HidP_GetExtendedAttributes (
  12.458 +          HIDP_REPORT_TYPE            ReportType,
  12.459 +          USHORT                      DataIndex,
  12.460 +          PHIDP_PREPARSED_DATA        PreparsedData,
  12.461 +    PHIDP_EXTENDED_ATTRIBUTES Attributes,
  12.462 +       PULONG                      LengthAttributes
  12.463 +    );
  12.464 +/*++
  12.465 +Description:
  12.466 +    Given a data index from the value or button capabilities of a given control
  12.467 +    return any extended attributes for the control if any exist.
  12.468 +
  12.469 +Parameters:
  12.470 +    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  12.471 +
  12.472 +    DataIndex   The data index for the given control, found in the capabilities
  12.473 +                structure for that control
  12.474 +
  12.475 +    PreparsedData   The preparsed data returned from HIDCLASS.
  12.476 +
  12.477 +    Attributes  Pointer to a buffer into which the extended attribute data will
  12.478 +                be copied.
  12.479 +
  12.480 +    LengthAttributes    Length of the given buffer in bytes.
  12.481 +
  12.482 +Return Value
  12.483 +    HIDP_STATUS_SUCCESS
  12.484 +    HIDP_STATUS_DATA_INDEX_NOT_FOUND
  12.485 +--*/
  12.486 +
  12.487 +NTSTATUS __stdcall
  12.488 +HidP_InitializeReportForID (
  12.489 +    HIDP_REPORT_TYPE ReportType,
  12.490 +    UCHAR ReportID,
  12.491 +    PHIDP_PREPARSED_DATA PreparsedData,
  12.492 +   PCHAR Report,
  12.493 +    ULONG ReportLength
  12.494 +   );
  12.495 +/*++
  12.496 +
  12.497 +Routine Description:
  12.498 +
  12.499 +    Initialize a report based on the given report ID.
  12.500 +
  12.501 +Parameters:
  12.502 +
  12.503 +    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  12.504 +
  12.505 +    PreparasedData  Preparsed data structure returned by HIDCLASS
  12.506 +
  12.507 +    Report      Buffer which to set the data into.
  12.508 +
  12.509 +    ReportLength Length of Report...Report should be at least as long as the
  12.510 +                value indicated in the HIDP_CAPS structure for the device and
  12.511 +                the corresponding ReportType
  12.512 +
  12.513 +Return Value
  12.514 +
  12.515 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  12.516 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  12.517 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not equal
  12.518 +                                        to the length specified in HIDP_CAPS
  12.519 +                                        structure for the given ReportType
  12.520 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  12.521 +                                        for the given ReportType
  12.522 +
  12.523 +--*/
  12.524 +
  12.525 +NTSTATUS __stdcall
  12.526 +HidP_SetData (
  12.527 +     HIDP_REPORT_TYPE ReportType,
  12.528 +    PHIDP_DATA DataList,
  12.529 +     PULONG DataLength,
  12.530 +     PHIDP_PREPARSED_DATA PreparsedData,
  12.531 +    PCHAR Report,
  12.532 +     ULONG ReportLength
  12.533 +    );
  12.534 +/*++
  12.535 +
  12.536 +Routine Description:
  12.537 +
  12.538 +    Please Note: Since usage value arrays deal with multiple fields for
  12.539 +                 for one usage value, they cannot be used with HidP_SetData
  12.540 +                 and HidP_GetData.  In this case,
  12.541 +                 HIDP_STATUS_IS_USAGE_VALUE_ARRAY will be returned.
  12.542 +
  12.543 +Parameters:
  12.544 +
  12.545 +    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  12.546 +
  12.547 +    DataList    Array of HIDP_DATA structures that contains the data values
  12.548 +                that are to be set into the given report
  12.549 +
  12.550 +    DataLength  As input, length in array elements of DataList.  As output,
  12.551 +                contains the number of data elements set on successful
  12.552 +                completion or an index into the DataList array to identify
  12.553 +                the faulting HIDP_DATA value if an error code is returned.
  12.554 +
  12.555 +    PreparasedData  Preparsed data structure returned by HIDCLASS
  12.556 +
  12.557 +    Report      Buffer which to set the data into.
  12.558 +
  12.559 +    ReportLength Length of Report...Report should be at least as long as the
  12.560 +                value indicated in the HIDP_CAPS structure for the device and
  12.561 +                the corresponding ReportType
  12.562 +
  12.563 +Return Value
  12.564 +    HidP_SetData returns the following error codes.  The report packet will
  12.565 +        have all the data set up until the HIDP_DATA structure that caused the
  12.566 +        error.  DataLength, in the error case, will return this problem index.
  12.567 +
  12.568 +  HIDP_STATUS_SUCCESS                -- upon successful insertion of all data
  12.569 +                                        into the report packet.
  12.570 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  12.571 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  12.572 +  HIDP_STATUS_DATA_INDEX_NOT_FOUND   -- if a HIDP_DATA structure referenced a
  12.573 +                                        data index that does not exist for this
  12.574 +                                        device's ReportType
  12.575 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not equal
  12.576 +                                        to the length specified in HIDP_CAPS
  12.577 +                                        structure for the given ReportType
  12.578 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  12.579 +                                        for the given ReportType
  12.580 +  HIDP_STATUS_IS_USAGE_VALUE_ARRAY   -- if one of the HIDP_DATA structures
  12.581 +                                        references a usage value array.
  12.582 +                                        DataLength will contain the index into
  12.583 +                                        the array that was invalid
  12.584 +  HIDP_STATUS_BUTTON_NOT_PRESSED     -- if a HIDP_DATA structure attempted
  12.585 +                                        to unset a button that was not already
  12.586 +                                        set in the Report
  12.587 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- a HIDP_DATA structure was found with
  12.588 +                                        a valid index value but is contained
  12.589 +                                        in a different report than the one
  12.590 +                                        currently being processed
  12.591 +  HIDP_STATUS_BUFFER_TOO_SMALL       -- if there are not enough entries in
  12.592 +                                        a given Main Array Item to report all
  12.593 +                                        buttons that have been requested to be
  12.594 +                                        set
  12.595 +--*/
  12.596 +
  12.597 +NTSTATUS __stdcall
  12.598 +HidP_GetData (
  12.599 +     HIDP_REPORT_TYPE ReportType,
  12.600 +    PHIDP_DATA DataList,
  12.601 +     PULONG DataLength,
  12.602 +     PHIDP_PREPARSED_DATA PreparsedData,
  12.603 +    PCHAR Report,
  12.604 +     ULONG ReportLength
  12.605 +    );
  12.606 +/*++
  12.607 +
  12.608 +Routine Description:
  12.609 +
  12.610 +    Please Note: For obvious reasons HidP_SetData and HidP_GetData will not
  12.611 +    access UsageValueArrays.
  12.612 +
  12.613 +Parameters:
  12.614 +    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  12.615 +
  12.616 +    DataList    Array of HIDP_DATA structures that will receive the data
  12.617 +                values that are set in the given report
  12.618 +
  12.619 +    DataLength  As input, length in array elements of DataList.  As output,
  12.620 +                contains the number of data elements that were successfully
  12.621 +                set by HidP_GetData.  The maximum size necessary for DataList
  12.622 +                can be determined by calling HidP_MaxDataListLength
  12.623 +
  12.624 +    PreparasedData  Preparsed data structure returned by HIDCLASS
  12.625 +
  12.626 +    Report      Buffer which to set the data into.
  12.627 +
  12.628 +    ReportLength Length of Report...Report should be at least as long as the
  12.629 +                value indicated in the HIDP_CAPS structure for the device and
  12.630 +                the corresponding ReportType
  12.631 +
  12.632 +Return Value
  12.633 +    HidP_GetData returns the following error codes.
  12.634 +
  12.635 +  HIDP_STATUS_SUCCESS                -- upon successful retrieval of all data
  12.636 +                                        from the report packet.
  12.637 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  12.638 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  12.639 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not equal
  12.640 +                                        to the length specified in HIDP_CAPS
  12.641 +                                        structure for the given ReportType
  12.642 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  12.643 +                                        for the given ReportType
  12.644 +  HIDP_STATUS_BUFFER_TOO_SMALL       -- if there are not enough array entries in
  12.645 +                                        DataList to store all the indice values
  12.646 +                                        in the given report.  DataLength will
  12.647 +                                        contain the number of array entries
  12.648 +                                        required to hold all data
  12.649 +--*/
  12.650 +
  12.651 +
  12.652 +ULONG __stdcall
  12.653 +HidP_MaxDataListLength (
  12.654 +    HIDP_REPORT_TYPE      ReportType,
  12.655 +    PHIDP_PREPARSED_DATA  PreparsedData
  12.656 +   );
  12.657 +/*++
  12.658 +Routine Description:
  12.659 +
  12.660 +    This function returns the maximum length of HIDP_DATA elements that
  12.661 +    HidP_GetData could return for the given report type.
  12.662 +
  12.663 +Parameters:
  12.664 +
  12.665 +    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
  12.666 +
  12.667 +    PreparsedData    Preparsed data structure returned by HIDCLASS
  12.668 +
  12.669 +Return Value:
  12.670 +
  12.671 +    The length of the data list array required for the HidP_GetData function
  12.672 +    call.  If an error occurs (either HIDP_STATUS_INVALID_REPORT_TYPE or
  12.673 +    HIDP_STATUS_INVALID_PREPARSED_DATA), this function returns 0.
  12.674 +
  12.675 +--*/
  12.676 +
  12.677 +#define HidP_SetButtons(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle) \
  12.678 +        HidP_SetUsages(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle)
  12.679 +
  12.680 +
  12.681 +NTSTATUS __stdcall
  12.682 +HidP_SetUsages (
  12.683 +    HIDP_REPORT_TYPE    ReportType,
  12.684 +    USAGE   UsagePage,
  12.685 +    USHORT  LinkCollection,
  12.686 +   PUSAGE  UsageList,
  12.687 +     PULONG  UsageLength,
  12.688 +    PHIDP_PREPARSED_DATA  PreparsedData,
  12.689 +   PCHAR   Report,
  12.690 +    ULONG   ReportLength 
  12.691 +   );
  12.692 +/*++
  12.693 +
  12.694 +Routine Description:
  12.695 +    This function sets binary values (buttons) in a report.  Given an
  12.696 +    initialized packet of correct length, it modifies the report packet so that
  12.697 +    each element in the given list of usages has been set in the report packet.
  12.698 +    For example, in an output report with 5 LED's, each with a given usage,
  12.699 +    an application could turn on any subset of these lights by placing their
  12.700 +    usages in any order into the usage array (UsageList).  HidP_SetUsages would,
  12.701 +    in turn, set the appropriate bit or add the corresponding byte into the
  12.702 +    HID Main Array Item.
  12.703 +
  12.704 +    A properly initialized Report packet is one of the correct byte length,
  12.705 +    and all zeros.
  12.706 +
  12.707 +    NOTE: A packet that has already been set with a call to a HidP_Set routine
  12.708 +          can also be passed in.  This routine then sets processes the UsageList
  12.709 +          in the same fashion but verifies that the ReportID already set in
  12.710 +          Report matches the report ID for the given usages.
  12.711 +
  12.712 +Parameters:
  12.713 +    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
  12.714 +
  12.715 +    UsagePage   All of the usages in the usage array, which HidP_SetUsages will
  12.716 +                set in the report, refer to this same usage page.
  12.717 +                If a client wishes to set usages in a report for multiple
  12.718 +                usage pages then that client needs to make multiple calls to
  12.719 +                HidP_SetUsages for each of the usage pages.
  12.720 +
  12.721 +    UsageList   A usage array containing the usages that HidP_SetUsages will set in
  12.722 +                the report packet.
  12.723 +
  12.724 +    UsageLength The length of the given usage array in array elements.
  12.725 +                The parser will set this value to the position in the usage
  12.726 +                array where it stopped processing.  If successful, UsageLength
  12.727 +                will be unchanged.  In any error condition, this parameter
  12.728 +                reflects how many of the usages in the usage list have
  12.729 +                actually been set by the parser.  This is useful for finding
  12.730 +                the usage in the list which caused the error.
  12.731 +
  12.732 +    PreparsedData The preparsed data recevied from HIDCLASS
  12.733 +
  12.734 +    Report      The report packet.
  12.735 +
  12.736 +    ReportLength   Length of the given report packet...Must be equal to the
  12.737 +                   value reported in the HIDP_CAPS structure for the device
  12.738 +                   and corresponding report type.
  12.739 +
  12.740 +Return Value
  12.741 +    HidP_SetUsages returns the following error codes.  On error, the report packet
  12.742 +    will be correct up until the usage element that caused the error.
  12.743 +
  12.744 +  HIDP_STATUS_SUCCESS                -- upon successful insertion of all usages
  12.745 +                                        into the report packet.
  12.746 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  12.747 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  12.748 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
  12.749 +                                        equal to the length specified in
  12.750 +                                        the HIDP_CAPS structure for the given
  12.751 +                                        ReportType
  12.752 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  12.753 +                                        for the given ReportType
  12.754 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if a usage was found that exists in a
  12.755 +                                        different report.  If the report is
  12.756 +                                        zero-initialized on entry the first
  12.757 +                                        usage in the list will determine which
  12.758 +                                        report ID is used.  Otherwise, the
  12.759 +                                        parser will verify that usage matches
  12.760 +                                        the passed in report's ID
  12.761 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage does not exist for any
  12.762 +                                        report (no matter what the report ID)
  12.763 +                                        for the given report type.
  12.764 +  HIDP_STATUS_BUFFER_TOO_SMALL       -- if there are not enough entries in a
  12.765 +                                        given Main Array Item to list all of
  12.766 +                                        the given usages.  The caller needs
  12.767 +                                        to split his request into more than
  12.768 +                                        one call
  12.769 +--*/
  12.770 +
  12.771 +#define HidP_UnsetButtons(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle) \
  12.772 +        HidP_UnsetUsages(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle)
  12.773 +
  12.774 +
  12.775 +NTSTATUS __stdcall
  12.776 +HidP_UnsetUsages (
  12.777 +    HIDP_REPORT_TYPE      ReportType,
  12.778 +    USAGE   UsagePage,
  12.779 +   USHORT  LinkCollection,
  12.780 +   PUSAGE  UsageList,
  12.781 +     PULONG  UsageLength,
  12.782 +    PHIDP_PREPARSED_DATA  PreparsedData,
  12.783 +   PCHAR   Report,
  12.784 +    ULONG   ReportLength
  12.785 +   );
  12.786 +/*++
  12.787 +
  12.788 +Routine Description:
  12.789 +    This function unsets (turns off) binary values (buttons) in the report.  Given
  12.790 +    an initialized packet of correct length, it modifies the report packet so
  12.791 +    that each element in the given list of usages has been unset in the
  12.792 +    report packet.
  12.793 +
  12.794 +    This function is the "undo" operation for SetUsages.  If the given usage
  12.795 +    is not already set in the Report, it will return an error code of
  12.796 +    HIDP_STATUS_BUTTON_NOT_PRESSED.  If the button is pressed, HidP_UnsetUsages
  12.797 +    will unset the appropriate bit or remove the corresponding index value from
  12.798 +    the HID Main Array Item.
  12.799 +
  12.800 +    A properly initialized Report packet is one of the correct byte length,
  12.801 +    and all zeros..
  12.802 +
  12.803 +    NOTE: A packet that has already been set with a call to a HidP_Set routine
  12.804 +          can also be passed in.  This routine then processes the UsageList
  12.805 +          in the same fashion but verifies that the ReportID already set in
  12.806 +          Report matches the report ID for the given usages.
  12.807 +
  12.808 +Parameters:
  12.809 +    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
  12.810 +
  12.811 +    UsagePage   All of the usages in the usage array, which HidP_UnsetUsages will
  12.812 +                unset in the report, refer to this same usage page.
  12.813 +                If a client wishes to unset usages in a report for multiple
  12.814 +                usage pages then that client needs to make multiple calls to
  12.815 +                HidP_UnsetUsages for each of the usage pages.
  12.816 +
  12.817 +    UsageList   A usage array containing the usages that HidP_UnsetUsages will
  12.818 +                unset in the report packet.
  12.819 +
  12.820 +    UsageLength The length of the given usage array in array elements.
  12.821 +                The parser will set this value to the position in the usage
  12.822 +                array where it stopped processing.  If successful, UsageLength
  12.823 +                will be unchanged.  In any error condition, this parameter
  12.824 +                reflects how many of the usages in the usage list have
  12.825 +                actually been unset by the parser.  This is useful for finding
  12.826 +                the usage in the list which caused the error.
  12.827 +
  12.828 +    PreparsedData The preparsed data recevied from HIDCLASS
  12.829 +
  12.830 +    Report      The report packet.
  12.831 +
  12.832 +    ReportLength   Length of the given report packet...Must be equal to the
  12.833 +                   value reported in the HIDP_CAPS structure for the device
  12.834 +                   and corresponding report type.
  12.835 +
  12.836 +Return Value
  12.837 +    HidP_UnsetUsages returns the following error codes.  On error, the report
  12.838 +    packet will be correct up until the usage element that caused the error.
  12.839 +
  12.840 +  HIDP_STATUS_SUCCESS                -- upon successful "unsetting" of all usages
  12.841 +                                        in the report packet.
  12.842 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  12.843 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  12.844 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
  12.845 +                                        equal to the length specified in
  12.846 +                                        the HIDP_CAPS structure for the given
  12.847 +                                        ReportType
  12.848 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  12.849 +                                        for the given ReportType
  12.850 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if a usage was found that exists in a
  12.851 +                                        different report.  If the report is
  12.852 +                                        zero-initialized on entry the first
  12.853 +                                        usage in the list will determine which
  12.854 +                                        report ID is used.  Otherwise, the
  12.855 +                                        parser will verify that usage matches
  12.856 +                                        the passed in report's ID
  12.857 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage does not exist for any
  12.858 +                                        report (no matter what the report ID)
  12.859 +                                        for the given report type.
  12.860 +  HIDP_STATUS_BUTTON_NOT_PRESSED     -- if a usage corresponds to a button that
  12.861 +                                        is not already set in the given report
  12.862 +--*/
  12.863 +
  12.864 +#define HidP_GetButtons(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe) \
  12.865 +        HidP_GetUsages(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe)
  12.866 +
  12.867 +
  12.868 +NTSTATUS __stdcall
  12.869 +HidP_GetUsages (
  12.870 +    HIDP_REPORT_TYPE    ReportType,
  12.871 +    USAGE   UsagePage,
  12.872 +    USHORT  LinkCollection,
  12.873 +   PUSAGE UsageList,
  12.874 +       PULONG UsageLength,
  12.875 +    PHIDP_PREPARSED_DATA PreparsedData,
  12.876 +   PCHAR Report,
  12.877 +    ULONG   ReportLength
  12.878 +   );
  12.879 +/*++
  12.880 +
  12.881 +Routine Description:
  12.882 +    This function returns the binary values (buttons) that are set in a HID
  12.883 +    report.  Given a report packet of correct length, it searches the report
  12.884 +    packet for each usage for the given usage page and returns them in the
  12.885 +    usage list.
  12.886 +
  12.887 +Parameters:
  12.888 +    ReportType One of HidP_Input, HidP_Output or HidP_Feature.
  12.889 +
  12.890 +    UsagePage  All of the usages in the usage list, which HidP_GetUsages will
  12.891 +               retrieve in the report, refer to this same usage page.
  12.892 +               If the client wishes to get usages in a packet for multiple
  12.893 +               usage pages then that client needs to make multiple calls
  12.894 +               to HidP_GetUsages.
  12.895 +
  12.896 +    LinkCollection  An optional value which can limit which usages are returned
  12.897 +                    in the UsageList to those usages that exist in a specific
  12.898 +                    LinkCollection.  A non-zero value indicates the index into
  12.899 +                    the HIDP_LINK_COLLECITON_NODE list returned by
  12.900 +                    HidP_GetLinkCollectionNodes of the link collection the
  12.901 +                    usage should belong to.  A value of 0 indicates this
  12.902 +                    should value be ignored.
  12.903 +
  12.904 +    UsageList  The usage array that will contain all the usages found in
  12.905 +               the report packet.
  12.906 +
  12.907 +    UsageLength The length of the given usage array in array elements.
  12.908 +                On input, this value describes the length of the usage list.
  12.909 +                On output, HidP_GetUsages sets this value to the number of
  12.910 +                usages that was found.  Use HidP_MaxUsageListLength to
  12.911 +                determine the maximum length needed to return all the usages
  12.912 +                that a given report packet may contain.
  12.913 +
  12.914 +    PreparsedData Preparsed data structure returned by HIDCLASS
  12.915 +
  12.916 +    Report       The report packet.
  12.917 +
  12.918 +    ReportLength  Length (in bytes) of the given report packet
  12.919 +
  12.920 +
  12.921 +Return Value
  12.922 +    HidP_GetUsages returns the following error codes:
  12.923 +
  12.924 +  HIDP_STATUS_SUCCESS                -- upon successfully retrieving all the
  12.925 +                                        usages from the report packet
  12.926 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  12.927 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  12.928 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
  12.929 +                                        equal to the length specified in
  12.930 +                                        the HIDP_CAPS structure for the given
  12.931 +                                        ReportType
  12.932 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  12.933 +                                        for the given ReportType
  12.934 +  HIDP_STATUS_BUFFER_TOO_SMALL       -- if the UsageList is not big enough to
  12.935 +                                        hold all the usages found in the report
  12.936 +                                        packet.  If this is returned, the buffer
  12.937 +                                        will contain UsageLength number of
  12.938 +                                        usages.  Use HidP_MaxUsageListLength to
  12.939 +                                        find the maximum length needed
  12.940 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if no usages were found but usages
  12.941 +                                        that match the UsagePage and
  12.942 +                                        LinkCollection specified could be found
  12.943 +                                        in a report with a different report ID
  12.944 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if there are no usages in a reports for
  12.945 +                                        the device and ReportType that match the
  12.946 +                                        UsagePage and LinkCollection that were
  12.947 +                                        specified
  12.948 +--*/
  12.949 +
  12.950 +#define HidP_GetButtonsEx(Rty, LCo, BLi, ULe, Ppd, Rep, RLe)  \
  12.951 +         HidP_GetUsagesEx(Rty, LCo, BLi, ULe, Ppd, Rep, RLe)
  12.952 +
  12.953 +NTSTATUS __stdcall
  12.954 +HidP_GetUsagesEx (
  12.955 +        HIDP_REPORT_TYPE    ReportType,
  12.956 +        USHORT  LinkCollection, // Optional
  12.957 +    PUSAGE_AND_PAGE  ButtonList,
  12.958 +       ULONG * UsageLength,
  12.959 +     PHIDP_PREPARSED_DATA PreparsedData,
  12.960 +    reads_bytes_(ReportLength)   PCHAR   Report,
  12.961 +     ULONG  ReportLength
  12.962 +   );
  12.963 +
  12.964 +/*++
  12.965 +
  12.966 +Routine Description:
  12.967 +    This function returns the binary values (buttons) in a HID report.
  12.968 +    Given a report packet of correct length, it searches the report packet
  12.969 +    for all buttons and returns the UsagePage and Usage for each of the buttons
  12.970 +    it finds.
  12.971 +
  12.972 +Parameters:
  12.973 +    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
  12.974 +
  12.975 +    LinkCollection  An optional value which can limit which usages are returned
  12.976 +                    in the ButtonList to those usages that exist in a specific
  12.977 +                    LinkCollection.  A non-zero value indicates the index into
  12.978 +                    the HIDP_LINK_COLLECITON_NODE list returned by
  12.979 +                    HidP_GetLinkCollectionNodes of the link collection the
  12.980 +                    usage should belong to.  A value of 0 indicates this
  12.981 +                    should value be ignored.
  12.982 +
  12.983 +    ButtonList  An array of USAGE_AND_PAGE structures describing all the
  12.984 +                buttons currently ``down'' in the device.
  12.985 +
  12.986 +    UsageLength The length of the given array in terms of elements.
  12.987 +                On input, this value describes the length of the list.  On
  12.988 +                output, HidP_GetUsagesEx sets this value to the number of
  12.989 +                usages that were found.  Use HidP_MaxUsageListLength to
  12.990 +                determine the maximum length needed to return all the usages
  12.991 +                that a given report packet may contain.
  12.992 +
  12.993 +    PreparsedData Preparsed data returned by HIDCLASS
  12.994 +
  12.995 +    Report       The report packet.
  12.996 +
  12.997 +    ReportLength Length (in bytes) of the given report packet.
  12.998 +
  12.999 +
 12.1000 +Return Value
 12.1001 +    HidP_GetUsagesEx returns the following error codes:
 12.1002 +
 12.1003 +  HIDP_STATUS_SUCCESS                -- upon successfully retrieving all the
 12.1004 +                                        usages from the report packet
 12.1005 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 12.1006 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 12.1007 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 12.1008 +                                        equal to the length specified in
 12.1009 +                                        the HIDP_CAPS structure for the given
 12.1010 +                                        ReportType
 12.1011 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
 12.1012 +                                        for the given ReportType
 12.1013 +  HIDP_STATUS_BUFFER_TOO_SMALL       -- if ButtonList is not big enough to
 12.1014 +                                        hold all the usages found in the report
 12.1015 +                                        packet.  If this is returned, the buffer
 12.1016 +                                        will contain UsageLength number of
 12.1017 +                                        usages.  Use HidP_MaxUsageListLength to
 12.1018 +                                        find the maximum length needed
 12.1019 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if no usages were found but usages
 12.1020 +                                        that match the specified LinkCollection
 12.1021 +                                        exist in report with a different report
 12.1022 +                                        ID.
 12.1023 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if there are no usages in any reports that
 12.1024 +                                        match the LinkCollection parameter
 12.1025 +--*/
 12.1026 +        
 12.1027 +_IRQL_requires_max_(PASSIVE_LEVEL) 
 12.1028 +ULONG __stdcall
 12.1029 +HidP_MaxUsageListLength (
 12.1030 +    HIDP_REPORT_TYPE      ReportType,
 12.1031 +    USAGE                 UsagePage, // Optional
 12.1032 +    PHIDP_PREPARSED_DATA  PreparsedData
 12.1033 +   );
 12.1034 +/*++
 12.1035 +Routine Description:
 12.1036 +    This function returns the maximum number of usages that a call to
 12.1037 +    HidP_GetUsages or HidP_GetUsagesEx could return for a given HID report.
 12.1038 +    If calling for number of usages returned by HidP_GetUsagesEx, use 0 as
 12.1039 +    the UsagePage value.
 12.1040 +
 12.1041 +Parameters:
 12.1042 +    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
 12.1043 +
 12.1044 +    UsagePage   Specifies the optional UsagePage to query for.  If 0, will
 12.1045 +                return all the maximum number of usage values that could be
 12.1046 +                returned for a given ReportType.   If non-zero, will return
 12.1047 +                the maximum number of usages that would be returned for the
 12.1048 +                ReportType with the given UsagePage.
 12.1049 +
 12.1050 +    PreparsedData Preparsed data returned from HIDCLASS
 12.1051 +
 12.1052 +Return Value:
 12.1053 +    The length of the usage list array required for the HidP_GetUsages or
 12.1054 +    HidP_GetUsagesEx function call.  If an error occurs (such as
 12.1055 +    HIDP_STATUS_INVALID_REPORT_TYPE or HIDP_INVALID_PREPARSED_DATA, this
 12.1056 +    returns 0.
 12.1057 +--*/
 12.1058 +
 12.1059 +
 12.1060 +NTSTATUS __stdcall
 12.1061 +HidP_SetUsageValue (
 12.1062 +     HIDP_REPORT_TYPE ReportType,
 12.1063 +     USAGE UsagePage,
 12.1064 +     USHORT LinkCollection,
 12.1065 +     USAGE Usage,
 12.1066 +     ULONG UsageValue,
 12.1067 +     PHIDP_PREPARSED_DATA PreparsedData,
 12.1068 +    updates_bytes_(ReportLength) PCHAR Report,
 12.1069 +     ULONG ReportLength
 12.1070 +    );
 12.1071 +/*++
 12.1072 +Description:
 12.1073 +    HidP_SetUsageValue inserts a value into the HID Report Packet in the field
 12.1074 +    corresponding to the given usage page and usage.  HidP_SetUsageValue
 12.1075 +    casts this value to the appropriate bit length.  If a report packet
 12.1076 +    contains two different fields with the same Usage and UsagePage,
 12.1077 +    they can be distinguished with the optional LinkCollection field value.
 12.1078 +    Using this function sets the raw value into the report packet with
 12.1079 +    no checking done as to whether it actually falls within the logical
 12.1080 +    minimum/logical maximum range.  Use HidP_SetScaledUsageValue for this...
 12.1081 +
 12.1082 +    NOTE: Although the UsageValue parameter is a ULONG, any casting that is
 12.1083 +          done will preserve or sign-extend the value.  The value being set
 12.1084 +          should be considered a LONG value and will be treated as such by
 12.1085 +          this function.
 12.1086 +
 12.1087 +Parameters:
 12.1088 +
 12.1089 +    ReportType  One of HidP_Output or HidP_Feature.
 12.1090 +
 12.1091 +    UsagePage   The usage page to which the given usage refers.
 12.1092 +
 12.1093 +    LinkCollection  (Optional)  This value can be used to differentiate
 12.1094 +                                between two fields that may have the same
 12.1095 +                                UsagePage and Usage but exist in different
 12.1096 +                                collections.  If the link collection value
 12.1097 +                                is zero, this function will set the first field
 12.1098 +                                it finds that matches the usage page and
 12.1099 +                                usage.
 12.1100 +
 12.1101 +    Usage       The usage whose value HidP_SetUsageValue will set.
 12.1102 +
 12.1103 +    UsageValue  The raw value to set in the report buffer.  This value must be within
 12.1104 +                the logical range or if a NULL value this value should be the
 12.1105 +                most negative value that can be represented by the number of bits
 12.1106 +                for this field.
 12.1107 +
 12.1108 +    PreparsedData The preparsed data returned for HIDCLASS
 12.1109 +
 12.1110 +    Report      The report packet.
 12.1111 +
 12.1112 +    ReportLength Length (in bytes) of the given report packet.
 12.1113 +
 12.1114 +
 12.1115 +Return Value:
 12.1116 +    HidP_SetUsageValue returns the following error codes:
 12.1117 +
 12.1118 +  HIDP_STATUS_SUCCESS                -- upon successfully setting the value
 12.1119 +                                        in the report packet
 12.1120 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 12.1121 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 12.1122 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 12.1123 +                                        equal to the length specified in
 12.1124 +                                        the HIDP_CAPS structure for the given
 12.1125 +                                        ReportType
 12.1126 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
 12.1127 +                                        for the given ReportType
 12.1128 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 12.1129 +                                        link collection exist but exists in
 12.1130 +                                        a report with a different report ID
 12.1131 +                                        than the report being passed in.  To
 12.1132 +                                        set this value, call HidP_SetUsageValue
 12.1133 +                                        again with a zero-initizialed report
 12.1134 +                                        packet
 12.1135 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 12.1136 +                                        collection combination does not exist
 12.1137 +                                        in any reports for this ReportType
 12.1138 +--*/
 12.1139 +
 12.1140 +NTSTATUS __stdcall
 12.1141 +HidP_SetScaledUsageValue (
 12.1142 +     HIDP_REPORT_TYPE ReportType,
 12.1143 +     USAGE UsagePage,
 12.1144 +     USHORT LinkCollection,
 12.1145 +     USAGE Usage,
 12.1146 +     LONG UsageValue,
 12.1147 +     PHIDP_PREPARSED_DATA PreparsedData,
 12.1148 +    updates_bytes_(ReportLength) PCHAR Report,
 12.1149 +     ULONG ReportLength
 12.1150 +    );
 12.1151 +
 12.1152 +/*++
 12.1153 +Description:
 12.1154 +    HidP_SetScaledUsageValue inserts the UsageValue into the HID report packet
 12.1155 +    in the field corresponding to the given usage page and usage.  If a report
 12.1156 +    packet contains two different fields with the same Usage and UsagePage,
 12.1157 +    they can be distinguished with the optional LinkCollection field value.
 12.1158 +
 12.1159 +    If the specified field has a defined physical range, this function converts
 12.1160 +    the physical value specified to the corresponding logical value for the
 12.1161 +    report.  If a physical value does not exist, the function will verify that
 12.1162 +    the value specified falls within the logical range and set according.
 12.1163 +
 12.1164 +    If the range checking fails but the field has NULL values, the function will
 12.1165 +    set the field to the defined NULL value (most negative number possible) and
 12.1166 +    return HIDP_STATUS_NULL.  In other words, use this function to set NULL
 12.1167 +    values for a given field by passing in a value that falls outside the
 12.1168 +    physical range if it is defined or the logical range otherwise.
 12.1169 +
 12.1170 +    If the field does not support NULL values, an out of range error will be
 12.1171 +    returned instead.
 12.1172 +
 12.1173 +Parameters:
 12.1174 +
 12.1175 +    ReportType  One of HidP_Output or HidP_Feature.
 12.1176 +
 12.1177 +    UsagePage   The usage page to which the given usage refers.
 12.1178 +
 12.1179 +    LinkCollection  (Optional)  This value can be used to differentiate
 12.1180 +                                between two fields that may have the same
 12.1181 +                                UsagePage and Usage but exist in different
 12.1182 +                                collections.  If the link collection value
 12.1183 +                                is zero, this function will set the first field
 12.1184 +                                it finds that matches the usage page and
 12.1185 +                                usage.
 12.1186 +
 12.1187 +    Usage       The usage whose value HidP_SetScaledUsageValue will set.
 12.1188 +
 12.1189 +    UsageValue  The value to set in the report buffer.  See the routine
 12.1190 +                description above for the different interpretations of this
 12.1191 +                value
 12.1192 +
 12.1193 +    PreparsedData The preparsed data returned from HIDCLASS
 12.1194 +
 12.1195 +    Report      The report packet.
 12.1196 +
 12.1197 +    ReportLength Length (in bytes) of the given report packet.
 12.1198 +
 12.1199 +
 12.1200 +Return Value:
 12.1201 +   HidP_SetScaledUsageValue returns the following error codes:
 12.1202 +
 12.1203 +  HIDP_STATUS_SUCCESS                -- upon successfully setting the value
 12.1204 +                                        in the report packet
 12.1205 +  HIDP_STATUS_NULL                   -- upon successfully setting the value
 12.1206 +                                        in the report packet as a NULL value
 12.1207 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 12.1208 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 12.1209 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 12.1210 +                                        equal to the length specified in
 12.1211 +                                        the HIDP_CAPS structure for the given
 12.1212 +                                        ReportType
 12.1213 +  HIDP_STATUS_VALUEOF_RANGE     -- if the value specified failed to fall
 12.1214 +                                        within the physical range if it exists
 12.1215 +                                        or within the logical range otherwise
 12.1216 +                                        and the field specified by the usage
 12.1217 +                                        does not allow NULL values
 12.1218 +  HIDP_STATUS_BAD_LOG_PHY_VALUES     -- if the field has a physical range but
 12.1219 +                                        either the logical range is invalid
 12.1220 +                                        (max <= min) or the physical range is
 12.1221 +                                        invalid
 12.1222 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 12.1223 +                                        link collection exist but exists in
 12.1224 +                                        a report with a different report ID
 12.1225 +                                        than the report being passed in.  To
 12.1226 +                                        set this value, call
 12.1227 +                                        HidP_SetScaledUsageValue again with
 12.1228 +                                        a zero-initialized report packet
 12.1229 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 12.1230 +                                        collection combination does not exist
 12.1231 +                                        in any reports for this ReportType
 12.1232 +--*/
 12.1233 +
 12.1234 +NTSTATUS __stdcall
 12.1235 +HidP_SetUsageValueArray (
 12.1236 +     HIDP_REPORT_TYPE ReportType,
 12.1237 +     USAGE UsagePage,
 12.1238 +     USHORT LinkCollection,
 12.1239 +     USAGE Usage,
 12.1240 +    reads_bytes_(UsageValueByteLength) PCHAR UsageValue,
 12.1241 +     USHORT UsageValueByteLength,
 12.1242 +     PHIDP_PREPARSED_DATA PreparsedData,
 12.1243 +    updates_bytes_(ReportLength) PCHAR Report,
 12.1244 +     ULONG ReportLength
 12.1245 +    );
 12.1246 +
 12.1247 +/*++
 12.1248 +Routine Descripton:
 12.1249 +    A usage value array occurs when the last usage in the list of usages
 12.1250 +    describing a main item must be repeated because there are less usages defined
 12.1251 +    than there are report counts declared for the given main item.  In this case
 12.1252 +    a single value cap is allocated for that usage and the report count of that
 12.1253 +    value cap is set to reflect the number of fields to which that usage refers.
 12.1254 +
 12.1255 +    HidP_SetUsageValueArray sets the raw bits for that usage which spans
 12.1256 +    more than one field in a report.
 12.1257 +
 12.1258 +    NOTE: This function currently does not support value arrays where the
 12.1259 +          ReportSize for each of the fields in the array is not a multiple
 12.1260 +          of 8 bits.
 12.1261 +
 12.1262 +          The UsageValue buffer should have the values set as they would appear
 12.1263 +          in the report buffer.  If this function supported non 8-bit multiples
 12.1264 +          for the ReportSize then caller should format the input buffer so that
 12.1265 +          each new value begins at the bit immediately following the last bit
 12.1266 +          of the previous value
 12.1267 +
 12.1268 +Parameters:
 12.1269 +
 12.1270 +    ReportType  One of HidP_Output or HidP_Feature.
 12.1271 +
 12.1272 +    UsagePage   The usage page to which the given usage refers.
 12.1273 +
 12.1274 +    LinkCollection  (Optional)  This value can be used to differentiate
 12.1275 +                                between two fields that may have the same
 12.1276 +                                UsagePage and Usage but exist in different
 12.1277 +                                collections.  If the link collection value
 12.1278 +                                is zero, this function will set the first field
 12.1279 +                                it finds that matches the usage page and
 12.1280 +                                usage.
 12.1281 +
 12.1282 +    Usage       The usage whose value array HidP_SetUsageValueArray will set.
 12.1283 +
 12.1284 +    UsageValue  The buffer with the values to set into the value array.
 12.1285 +                The number of BITS required is found by multiplying the
 12.1286 +                BitSize and ReportCount fields of the Value Cap for this
 12.1287 +                control.  The least significant bit of this control found in the
 12.1288 +                given report will be placed in the least significan bit location
 12.1289 +                of the array given (little-endian format), regardless of whether
 12.1290 +                or not the field is byte alligned or if the BitSize is a multiple
 12.1291 +                of sizeof (CHAR).
 12.1292 +
 12.1293 +                See the above note for current implementation limitations.
 12.1294 +
 12.1295 +    UsageValueByteLength  Length of the UsageValue buffer (in bytes)
 12.1296 +
 12.1297 +    PreparsedData The preparsed data returned from HIDCLASS
 12.1298 +
 12.1299 +    Report      The report packet.
 12.1300 +
 12.1301 +    ReportLength Length (in bytes) of the given report packet.
 12.1302 +
 12.1303 +
 12.1304 +Return Value:
 12.1305 +  HIDP_STATUS_SUCCESS                -- upon successfully setting the value
 12.1306 +                                        array in the report packet
 12.1307 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 12.1308 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 12.1309 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 12.1310 +                                        equal to the length specified in
 12.1311 +                                        the HIDP_CAPS structure for the given
 12.1312 +                                        ReportType
 12.1313 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
 12.1314 +                                        for the given ReportType
 12.1315 +  HIDP_STATUS_NOT_VALUE_ARRAY        -- if the control specified is not a
 12.1316 +                                        value array -- a value array will have
 12.1317 +                                        a ReportCount field in the
 12.1318 +                                        HIDP_VALUE_CAPS structure that is > 1
 12.1319 +                                        Use HidP_SetUsageValue instead
 12.1320 +  HIDP_STATUS_BUFFER_TOO_SMALL       -- if the size of the passed in buffer with
 12.1321 +                                        the values to set is too small (ie. has
 12.1322 +                                        fewer values than the number of fields in
 12.1323 +                                        the array
 12.1324 +  HIDP_STATUS_NOT_IMPLEMENTED        -- if the usage value array has field sizes
 12.1325 +                                        that are not multiples of 8 bits, this
 12.1326 +                                        error code is returned since the function
 12.1327 +                                        currently does not handle setting into
 12.1328 +                                        such arrays.
 12.1329 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 12.1330 +                                        link collection exist but exists in
 12.1331 +                                        a report with a different report ID
 12.1332 +                                        than the report being passed in.  To
 12.1333 +                                        set this value, call
 12.1334 +                                        HidP_SetUsageValueArray again with
 12.1335 +                                        a zero-initialized report packet
 12.1336 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 12.1337 +                                        collection combination does not exist
 12.1338 +                                        in any reports for this ReportType
 12.1339 +--*/
 12.1340 +
 12.1341 +
 12.1342 +NTSTATUS __stdcall
 12.1343 +HidP_GetUsageValue (
 12.1344 +     HIDP_REPORT_TYPE ReportType,
 12.1345 +     USAGE UsagePage,
 12.1346 +     USHORT LinkCollection,
 12.1347 +     USAGE Usage,
 12.1348 +     PULONG UsageValue,
 12.1349 +     PHIDP_PREPARSED_DATA PreparsedData,
 12.1350 +    reads_bytes_(ReportLength) PCHAR Report,
 12.1351 +     ULONG ReportLength
 12.1352 +    );
 12.1353 +
 12.1354 +/*
 12.1355 +Description
 12.1356 +    HidP_GetUsageValue retrieves the value from the HID Report for the usage
 12.1357 +    specified by the combination of usage page, usage and link collection.
 12.1358 +    If a report packet contains two different fields with the same
 12.1359 +    Usage and UsagePage, they can be distinguished with the optional
 12.1360 +    LinkCollection field value.
 12.1361 +
 12.1362 +Parameters:
 12.1363 +
 12.1364 +    ReportType  One of HidP_Input or HidP_Feature.
 12.1365 +
 12.1366 +    UsagePage   The usage page to which the given usage refers.
 12.1367 +
 12.1368 +    LinkCollection  (Optional)  This value can be used to differentiate
 12.1369 +                                between two fields that may have the same
 12.1370 +                                UsagePage and Usage but exist in different
 12.1371 +                                collections.  If the link collection value
 12.1372 +                                is zero, this function will set the first field
 12.1373 +                                it finds that matches the usage page and
 12.1374 +                                usage.
 12.1375 +
 12.1376 +    Usage       The usage whose value HidP_GetUsageValue will retrieve
 12.1377 +
 12.1378 +    UsageValue  The raw value that is set for the specified field in the report
 12.1379 +                buffer. This value will either fall within the logical range
 12.1380 +                or if NULL values are allowed, a number outside the range to
 12.1381 +                indicate a NULL
 12.1382 +
 12.1383 +    PreparsedData The preparsed data returned for HIDCLASS
 12.1384 +
 12.1385 +    Report      The report packet.
 12.1386 +
 12.1387 +    ReportLength Length (in bytes) of the given report packet.
 12.1388 +
 12.1389 +
 12.1390 +Return Value:
 12.1391 +    HidP_GetUsageValue returns the following error codes:
 12.1392 +
 12.1393 +  HIDP_STATUS_SUCCESS                -- upon successfully retrieving the value
 12.1394 +                                        from the report packet
 12.1395 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 12.1396 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 12.1397 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 12.1398 +                                        equal to the length specified in
 12.1399 +                                        the HIDP_CAPS structure for the given
 12.1400 +                                        ReportType
 12.1401 +  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
 12.1402 +                                        for the given ReportType
 12.1403 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 12.1404 +                                        link collection exist but exists in
 12.1405 +                                        a report with a different report ID
 12.1406 +                                        than the report being passed in.  To
 12.1407 +                                        set this value, call HidP_GetUsageValue
 12.1408 +                                        again with a different report packet
 12.1409 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 12.1410 +                                        collection combination does not exist
 12.1411 +                                        in any reports for this ReportType
 12.1412 +--*/
 12.1413 +
 12.1414 +
 12.1415 +NTSTATUS __stdcall
 12.1416 +HidP_GetScaledUsageValue (
 12.1417 +     HIDP_REPORT_TYPE ReportType,
 12.1418 +     USAGE UsagePage,
 12.1419 +     USHORT LinkCollection,
 12.1420 +     USAGE Usage,
 12.1421 +     PLONG UsageValue,
 12.1422 +     PHIDP_PREPARSED_DATA PreparsedData,
 12.1423 +    reads_bytes_(ReportLength) PCHAR Report,
 12.1424 +     ULONG ReportLength
 12.1425 +    );
 12.1426 +
 12.1427 +/*++
 12.1428 +Description
 12.1429 +    HidP_GetScaledUsageValue retrieves a UsageValue from the HID report packet
 12.1430 +    in the field corresponding to the given usage page and usage.  If a report
 12.1431 +    packet contains two different fields with the same Usage and UsagePage,
 12.1432 +    they can be distinguished with the optional LinkCollection field value.
 12.1433 +
 12.1434 +    If the specified field has a defined physical range, this function converts
 12.1435 +    the logical value that exists in the report packet to the corresponding
 12.1436 +    physical value.  If a physical range does not exist, the function will
 12.1437 +    return the logical value.  This function will check to verify that the
 12.1438 +    logical value in the report falls within the declared logical range.
 12.1439 +
 12.1440 +    When doing the conversion between logical and physical values, this
 12.1441 +    function assumes a linear extrapolation between the physical max/min and
 12.1442 +    the logical max/min. (Where logical is the values reported by the device
 12.1443 +    and physical is the value returned by this function).  If the data field
 12.1444 +    size is less than 32 bits, then HidP_GetScaledUsageValue will sign extend
 12.1445 +    the value to 32 bits.
 12.1446 +
 12.1447 +    If the range checking fails but the field has NULL values, the function
 12.1448 +    will set UsageValue to 0 and return HIDP_STATUS_NULL.  Otherwise, it
 12.1449 +    returns a HIDP_STATUSOF_RANGE error.
 12.1450 +
 12.1451 +Parameters:
 12.1452 +
 12.1453 +    ReportType  One of HidP_Output or HidP_Feature.
 12.1454 +
 12.1455 +    UsagePage   The usage page to which the given usage refers.
 12.1456 +
 12.1457 +    LinkCollection  (Optional)  This value can be used to differentiate
 12.1458 +                                between two fields that may have the same
 12.1459 +                                UsagePage and Usage but exist in different
 12.1460 +                                collections.  If the link collection value
 12.1461 +                                is zero, this function will retrieve the first
 12.1462 +                                field it finds that matches the usage page
 12.1463 +                                and usage.
 12.1464 +
 12.1465 +    Usage       The usage whose value HidP_GetScaledUsageValue will retrieve
 12.1466 +
 12.1467 +    UsageValue  The value retrieved from the report buffer.  See the routine
 12.1468 +                description above for the different interpretations of this
 12.1469 +                value
 12.1470 +
 12.1471 +    PreparsedData The preparsed data returned from HIDCLASS
 12.1472 +
 12.1473 +    Report      The report packet.
 12.1474 +
 12.1475 +    ReportLength Length (in bytes) of the given report packet.
 12.1476 +
 12.1477 +
 12.1478 +Return Value:
 12.1479 +   HidP_GetScaledUsageValue returns the following error codes:
 12.1480 +
 12.1481 +  HIDP_STATUS_SUCCESS                -- upon successfully retrieving the value
 12.1482 +                                        from the report packet
 12.1483 +  HIDP_STATUS_NULL                   -- if the report packet had a NULL value
 12.1484 +                                        set
 12.1485 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 12.1486 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 12.1487 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 12.1488 +                                        equal to the length specified in
 12.1489 +                                        the HIDP_CAPS structure for the given
 12.1490 +                                        ReportType
 12.1491 +  HIDP_STATUS_VALUEOF_RANGE     -- if the value retrieved from the packet
 12.1492 +                                        falls outside the logical range and
 12.1493 +                                        the field does not support NULL values
 12.1494 +  HIDP_STATUS_BAD_LOG_PHY_VALUES     -- if the field has a physical range but
 12.1495 +                                        either the logical range is invalid
 12.1496 +                                        (max <= min) or the physical range is
 12.1497 +                                        invalid
 12.1498 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 12.1499 +                                        link collection exist but exists in
 12.1500 +                                        a report with a different report ID
 12.1501 +                                        than the report being passed in.  To
 12.1502 +                                        set this value, call
 12.1503 +                                        HidP_GetScaledUsageValue with a
 12.1504 +                                        different report packet
 12.1505 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 12.1506 +                                        collection combination does not exist
 12.1507 +                                        in any reports for this ReportType
 12.1508 +--*/
 12.1509 +
 12.1510 +NTSTATUS __stdcall
 12.1511 +HidP_GetUsageValueArray (
 12.1512 +     HIDP_REPORT_TYPE ReportType,
 12.1513 +     USAGE UsagePage,
 12.1514 +     USHORT LinkCollection,
 12.1515 +     USAGE Usage,
 12.1516 +    updates_bytes_(UsageValueByteLength) PCHAR UsageValue,
 12.1517 +     USHORT UsageValueByteLength,
 12.1518 +     PHIDP_PREPARSED_DATA PreparsedData,
 12.1519 +    reads_bytes_(ReportLength) PCHAR Report,
 12.1520 +     ULONG ReportLength
 12.1521 +    );
 12.1522 +
 12.1523 +/*++
 12.1524 +Routine Descripton:
 12.1525 +    A usage value array occurs when the last usage in the list of usages
 12.1526 +    describing a main item must be repeated because there are less usages defined
 12.1527 +    than there are report counts declared for the given main item.  In this case
 12.1528 +    a single value cap is allocated for that usage and the report count of that
 12.1529 +    value cap is set to reflect the number of fields to which that usage refers.
 12.1530 +
 12.1531 +    HidP_GetUsageValueArray returns the raw bits for that usage which spans
 12.1532 +    more than one field in a report.
 12.1533 +
 12.1534 +    NOTE: This function currently does not support value arrays where the
 12.1535 +          ReportSize for each of the fields in the array is not a multiple
 12.1536 +          of 8 bits.
 12.1537 +
 12.1538 +          The UsageValue buffer will have the raw values as they are set
 12.1539 +          in the report packet.
 12.1540 +
 12.1541 +Parameters:
 12.1542 +
 12.1543 +    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
 12.1544 +
 12.1545 +    UsagePage   The usage page to which the given usage refers.
 12.1546 +
 12.1547 +    LinkCollection  (Optional)  This value can be used to differentiate
 12.1548 +                                between two fields that may have the same
 12.1549 +                                UsagePage and Usage but exist in different
 12.1550 +                                collections.  If the link collection value
 12.1551 +                                is zero, this function will set the first field
 12.1552 +                                it finds that matches the usage page and
 12.1553 +                                usage.
 12.1554 +
 12.1555 +   Usage       The usage whose value HidP_GetUsageValueArray will retreive.
 12.1556 +
 12.1557 +   UsageValue  A pointer to an array of characters where the value will be
 12.1558 +               placed.  The number of BITS required is found by multiplying the
 12.1559 +               BitSize and ReportCount fields of the Value Cap for this
 12.1560 +               control.  The least significant bit of this control found in the
 12.1561 +               given report will be placed in the least significant bit location
 12.1562 +               of the buffer (little-endian format), regardless of whether
 12.1563 +               or not the field is byte aligned or if the BitSize is a multiple
 12.1564 +               of sizeof (CHAR).
 12.1565 +
 12.1566 +               See note above about current implementation limitations
 12.1567 +
 12.1568 +   UsageValueByteLength
 12.1569 +               the length of the given UsageValue buffer.
 12.1570 +
 12.1571 +   PreparsedData The preparsed data returned by the HIDCLASS
 12.1572 +
 12.1573 +   Report      The report packet.
 12.1574 +
 12.1575 +   ReportLength   Length of the given report packet.
 12.1576 +
 12.1577 +Return Value:
 12.1578 +
 12.1579 +  HIDP_STATUS_SUCCESS                -- upon successfully retrieving the value
 12.1580 +                                        from the report packet
 12.1581 +  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 12.1582 +  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 12.1583 +  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 12.1584 +                                        equal to the length specified in
 12.1585 +                                        the HIDP_CAPS structure for the given
 12.1586 +                                        ReportType
 12.1587 +  HIDP_STATUS_NOT_VALUE_ARRAY        -- if the control specified is not a
 12.1588 +                                        value array -- a value array will have
 12.1589 +                                        a ReportCount field in the
 12.1590 +                                        HIDP_VALUE_CAPS structure that is > 1
 12.1591 +                                        Use HidP_GetUsageValue instead
 12.1592 +  HIDP_STATUS_BUFFER_TOO_SMALL       -- if the size of the passed in buffer in
 12.1593 +                                        which to return the array is too small
 12.1594 +                                        (ie. has fewer values than the number of
 12.1595 +                                        fields in the array
 12.1596 +  HIDP_STATUS_NOT_IMPLEMENTED        -- if the usage value array has field sizes
 12.1597 +                                        that are not multiples of 8 bits, this
 12.1598 +                                        error code is returned since the function
 12.1599 +                                        currently does not handle getting values
 12.1600 +                                        from such arrays.
 12.1601 +  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 12.1602 +                                        link collection exist but exists in
 12.1603 +                                        a report with a different report ID
 12.1604 +                                        than the report being passed in.  To
 12.1605 +                                        set this value, call
 12.1606 +                                        HidP_GetUsageValueArray with a
 12.1607 +                                        different report packet
 12.1608 +  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 12.1609 +                                        collection combination does not exist
 12.1610 +                                        in any reports for this ReportType
 12.1611 +--*/
 12.1612 +
 12.1613 +
 12.1614 +_IRQL_requires_max_(PASSIVE_LEVEL)
 12.1615 +NTSTATUS __stdcall
 12.1616 +HidP_UsageListDifference (
 12.1617 +   reads_(UsageListLength) PUSAGE  PreviousUsageList,
 12.1618 +   reads_(UsageListLength) PUSAGE  CurrentUsageList,
 12.1619 +   writes_(UsageListLength) PUSAGE  BreakUsageList,
 12.1620 +   writes_(UsageListLength) PUSAGE  MakeUsageList,
 12.1621 +    ULONG    UsageListLength
 12.1622 +    );
 12.1623 +/*++
 12.1624 +Routine Description:
 12.1625 +    This function will return the difference between a two lists of usages
 12.1626 +    (as might be returned from HidP_GetUsages),  In other words, it will return
 12.1627 +    return a list of usages that are in the current list but not the previous
 12.1628 +    list as well as a list of usages that are in the previous list but not
 12.1629 +    the current list.
 12.1630 +
 12.1631 +Parameters:
 12.1632 +
 12.1633 +    PreviousUsageList   The list of usages before.
 12.1634 +    CurrentUsageList    The list of usages now.
 12.1635 +    BreakUsageList      Previous - Current.
 12.1636 +    MakeUsageList       Current - Previous.
 12.1637 +    UsageListLength     Represents the length of the usage lists in array
 12.1638 +                        elements.  If comparing two lists with a differing
 12.1639 +                        number of array elements, this value should be
 12.1640 +                        the size of the larger of the two lists.  Any
 12.1641 +                        zero found with a list indicates an early termination
 12.1642 +                        of the list and any usages found after the first zero
 12.1643 +                        will be ignored.
 12.1644 +--*/
 12.1645 +
 12.1646 +
 12.1647 +_IRQL_requires_max_(PASSIVE_LEVEL)
 12.1648 +NTSTATUS __stdcall
 12.1649 +HidP_UsageAndPageListDifference (
 12.1650 +   reads_(UsageListLength) PUSAGE_AND_PAGE PreviousUsageList,
 12.1651 +   reads_(UsageListLength) PUSAGE_AND_PAGE CurrentUsageList,
 12.1652 +   writes_(UsageListLength) PUSAGE_AND_PAGE BreakUsageList,
 12.1653 +   writes_(UsageListLength) PUSAGE_AND_PAGE MakeUsageList,
 12.1654 +    ULONG           UsageListLength
 12.1655 +   );
 12.1656 +
 12.1657 +//
 12.1658 +// Produce Make or Break Codes
 12.1659 +//
 12.1660 +typedef enum _HIDP_KEYBOARD_DIRECTION {
 12.1661 +    HidP_Keyboard_Break,
 12.1662 +    HidP_Keyboard_Make
 12.1663 +} HIDP_KEYBOARD_DIRECTION;
 12.1664 +
 12.1665 +//
 12.1666 +// A bitmap of the current shift state of the keyboard when using the
 12.1667 +// below keyboard usages to i8042 translation function.
 12.1668 +//
 12.1669 +typedef struct _HIDP_KEYBOARD_MODIFIER_STATE {
 12.1670 +   union {
 12.1671 +      struct {
 12.1672 +         ULONG LeftControl: 1;
 12.1673 +         ULONG LeftShift: 1;
 12.1674 +         ULONG LeftAlt: 1;
 12.1675 +         ULONG LeftGUI: 1;
 12.1676 +         ULONG RightControl: 1;
 12.1677 +         ULONG RightShift: 1;
 12.1678 +         ULONG RightAlt: 1;
 12.1679 +         ULONG RigthGUI: 1;
 12.1680 +         ULONG CapsLock: 1;
 12.1681 +         ULONG ScollLock: 1;
 12.1682 +         ULONG NumLock: 1;
 12.1683 +         ULONG Reserved: 21;
 12.1684 +      };
 12.1685 +      ULONG ul;
 12.1686 +   };
 12.1687 +
 12.1688 +} HIDP_KEYBOARD_MODIFIER_STATE, * PHIDP_KEYBOARD_MODIFIER_STATE;
 12.1689 +
 12.1690 +//
 12.1691 +// A call back function to give the i8042 scan codes to the caller of
 12.1692 +// the below translation function.
 12.1693 +//
 12.1694 +typedef BOOLEAN (* PHIDP_INSERT_SCANCODES) (
 12.1695 +                   PVOID Context,  // Some caller supplied context.
 12.1696 +                  reads_bytes_(Length) PCHAR NewScanCodes, // A list of i8042 scan codes.
 12.1697 +                   ULONG Length // the length of the scan codes.
 12.1698 +                  );
 12.1699 +
 12.1700 +
 12.1701 +NTSTATUS __stdcall
 12.1702 +HidP_TranslateUsageAndPagesToI8042ScanCodes (
 12.1703 +    reads_(UsageListLength)     PUSAGE_AND_PAGE ChangedUsageList,
 12.1704 +         ULONG                         UsageListLength,
 12.1705 +         HIDP_KEYBOARD_DIRECTION       KeyAction,
 12.1706 +      PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
 12.1707 +         PHIDP_INSERT_SCANCODES        InsertCodesProcedure,
 12.1708 +     PVOID                         InsertCodesContext
 12.1709 +    );
 12.1710 +/*++
 12.1711 +Routine Description:
 12.1712 +Parameters:
 12.1713 +--*/
 12.1714 +
 12.1715 +NTSTATUS __stdcall
 12.1716 +HidP_TranslateUsagesToI8042ScanCodes (
 12.1717 +    reads_(UsageListLength)     PUSAGE ChangedUsageList,
 12.1718 +         ULONG                         UsageListLength,
 12.1719 +         HIDP_KEYBOARD_DIRECTION       KeyAction,
 12.1720 +      PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
 12.1721 +         PHIDP_INSERT_SCANCODES        InsertCodesProcedure,
 12.1722 +     PVOID                         InsertCodesContext
 12.1723 +    );
 12.1724 +/*++
 12.1725 +Routine Description:
 12.1726 +Parameters:
 12.1727 +--*/
 12.1728 +
 12.1729 +
 12.1730 +
 12.1731 +//
 12.1732 +// Define NT Status codes with Facility Code of FACILITY_HID_ERROR_CODE
 12.1733 +//
 12.1734 +
 12.1735 +// FACILITY_HID_ERROR_CODE defined in ntstatus.h
 12.1736 +#ifndef FACILITY_HID_ERROR_CODE
 12.1737 +#define FACILITY_HID_ERROR_CODE 0x11
 12.1738 +#endif
 12.1739 +
 12.1740 +#define HIDP_ERROR_CODES(SEV, CODE) \
 12.1741 +        ((NTSTATUS) (((SEV) << 28) | (FACILITY_HID_ERROR_CODE << 16) | (CODE)))
 12.1742 +
 12.1743 +#define HIDP_STATUS_SUCCESS                  (HIDP_ERROR_CODES(0x0,0))
 12.1744 +#define HIDP_STATUS_NULL                     (HIDP_ERROR_CODES(0x8,1))
 12.1745 +#define HIDP_STATUS_INVALID_PREPARSED_DATA   (HIDP_ERROR_CODES(0xC,1))
 12.1746 +#define HIDP_STATUS_INVALID_REPORT_TYPE      (HIDP_ERROR_CODES(0xC,2))
 12.1747 +#define HIDP_STATUS_INVALID_REPORT_LENGTH    (HIDP_ERROR_CODES(0xC,3))
 12.1748 +#define HIDP_STATUS_USAGE_NOT_FOUND          (HIDP_ERROR_CODES(0xC,4))
 12.1749 +#define HIDP_STATUS_VALUEOF_RANGE       (HIDP_ERROR_CODES(0xC,5))
 12.1750 +#define HIDP_STATUS_BAD_LOG_PHY_VALUES       (HIDP_ERROR_CODES(0xC,6))
 12.1751 +#define HIDP_STATUS_BUFFER_TOO_SMALL         (HIDP_ERROR_CODES(0xC,7))
 12.1752 +#define HIDP_STATUS_INTERNAL_ERROR           (HIDP_ERROR_CODES(0xC,8))
 12.1753 +#define HIDP_STATUS_I8042_TRANS_UNKNOWN      (HIDP_ERROR_CODES(0xC,9))
 12.1754 +#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID   (HIDP_ERROR_CODES(0xC,0xA))
 12.1755 +#define HIDP_STATUS_NOT_VALUE_ARRAY          (HIDP_ERROR_CODES(0xC,0xB))
 12.1756 +#define HIDP_STATUS_IS_VALUE_ARRAY           (HIDP_ERROR_CODES(0xC,0xC))
 12.1757 +#define HIDP_STATUS_DATA_INDEX_NOT_FOUND     (HIDP_ERROR_CODES(0xC,0xD))
 12.1758 +#define HIDP_STATUS_DATA_INDEXOF_RANGE  (HIDP_ERROR_CODES(0xC,0xE))
 12.1759 +#define HIDP_STATUS_BUTTON_NOT_PRESSED       (HIDP_ERROR_CODES(0xC,0xF))
 12.1760 +#define HIDP_STATUS_REPORT_DOES_NOT_EXIST    (HIDP_ERROR_CODES(0xC,0x10))
 12.1761 +#define HIDP_STATUS_NOT_IMPLEMENTED          (HIDP_ERROR_CODES(0xC,0x20))
 12.1762 +
 12.1763 +//
 12.1764 +// We blundered this status code.
 12.1765 +//
 12.1766 +#define HIDP_STATUS_I8242_TRANS_UNKNOWN HIDP_STATUS_I8042_TRANS_UNKNOWN
 12.1767 +
 12.1768 +/*++
 12.1769 +
 12.1770 +Copyright (c) Microsoft Corporation. All rights reserved.
 12.1771 +
 12.1772 +Module Name:
 12.1773 +
 12.1774 +    HIDSDI.H
 12.1775 +
 12.1776 +Abstract:
 12.1777 +
 12.1778 +    This module contains the PUBLIC definitions for the
 12.1779 +    code that implements the HID dll.
 12.1780 +
 12.1781 +Environment:
 12.1782 +
 12.1783 +    Kernel & user mode
 12.1784 +
 12.1785 +--*/
 12.1786 +
 12.1787 +
 12.1788 +
 12.1789 +
 12.1790 +typedef struct _HIDD_CONFIGURATION {
 12.1791 +    PVOID    cookie;
 12.1792 +    ULONG    size;
 12.1793 +    ULONG    RingBufferSize;
 12.1794 +} HIDD_CONFIGURATION, *PHIDD_CONFIGURATION;
 12.1795 +
 12.1796 +typedef struct _HIDD_ATTRIBUTES {
 12.1797 +    ULONG   Size; // = sizeof (struct _HIDD_ATTRIBUTES)
 12.1798 +
 12.1799 +    //
 12.1800 +    // Vendor ids of this hid device
 12.1801 +    //
 12.1802 +    USHORT  VendorID;
 12.1803 +    USHORT  ProductID;
 12.1804 +    USHORT  VersionNumber;
 12.1805 +
 12.1806 +    //
 12.1807 +    // Additional fields will be added to the end of this structure.
 12.1808 +    //
 12.1809 +} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
 12.1810 +
 12.1811 +
 12.1812 +BOOLEAN __stdcall
 12.1813 +HidD_GetAttributes (
 12.1814 +      HANDLE              HidDeviceObject,
 12.1815 +     PHIDD_ATTRIBUTES    Attributes
 12.1816 +    );
 12.1817 +/*++
 12.1818 +Routine Description:
 12.1819 +    Fill in the given HIDD_ATTRIBUTES structure with the attributes of the
 12.1820 +    given hid device.
 12.1821 +
 12.1822 +--*/
 12.1823 +
 12.1824 +
 12.1825 +void __stdcall
 12.1826 +HidD_GetHidGuid (
 12.1827 +     LPGUID   HidGuid
 12.1828 +   );
 12.1829 +
 12.1830 +
 12.1831 +BOOLEAN __stdcall
 12.1832 +HidD_GetPreparsedData (
 12.1833 +      HANDLE                  HidDeviceObject,
 12.1834 +    PHIDP_PREPARSED_DATA  * PreparsedData
 12.1835 +   );
 12.1836 +/*++
 12.1837 +Routine Description:
 12.1838 +    Given a handle to a valid Hid Class Device Object, retrieve the preparsed
 12.1839 +    data for the device.  This routine will allocate the appropriately 
 12.1840 +    sized buffer to hold this preparsed data.  It is up to client to call
 12.1841 +    HidP_FreePreparsedData to free the memory allocated to this structure when
 12.1842 +    it is no longer needed.
 12.1843 +
 12.1844 +Arguments:
 12.1845 +   HidDeviceObject A handle to a Hid Device that the client obtains using 
 12.1846 +                   a call to CreateFile on a valid Hid device string name.
 12.1847 +                   The string name can be obtained using standard PnP calls.
 12.1848 +
 12.1849 +   PreparsedData   An opaque data structure used by other functions in this 
 12.1850 +                   library to retrieve information about a given device.
 12.1851 +
 12.1852 +Return Value:
 12.1853 +   TRUE if successful.
 12.1854 +   FALSE otherwise  -- Use GetLastError() to get extended error information
 12.1855 +--*/
 12.1856 +BOOLEAN __stdcall
 12.1857 +HidD_FreePreparsedData (
 12.1858 +    __drv_freesMem(Mem) PHIDP_PREPARSED_DATA PreparsedData
 12.1859 +   );
 12.1860 +
 12.1861 +BOOLEAN __stdcall
 12.1862 +HidD_FlushQueue (
 12.1863 +       HANDLE                HidDeviceObject
 12.1864 +   );
 12.1865 +/*++
 12.1866 +Routine Description:
 12.1867 +    Flush the input queue for the given HID device.
 12.1868 +
 12.1869 +Arguments:
 12.1870 +   HidDeviceObject A handle to a Hid Device that the client obtains using 
 12.1871 +                   a call to CreateFile on a valid Hid device string name.
 12.1872 +                   The string name can be obtained using standard PnP calls.
 12.1873 +
 12.1874 +Return Value:
 12.1875 +   TRUE if successful
 12.1876 +   FALSE otherwise  -- Use GetLastError() to get extended error information
 12.1877 +--*/
 12.1878 +
 12.1879 +BOOLEAN __stdcall
 12.1880 +HidD_GetConfiguration (
 12.1881 +      HANDLE               HidDeviceObject,
 12.1882 +   PHIDD_CONFIGURATION Configuration,
 12.1883 +      ULONG                ConfigurationLength
 12.1884 +   );
 12.1885 +/*++
 12.1886 +Routine Description:
 12.1887 +    Get the configuration information for this Hid device
 12.1888 +
 12.1889 +Arguments:
 12.1890 +   HidDeviceObject      A handle to a Hid Device Object.
 12.1891 +
 12.1892 +   Configuration        A configuration structure.  HidD_GetConfiguration MUST
 12.1893 +                        be called before the configuration can be modified and
 12.1894 +                        set using HidD_SetConfiguration
 12.1895 +
 12.1896 +   ConfigurationLength  That is ``sizeof (HIDD_CONFIGURATION)''. Using this
 12.1897 +                        parameter, we can later increase the length of the 
 12.1898 +                        configuration array and not break older apps.
 12.1899 +
 12.1900 +Return Value:
 12.1901 +   TRUE if successful
 12.1902 +   FALSE otherwise  -- Use GetLastError() to get extended error information
 12.1903 +--*/
 12.1904 +
 12.1905 +BOOLEAN __stdcall
 12.1906 +HidD_SetConfiguration (
 12.1907 +      HANDLE               HidDeviceObject,
 12.1908 +   reads_bytes_(ConfigurationLength) PHIDD_CONFIGURATION Configuration,
 12.1909 +      ULONG                ConfigurationLength
 12.1910 +   );
 12.1911 +/*++
 12.1912 +Routine Description:
 12.1913 +   Set the configuration information for this Hid device...
 12.1914 +   
 12.1915 +   NOTE: HidD_GetConfiguration must be called to retrieve the current 
 12.1916 +         configuration information before this information can be modified 
 12.1917 +         and set.
 12.1918 +
 12.1919 +Arguments:
 12.1920 +    HidDeviceObject      A handle to a Hid Device Object.
 12.1921 + 
 12.1922 +    Configuration        A configuration structure.  HidD_GetConfiguration MUST
 12.1923 +                         be called before the configuration can be modified and
 12.1924 +                         set using HidD_SetConfiguration
 12.1925 + 
 12.1926 +    ConfigurationLength  That is ``sizeof (HIDD_CONFIGURATION)''. Using this
 12.1927 +                         parameter, we can later increase the length of the 
 12.1928 +                         configuration array and not break older apps.
 12.1929 +
 12.1930 +Return Value:
 12.1931 +    TRUE if successful
 12.1932 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.1933 +--*/
 12.1934 +
 12.1935 +BOOLEAN __stdcall
 12.1936 +HidD_GetFeature (
 12.1937 +       HANDLE   HidDeviceObject,
 12.1938 +   PVOID ReportBuffer,
 12.1939 +       ULONG    ReportBufferLength
 12.1940 +   );
 12.1941 +/*++
 12.1942 +Routine Description:
 12.1943 +    Retrieve a feature report from a HID device.
 12.1944 +
 12.1945 +Arguments:
 12.1946 +    HidDeviceObject      A handle to a Hid Device Object.
 12.1947 + 
 12.1948 +    ReportBuffer         The buffer that the feature report should be placed 
 12.1949 +                         into.  The first byte of the buffer should be set to
 12.1950 +                         the report ID of the desired report
 12.1951 + 
 12.1952 +    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
 12.1953 +                         should be greater than or equal to the 
 12.1954 +                         FeatureReportByteLength field as specified in the 
 12.1955 +                         HIDP_CAPS structure for the device
 12.1956 +Return Value:
 12.1957 +    TRUE if successful
 12.1958 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.1959 +--*/
 12.1960 +
 12.1961 +BOOLEAN __stdcall
 12.1962 +HidD_SetFeature (
 12.1963 +       HANDLE   HidDeviceObject,
 12.1964 +   reads_bytes_(ReportBufferLength) PVOID ReportBuffer,
 12.1965 +       ULONG    ReportBufferLength
 12.1966 +   );
 12.1967 +/*++
 12.1968 +Routine Description:
 12.1969 +    Send a feature report to a HID device.
 12.1970 +
 12.1971 +Arguments:
 12.1972 +    HidDeviceObject      A handle to a Hid Device Object.
 12.1973 + 
 12.1974 +    ReportBuffer         The buffer of the feature report to send to the device
 12.1975 + 
 12.1976 +    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
 12.1977 +                         should be greater than or equal to the 
 12.1978 +                         FeatureReportByteLength field as specified in the 
 12.1979 +                         HIDP_CAPS structure for the device
 12.1980 +Return Value:
 12.1981 +    TRUE if successful
 12.1982 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.1983 +--*/
 12.1984 +
 12.1985 +
 12.1986 +
 12.1987 +BOOLEAN __stdcall
 12.1988 +HidD_GetInputReport (
 12.1989 +       HANDLE   HidDeviceObject,
 12.1990 +   PVOID ReportBuffer,
 12.1991 +       ULONG    ReportBufferLength
 12.1992 +   );
 12.1993 +/*++
 12.1994 +Routine Description:
 12.1995 +    Retrieve an input report from a HID device.
 12.1996 +
 12.1997 +Arguments:
 12.1998 +    HidDeviceObject      A handle to a Hid Device Object.
 12.1999 + 
 12.2000 +    ReportBuffer         The buffer that the input report should be placed 
 12.2001 +                         into.  The first byte of the buffer should be set to
 12.2002 +                         the report ID of the desired report
 12.2003 + 
 12.2004 +    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
 12.2005 +                         should be greater than or equal to the 
 12.2006 +                         InputReportByteLength field as specified in the 
 12.2007 +                         HIDP_CAPS structure for the device
 12.2008 +Return Value:
 12.2009 +    TRUE if successful
 12.2010 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2011 +--*/
 12.2012 +
 12.2013 +BOOLEAN __stdcall
 12.2014 +HidD_SetOutputReport (
 12.2015 +       HANDLE   HidDeviceObject,
 12.2016 +   reads_bytes_(ReportBufferLength) PVOID ReportBuffer,
 12.2017 +       ULONG    ReportBufferLength
 12.2018 +   );
 12.2019 +/*++
 12.2020 +Routine Description:
 12.2021 +    Send an output report to a HID device.
 12.2022 +
 12.2023 +Arguments:
 12.2024 +    HidDeviceObject      A handle to a Hid Device Object.
 12.2025 + 
 12.2026 +    ReportBuffer         The buffer of the output report to send to the device
 12.2027 + 
 12.2028 +    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
 12.2029 +                         should be greater than or equal to the 
 12.2030 +                         OutputReportByteLength field as specified in the 
 12.2031 +                         HIDP_CAPS structure for the device
 12.2032 +Return Value:
 12.2033 +    TRUE if successful
 12.2034 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2035 +--*/
 12.2036 +
 12.2037 +#endif
 12.2038 +
 12.2039 +BOOLEAN __stdcall
 12.2040 +HidD_GetNumInputBuffers (
 12.2041 +      HANDLE  HidDeviceObject,
 12.2042 +     PULONG  NumberBuffers
 12.2043 +    );
 12.2044 +/*++
 12.2045 +Routine Description:
 12.2046 +    This function returns the number of input buffers used by the specified
 12.2047 +    file handle to the Hid device.  Each file object has a number of buffers
 12.2048 +    associated with it to queue reports read from the device but which have
 12.2049 +    not yet been read by the user-mode app with a handle to that device.
 12.2050 +
 12.2051 +Arguments:
 12.2052 +    HidDeviceObject      A handle to a Hid Device Object.
 12.2053 + 
 12.2054 +    NumberBuffers        Number of buffers currently being used for this file
 12.2055 +                         handle to the Hid device
 12.2056 +
 12.2057 +Return Value:
 12.2058 +    TRUE if successful
 12.2059 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2060 +--*/
 12.2061 +
 12.2062 +BOOLEAN __stdcall
 12.2063 +HidD_SetNumInputBuffers (
 12.2064 +     HANDLE HidDeviceObject,
 12.2065 +     ULONG  NumberBuffers
 12.2066 +    );
 12.2067 +/*++
 12.2068 +
 12.2069 +Routine Description:
 12.2070 +    This function sets the number of input buffers used by the specified
 12.2071 +    file handle to the Hid device.  Each file object has a number of buffers
 12.2072 +    associated with it to queue reports read from the device but which have
 12.2073 +    not yet been read by the user-mode app with a handle to that device.
 12.2074 +
 12.2075 +Arguments:
 12.2076 +    HidDeviceObject      A handle to a Hid Device Object.
 12.2077 + 
 12.2078 +    NumberBuffers        New number of buffers to use for this file handle to
 12.2079 +                         the Hid device
 12.2080 +
 12.2081 +Return Value:
 12.2082 +    TRUE if successful
 12.2083 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2084 +--*/
 12.2085 +
 12.2086 +BOOLEAN __stdcall
 12.2087 +HidD_GetPhysicalDescriptor (
 12.2088 +       HANDLE   HidDeviceObject,
 12.2089 +   PVOID Buffer,
 12.2090 +       ULONG    BufferLength
 12.2091 +   );
 12.2092 +/*++
 12.2093 +Routine Description:
 12.2094 +    This function retrieves the raw physical descriptor for the specified
 12.2095 +    Hid device.  
 12.2096 +
 12.2097 +Arguments:
 12.2098 +    HidDeviceObject      A handle to a Hid Device Object.
 12.2099 + 
 12.2100 +    Buffer               Buffer which on return will contain the physical
 12.2101 +                         descriptor if one exists for the specified device
 12.2102 +                         handle
 12.2103 +
 12.2104 +    BufferLength         Length of buffer (in bytes)
 12.2105 +
 12.2106 +
 12.2107 +Return Value:
 12.2108 +    TRUE if successful
 12.2109 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2110 +--*/
 12.2111 +
 12.2112 +BOOLEAN __stdcall
 12.2113 +HidD_GetManufacturerString (
 12.2114 +       HANDLE   HidDeviceObject,
 12.2115 +   PVOID Buffer,
 12.2116 +       ULONG    BufferLength
 12.2117 +   );
 12.2118 +/*++
 12.2119 +Routine Description:
 12.2120 +    This function retrieves the manufacturer string from the specified 
 12.2121 +    Hid device.  
 12.2122 +
 12.2123 +Arguments:
 12.2124 +    HidDeviceObject      A handle to a Hid Device Object.
 12.2125 + 
 12.2126 +    Buffer               Buffer which on return will contain the manufacturer
 12.2127 +                         string returned from the device.  This string is a 
 12.2128 +                         wide-character string
 12.2129 +
 12.2130 +    BufferLength         Length of Buffer (in bytes)
 12.2131 +
 12.2132 +
 12.2133 +Return Value:
 12.2134 +    TRUE if successful
 12.2135 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2136 +--*/
 12.2137 +
 12.2138 +BOOLEAN __stdcall
 12.2139 +HidD_GetProductString (
 12.2140 +       HANDLE   HidDeviceObject,
 12.2141 +   PVOID Buffer,
 12.2142 +       ULONG    BufferLength
 12.2143 +   );
 12.2144 +/*++
 12.2145 +Routine Description:
 12.2146 +    This function retrieves the product string from the specified 
 12.2147 +    Hid device.  
 12.2148 +
 12.2149 +Arguments:
 12.2150 +    HidDeviceObject      A handle to a Hid Device Object.
 12.2151 + 
 12.2152 +    Buffer               Buffer which on return will contain the product
 12.2153 +                         string returned from the device.  This string is a 
 12.2154 +                         wide-character string
 12.2155 +
 12.2156 +    BufferLength         Length of Buffer (in bytes)
 12.2157 +
 12.2158 +
 12.2159 +Return Value:
 12.2160 +    TRUE if successful
 12.2161 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2162 +--*/
 12.2163 +
 12.2164 +BOOLEAN __stdcall
 12.2165 +HidD_GetIndexedString (
 12.2166 +       HANDLE   HidDeviceObject,
 12.2167 +       ULONG    StringIndex,
 12.2168 +   PVOID Buffer,
 12.2169 +       ULONG    BufferLength
 12.2170 +   );
 12.2171 +/*++
 12.2172 +Routine Description:
 12.2173 +    This function retrieves a string from the specified Hid device that is
 12.2174 +    specified with a certain string index.
 12.2175 +
 12.2176 +Arguments:
 12.2177 +    HidDeviceObject      A handle to a Hid Device Object.
 12.2178 + 
 12.2179 +    StringIndex          Index of the string to retrieve
 12.2180 +
 12.2181 +    Buffer               Buffer which on return will contain the product
 12.2182 +                         string returned from the device.  This string is a 
 12.2183 +                         wide-character string
 12.2184 +
 12.2185 +    BufferLength         Length of Buffer (in bytes)
 12.2186 +
 12.2187 +Return Value:
 12.2188 +    TRUE if successful
 12.2189 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2190 +--*/
 12.2191 +
 12.2192 +BOOLEAN __stdcall
 12.2193 +HidD_GetSerialNumberString (
 12.2194 +       HANDLE   HidDeviceObject,
 12.2195 +   PVOID Buffer,
 12.2196 +       ULONG    BufferLength
 12.2197 +   );
 12.2198 +/*++
 12.2199 +Routine Description:
 12.2200 +    This function retrieves the serial number string from the specified 
 12.2201 +    Hid device.  
 12.2202 +
 12.2203 +Arguments:
 12.2204 +    HidDeviceObject      A handle to a Hid Device Object.
 12.2205 + 
 12.2206 +    Buffer               Buffer which on return will contain the serial number
 12.2207 +                         string returned from the device.  This string is a 
 12.2208 +                         wide-character string
 12.2209 +
 12.2210 +    BufferLength         Length of Buffer (in bytes)
 12.2211 +
 12.2212 +Return Value:
 12.2213 +    TRUE if successful
 12.2214 +    FALSE otherwise  -- Use GetLastError() to get extended error information
 12.2215 +--*/
 12.2216 +
 12.2217 +
 12.2218 +
 12.2219 +BOOLEAN __stdcall
 12.2220 +HidD_GetMsGenreDescriptor (
 12.2221 +       HANDLE   HidDeviceObject,
 12.2222 +   PVOID Buffer,
 12.2223 +       ULONG    BufferLength
 12.2224 +   );
 12.2225 +
 12.2226 +
 12.2227 +
 12.2228 +
 12.2229 +
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/Win32/PInvoke/pinvoke-interop-assistant-input.c	Sun Mar 15 20:30:00 2015 +0100
    13.3 @@ -0,0 +1,154 @@
    13.4 +
    13.5 +typedef USHORT USAGE, *PUSAGE;
    13.6 +typedef LONG NTSTATUS;
    13.7 +
    13.8 +typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA;
    13.9 +
   13.10 +typedef enum _HIDP_REPORT_TYPE
   13.11 +{
   13.12 +    HidP_Input,
   13.13 +    HidP_Output,
   13.14 +    HidP_Feature
   13.15 +} HIDP_REPORT_TYPE;
   13.16 +
   13.17 +typedef struct _HIDP_CAPS
   13.18 +{
   13.19 +    USAGE    Usage;
   13.20 +    USAGE    UsagePage;
   13.21 +    USHORT   InputReportByteLength;
   13.22 +    USHORT   OutputReportByteLength;
   13.23 +    USHORT   FeatureReportByteLength;
   13.24 +    USHORT   Reserved[17];
   13.25 +
   13.26 +    USHORT   NumberLinkCollectionNodes;
   13.27 +
   13.28 +    USHORT   NumberInputButtonCaps;
   13.29 +    USHORT   NumberInputValueCaps;
   13.30 +    USHORT   NumberInputDataIndices;
   13.31 +
   13.32 +    USHORT   NumberOutputButtonCaps;
   13.33 +    USHORT   NumberOutputValueCaps;
   13.34 +    USHORT   NumberOutputDataIndices;
   13.35 +
   13.36 +    USHORT   NumberFeatureButtonCaps;
   13.37 +    USHORT   NumberFeatureValueCaps;
   13.38 +    USHORT   NumberFeatureDataIndices;
   13.39 +} HIDP_CAPS, *PHIDP_CAPS;
   13.40 +
   13.41 +
   13.42 +typedef struct _HIDP_BUTTON_CAPS
   13.43 +{
   13.44 +    USAGE    UsagePage;
   13.45 +    UCHAR    ReportID;
   13.46 +    BOOLEAN  IsAlias;
   13.47 +
   13.48 +    USHORT   BitField;
   13.49 +    USHORT   LinkCollection;   // A unique internal index pointer
   13.50 +
   13.51 +    USAGE    LinkUsage;
   13.52 +    USAGE    LinkUsagePage;
   13.53 +
   13.54 +    BOOLEAN  IsRange;
   13.55 +    BOOLEAN  IsStringRange;
   13.56 +    BOOLEAN  IsDesignatorRange;
   13.57 +    BOOLEAN  IsAbsolute;
   13.58 +
   13.59 +    ULONG    Reserved[10];
   13.60 +    union {
   13.61 +        struct {
   13.62 +            USAGE    UsageMin,         UsageMax;
   13.63 +            USHORT   StringMin,        StringMax;
   13.64 +            USHORT   DesignatorMin,    DesignatorMax;
   13.65 +            USHORT   DataIndexMin,     DataIndexMax;
   13.66 +        } Range;
   13.67 +        struct  {
   13.68 +            USAGE    Usage,            Reserved1;
   13.69 +            USHORT   StringIndex,      Reserved2;
   13.70 +            USHORT   DesignatorIndex,  Reserved3;
   13.71 +            USHORT   DataIndex,        Reserved4;
   13.72 +        } NotRange;
   13.73 +    };
   13.74 +
   13.75 +} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
   13.76 +
   13.77 +typedef struct _HIDP_VALUE_CAPS
   13.78 +{
   13.79 +    USAGE    UsagePage;
   13.80 +    UCHAR    ReportID;
   13.81 +    BOOLEAN  IsAlias;
   13.82 +
   13.83 +    USHORT   BitField;
   13.84 +    USHORT   LinkCollection;   // A unique internal index pointer
   13.85 +
   13.86 +    USAGE    LinkUsage;
   13.87 +    USAGE    LinkUsagePage;
   13.88 +
   13.89 +    BOOLEAN  IsRange;
   13.90 +    BOOLEAN  IsStringRange;
   13.91 +    BOOLEAN  IsDesignatorRange;
   13.92 +    BOOLEAN  IsAbsolute;
   13.93 +
   13.94 +    BOOLEAN  HasNull;        // Does this channel have a null report   union
   13.95 +    UCHAR    Reserved;
   13.96 +    USHORT   BitSize;        // How many bits are devoted to this value?
   13.97 +
   13.98 +    USHORT   ReportCount;    // See Note below.  Usually set to 1.
   13.99 +    USHORT   Reserved2[5];
  13.100 +
  13.101 +    ULONG    UnitsExp;
  13.102 +    ULONG    Units;
  13.103 +
  13.104 +    LONG     LogicalMin,       LogicalMax;
  13.105 +    LONG     PhysicalMin,      PhysicalMax;
  13.106 +
  13.107 +    union {
  13.108 +        struct {
  13.109 +            USAGE    UsageMin,         UsageMax;
  13.110 +            USHORT   StringMin,        StringMax;
  13.111 +            USHORT   DesignatorMin,    DesignatorMax;
  13.112 +            USHORT   DataIndexMin,     DataIndexMax;
  13.113 +        } Range;
  13.114 +
  13.115 +        struct {
  13.116 +            USAGE    Usage,            Reserved1;
  13.117 +            USHORT   StringIndex,      Reserved2;
  13.118 +            USHORT   DesignatorIndex,  Reserved3;
  13.119 +            USHORT   DataIndex,        Reserved4;
  13.120 +        } NotRange;
  13.121 +    };
  13.122 +} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
  13.123 +
  13.124 +NTSTATUS __stdcall
  13.125 +HidP_GetCaps (
  13.126 +         PHIDP_PREPARSED_DATA      PreparsedData,
  13.127 +        PHIDP_CAPS                Capabilities
  13.128 +   );
  13.129 +
  13.130 +   NTSTATUS __stdcall
  13.131 +HidP_GetButtonCaps (
  13.132 +          HIDP_REPORT_TYPE     ReportType,
  13.133 +   PHIDP_BUTTON_CAPS ButtonCaps,
  13.134 +       PUSHORT              ButtonCapsLength,
  13.135 +          PHIDP_PREPARSED_DATA PreparsedData
  13.136 +);
  13.137 +
  13.138 +NTSTATUS __stdcall
  13.139 +HidP_GetValueCaps (
  13.140 +          HIDP_REPORT_TYPE     ReportType,
  13.141 +   PHIDP_VALUE_CAPS ValueCaps,
  13.142 +       PUSHORT              ValueCapsLength,
  13.143 +          PHIDP_PREPARSED_DATA PreparsedData
  13.144 +);
  13.145 +
  13.146 +NTSTATUS __stdcall
  13.147 +HidP_GetUsageValue (
  13.148 +     HIDP_REPORT_TYPE ReportType,
  13.149 +     USAGE UsagePage,
  13.150 +     USHORT LinkCollection,
  13.151 +     USAGE Usage,
  13.152 +     PULONG UsageValue,
  13.153 +     PHIDP_PREPARSED_DATA PreparsedData,
  13.154 +     PCHAR Report,
  13.155 +     ULONG ReportLength
  13.156 +    );
  13.157 +
    14.1 --- a/genUsageTableEnum.pl	Sun Mar 15 20:25:58 2015 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,106 +0,0 @@
    14.4 -#!/usr/local/bin/perl
    14.5 -#Developed by Stéphane Lenclud
    14.6 -#Generate C# enumeration from parsing Hid Usage Table
    14.7 -#See ../data/gl.h
    14.8 -#Usage example
    14.9 -#perl -S genUsageTableEnum.pl ../data/gl.h
   14.10 -
   14.11 -use strict;
   14.12 -use warnings;	
   14.13 -
   14.14 -
   14.15 -my $inputFile = $ARGV[0];
   14.16 -
   14.17 -#my $dummy="lala";
   14.18 -#$dummy=~s/(^\w)/uc($1)/e;
   14.19 -#print "$dummy";
   14.20 -#exit(0);
   14.21 -
   14.22 -#Open input file
   14.23 -open INPUT, "< $inputFile" or die "Can't read $inputFile\n";
   14.24 -my @lines = <INPUT>;
   14.25 -close INPUT;
   14.26 -
   14.27 -
   14.28 -my %hash = ();
   14.29 -
   14.30 -my $count=0;
   14.31 -foreach my $line(@lines)
   14.32 -	{
   14.33 -	#if ($line=~ /^([a-fA-FxX\d]+)(.+)\s+\w+\s+15\..*$/)	
   14.34 -	if ($line=~ /^([a-fA-FxX\d]+)(.+)\s+\w+\s+\d+\..*$/)
   14.35 -		{
   14.36 -		my $string=$2;
   14.37 -		my $value=$1;
   14.38 -		
   14.39 -		my $varName=FormatVarName($string);	
   14.40 -
   14.41 -		
   14.42 -		$hash{$string}=$value;
   14.43 -		
   14.44 -		print "$varName = 0x$value,\n";			
   14.45 -		}
   14.46 -	else
   14.47 -		{
   14.48 -		#print "NO MATCH $line\n";
   14.49 -		}
   14.50 -	}
   14.51 -
   14.52 -exit(0);	
   14.53 -	
   14.54 -#Output in sorted order	
   14.55 -for my $string ( sort keys %hash )
   14.56 -	{	
   14.57 -    #print "_S8(\"$string\"),$hash{$string}, //$count\n";
   14.58 -    print "_S8(\"$string\"),$string, //$count\n";						
   14.59 -    $count++;	
   14.60 -    }	
   14.61 -	
   14.62 -	
   14.63 -print "$count const found.\n";	
   14.64 -	
   14.65 -exit(0);
   14.66 -
   14.67 -#	
   14.68 -
   14.69 -sub FormatVarName
   14.70 -	{
   14.71 -	my $text=$_[0];	
   14.72 -	my $varName="";
   14.73 -	Trim($text);
   14.74 -	#Make sure AC ends up as AppCtrl
   14.75 -	$text=~s/(^AC)/App Ctrl/;
   14.76 -	#Make sure AL ends up as AppLaunch
   14.77 -	$text=~s/(^AL)/App Launch/;		
   14.78 -	#Replace / by white-space
   14.79 -	$text=~s/\// /g;
   14.80 -	#Replace + with Plus
   14.81 -	$text=~s/\+/Plus/g;
   14.82 -	#Replace - with white-space
   14.83 -	$text=~s/-/ /g;
   14.84 -
   14.85 -	
   14.86 -	$text=lc($text);
   14.87 -	while ($text=~/(\w+)\s+(.+)/)
   14.88 -		{		
   14.89 -		my $word=$1;
   14.90 -		$text=$2;
   14.91 -		#upper case the first letter
   14.92 -		$word=~s/(^\w)/uc($1)/e;	
   14.93 -		$varName.=$word;		
   14.94 -		}
   14.95 -	
   14.96 -	$text=~s/(^\w)/uc($1)/e;					
   14.97 -	$varName.=$text;		
   14.98 -	#get ride of -			
   14.99 -	$varName=~s/-(\w)/uc($1)/e;
  14.100 -
  14.101 -	return $varName;
  14.102 -	}
  14.103 -	
  14.104 -sub Trim
  14.105 -	{
  14.106 -	$_[0] =~ s/^\s+//; #Trim leading space and line return char
  14.107 -	$_[0] =~ s/\s+$//; #Trim trailling space and line return char
  14.108 -	}	
  14.109 -
    15.1 --- a/pinvoke-input.txt	Sun Mar 15 20:25:58 2015 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,2226 +0,0 @@
    15.4 -//
    15.5 -// SL: We use this file to generate P/Invoke using P/Invoke Interop Assistant.
    15.6 -//
    15.7 -
    15.8 -
    15.9 -typedef USHORT USAGE, *PUSAGE;
   15.10 -typedef LONG NTSTATUS;
   15.11 -
   15.12 -#define HIDP_LINK_COLLECTION_ROOT ((USHORT) -1)
   15.13 -#define HIDP_LINK_COLLECTION_UNSPECIFIED ((USHORT) 0)
   15.14 -
   15.15 -
   15.16 -typedef enum _HIDP_REPORT_TYPE
   15.17 -{
   15.18 -    HidP_Input,
   15.19 -    HidP_Output,
   15.20 -    HidP_Feature
   15.21 -} HIDP_REPORT_TYPE;
   15.22 -
   15.23 -typedef struct _USAGE_AND_PAGE
   15.24 -{
   15.25 -    USAGE Usage;
   15.26 -    USAGE UsagePage;
   15.27 -} USAGE_AND_PAGE, *PUSAGE_AND_PAGE;
   15.28 -
   15.29 -#define HidP_IsSameUsageAndPage(u1, u2) ((* (PULONG) &u1) == (* (PULONG) &u2))
   15.30 -
   15.31 -typedef struct _HIDP_BUTTON_CAPS
   15.32 -{
   15.33 -    USAGE    UsagePage;
   15.34 -    UCHAR    ReportID;
   15.35 -    BOOLEAN  IsAlias;
   15.36 -
   15.37 -    USHORT   BitField;
   15.38 -    USHORT   LinkCollection;   // A unique internal index pointer
   15.39 -
   15.40 -    USAGE    LinkUsage;
   15.41 -    USAGE    LinkUsagePage;
   15.42 -
   15.43 -    BOOLEAN  IsRange;
   15.44 -    BOOLEAN  IsStringRange;
   15.45 -    BOOLEAN  IsDesignatorRange;
   15.46 -    BOOLEAN  IsAbsolute;
   15.47 -
   15.48 -    ULONG    Reserved[10];
   15.49 -    union {
   15.50 -        struct {
   15.51 -            USAGE    UsageMin,         UsageMax;
   15.52 -            USHORT   StringMin,        StringMax;
   15.53 -            USHORT   DesignatorMin,    DesignatorMax;
   15.54 -            USHORT   DataIndexMin,     DataIndexMax;
   15.55 -        } Range;
   15.56 -        struct  {
   15.57 -            USAGE    Usage,            Reserved1;
   15.58 -            USHORT   StringIndex,      Reserved2;
   15.59 -            USHORT   DesignatorIndex,  Reserved3;
   15.60 -            USHORT   DataIndex,        Reserved4;
   15.61 -        } NotRange;
   15.62 -    };
   15.63 -
   15.64 -} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
   15.65 -
   15.66 -
   15.67 -typedef struct _HIDP_VALUE_CAPS
   15.68 -{
   15.69 -    USAGE    UsagePage;
   15.70 -    UCHAR    ReportID;
   15.71 -    BOOLEAN  IsAlias;
   15.72 -
   15.73 -    USHORT   BitField;
   15.74 -    USHORT   LinkCollection;   // A unique internal index pointer
   15.75 -
   15.76 -    USAGE    LinkUsage;
   15.77 -    USAGE    LinkUsagePage;
   15.78 -
   15.79 -    BOOLEAN  IsRange;
   15.80 -    BOOLEAN  IsStringRange;
   15.81 -    BOOLEAN  IsDesignatorRange;
   15.82 -    BOOLEAN  IsAbsolute;
   15.83 -
   15.84 -    BOOLEAN  HasNull;        // Does this channel have a null report   union
   15.85 -    UCHAR    Reserved;
   15.86 -    USHORT   BitSize;        // How many bits are devoted to this value?
   15.87 -
   15.88 -    USHORT   ReportCount;    // See Note below.  Usually set to 1.
   15.89 -    USHORT   Reserved2[5];
   15.90 -
   15.91 -    ULONG    UnitsExp;
   15.92 -    ULONG    Units;
   15.93 -
   15.94 -    LONG     LogicalMin,       LogicalMax;
   15.95 -    LONG     PhysicalMin,      PhysicalMax;
   15.96 -
   15.97 -    union {
   15.98 -        struct {
   15.99 -            USAGE    UsageMin,         UsageMax;
  15.100 -            USHORT   StringMin,        StringMax;
  15.101 -            USHORT   DesignatorMin,    DesignatorMax;
  15.102 -            USHORT   DataIndexMin,     DataIndexMax;
  15.103 -        } Range;
  15.104 -
  15.105 -        struct {
  15.106 -            USAGE    Usage,            Reserved1;
  15.107 -            USHORT   StringIndex,      Reserved2;
  15.108 -            USHORT   DesignatorIndex,  Reserved3;
  15.109 -            USHORT   DataIndex,        Reserved4;
  15.110 -        } NotRange;
  15.111 -    };
  15.112 -} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
  15.113 -
  15.114 -//
  15.115 -// Notes:
  15.116 -//
  15.117 -// ReportCount:  When a report descriptor declares an Input, Output, or
  15.118 -// Feature main item with fewer usage declarations than the report count, then
  15.119 -// the last usage applies to all remaining unspecified count in that main item.
  15.120 -// (As an example you might have data that required many fields to describe,
  15.121 -// possibly buffered bytes.)  In this case, only one value cap structure is
  15.122 -// allocated for these associtated fields, all with the same usage, and Report
  15.123 -// Count reflects the number of fields involved.  Normally ReportCount is 1.
  15.124 -// To access all of the fields in such a value structure would require using
  15.125 -// HidP_GetUsageValueArray and HidP_SetUsageValueArray.   HidP_GetUsageValue/
  15.126 -// HidP_SetScaledUsageValue will also work, however, these functions will only
  15.127 -// work with the first field of the structure.
  15.128 -//
  15.129 -
  15.130 -//
  15.131 -// The link collection tree consists of an array of LINK_COLLECTION_NODES
  15.132 -// where the index into this array is the same as the collection number.
  15.133 -//
  15.134 -// Given a collection A which contains a subcollection B, A is defined to be
  15.135 -// the parent B, and B is defined to be the child.
  15.136 -//
  15.137 -// Given collections A, B, and C where B and C are children of A, and B was
  15.138 -// encountered before C in the report descriptor, B is defined as a sibling of
  15.139 -// C.  (This implies, of course, that if B is a sibling of C, then C is NOT a
  15.140 -// sibling of B).
  15.141 -//
  15.142 -// B is defined as the NextSibling of C if and only if there exists NO
  15.143 -// child collection of A, call it D, such that B is a sibling of D and D
  15.144 -// is a sibling of C.
  15.145 -//
  15.146 -// E is defined to be the FirstChild of A if and only if for all children of A,
  15.147 -// F, that are not equivalent to E, F is a sibling of E.
  15.148 -// (This implies, of course, that the does not exist a child of A, call it G,
  15.149 -// where E is a sibling of G).  In other words the first sibling is the last
  15.150 -// link collection found in the list.
  15.151 -//
  15.152 -// In other words, if a collection B is defined within the definition of another
  15.153 -// collection A, B becomes a child of A.  All collections with the same parent
  15.154 -// are considered siblings.  The FirstChild of the parent collection, A, will be
  15.155 -// last collection defined that has A as a parent.  The order of sibling pointers
  15.156 -// is similarly determined.  When a collection B is defined, it becomes the
  15.157 -// FirstChild of it's parent collection.  The previously defined FirstChild of the
  15.158 -// parent collection becomes the NextSibling of the new collection.  As new
  15.159 -// collections with the same parent are discovered, the chain of sibling is built.
  15.160 -//
  15.161 -// With that in mind, the following describes conclusively a data structure
  15.162 -// that provides direct traversal up, down, and accross the link collection
  15.163 -// tree.
  15.164 -//
  15.165 -//
  15.166 -typedef struct _HIDP_LINK_COLLECTION_NODE
  15.167 -{
  15.168 -    USAGE    LinkUsage;
  15.169 -    USAGE    LinkUsagePage;
  15.170 -    USHORT   Parent;
  15.171 -    USHORT   NumberOfChildren;
  15.172 -    USHORT   NextSibling;
  15.173 -    USHORT   FirstChild;
  15.174 -    ULONG    CollectionType: 8;  // As defined in 6.2.2.6 of HID spec
  15.175 -    ULONG    IsAlias : 1; // This link node is an allias of the next link node.
  15.176 -    ULONG    Reserved: 23;
  15.177 -    PVOID    UserContext; // The user can hang his coat here.
  15.178 -} HIDP_LINK_COLLECTION_NODE, *PHIDP_LINK_COLLECTION_NODE;
  15.179 -
  15.180 -//
  15.181 -// When a link collection is described by a delimiter, alias link collection
  15.182 -// nodes are created.  (One for each usage within the delimiter).
  15.183 -// The parser assigns each capability description listed above only one
  15.184 -// link collection.
  15.185 -//
  15.186 -// If a control is defined within a collection defined by
  15.187 -// delimited usages, then that control is said to be within multiple link
  15.188 -// collections, one for each usage within the open and close delimiter tokens.
  15.189 -// Such multiple link collecions are said to be aliases.  The first N-1 such
  15.190 -// collections, listed in the link collection node array, have their IsAlias
  15.191 -// bit set.  The last such link collection is the link collection index used
  15.192 -// in the capabilities described above.
  15.193 -// Clients wishing to set a control in an aliased collection, should walk the
  15.194 -// collection array once for each time they see the IsAlias flag set, and use
  15.195 -// the last link collection as the index for the below accessor functions.
  15.196 -//
  15.197 -// NB: if IsAlias is set, then NextSibling should be one more than the current
  15.198 -// link collection node index.
  15.199 -//
  15.200 -
  15.201 -typedef PUCHAR  PHIDP_REPORT_DESCRIPTOR;
  15.202 -typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA;
  15.203 -
  15.204 -typedef struct _HIDP_CAPS
  15.205 -{
  15.206 -    USAGE    Usage;
  15.207 -    USAGE    UsagePage;
  15.208 -    USHORT   InputReportByteLength;
  15.209 -    USHORT   OutputReportByteLength;
  15.210 -    USHORT   FeatureReportByteLength;
  15.211 -    USHORT   Reserved[17];
  15.212 -
  15.213 -    USHORT   NumberLinkCollectionNodes;
  15.214 -
  15.215 -    USHORT   NumberInputButtonCaps;
  15.216 -    USHORT   NumberInputValueCaps;
  15.217 -    USHORT   NumberInputDataIndices;
  15.218 -
  15.219 -    USHORT   NumberOutputButtonCaps;
  15.220 -    USHORT   NumberOutputValueCaps;
  15.221 -    USHORT   NumberOutputDataIndices;
  15.222 -
  15.223 -    USHORT   NumberFeatureButtonCaps;
  15.224 -    USHORT   NumberFeatureValueCaps;
  15.225 -    USHORT   NumberFeatureDataIndices;
  15.226 -} HIDP_CAPS, *PHIDP_CAPS;
  15.227 -
  15.228 -typedef struct _HIDP_DATA
  15.229 -{
  15.230 -    USHORT  DataIndex;
  15.231 -    USHORT  Reserved;
  15.232 -    union {
  15.233 -        ULONG   RawValue; // for values
  15.234 -        BOOLEAN On; // for buttons MUST BE TRUE for buttons.
  15.235 -    };
  15.236 -} HIDP_DATA, *PHIDP_DATA;
  15.237 -//
  15.238 -// The HIDP_DATA structure is used with HidP_GetData and HidP_SetData
  15.239 -// functions.
  15.240 -//
  15.241 -// The parser contiguously assigns every control (button or value) in a hid
  15.242 -// device a unique data index from zero to NumberXXXDataIndices -1 , inclusive.
  15.243 -// This value is found in the HIDP_BUTTON_CAPS and HIDP_VALUE_CAPS structures.
  15.244 -//
  15.245 -// Most clients will find the Get/Set Buttons / Value accessor functions
  15.246 -// sufficient to their needs, as they will allow the clients to access the
  15.247 -// data known to them while ignoring the other controls.
  15.248 -//
  15.249 -// More complex clients, which actually read the Button / Value Caps, and which
  15.250 -// do a value add service to these routines (EG Direct Input), will need to
  15.251 -// access all the data in the device without interest in the individual usage
  15.252 -// or link collection location.  These are the clients that will find
  15.253 -// HidP_Data useful.
  15.254 -//
  15.255 -
  15.256 -typedef struct _HIDP_UNKNOWN_TOKEN
  15.257 -{
  15.258 -    UCHAR  Token;
  15.259 -    UCHAR  Reserved[3];
  15.260 -    ULONG  BitField;
  15.261 -} HIDP_UNKNOWN_TOKEN, *PHIDP_UNKNOWN_TOKEN;
  15.262 -
  15.263 -typedef struct _HIDP_EXTENDED_ATTRIBUTES
  15.264 -{
  15.265 -    UCHAR   NumGlobalUnknowns;
  15.266 -    UCHAR   Reserved [3];
  15.267 -    PHIDP_UNKNOWN_TOKEN  GlobalUnknowns;
  15.268 -    // ... Additional attributes
  15.269 -    ULONG   Data [1]; // variableLength  DO NOT ACCESS THIS FIELD
  15.270 -} HIDP_EXTENDED_ATTRIBUTES, *PHIDP_EXTENDED_ATTRIBUTES;
  15.271 -
  15.272 -NTSTATUS __stdcall
  15.273 -HidP_GetCaps (
  15.274 -         PHIDP_PREPARSED_DATA      PreparsedData,
  15.275 -        PHIDP_CAPS                Capabilities
  15.276 -   );
  15.277 -/*++
  15.278 -Routine Description:
  15.279 -   Returns a list of capabilities of a given hid device as described by its
  15.280 -   preparsed data.
  15.281 -
  15.282 -Arguments:
  15.283 -   PreparsedData    The preparsed data returned from HIDCLASS.
  15.284 -   Capabilities     a HIDP_CAPS structure
  15.285 -
  15.286 -Return Value:
  15.287 -   HIDP_STATUS_SUCCESS
  15.288 -   HIDP_STATUS_INVALID_PREPARSED_DATA
  15.289 ---*/
  15.290 -
  15.291 -NTSTATUS __stdcall
  15.292 -HidP_GetLinkCollectionNodes (
  15.293 -        PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
  15.294 -      PULONG                     LinkCollectionNodesLength,
  15.295 -         PHIDP_PREPARSED_DATA       PreparsedData
  15.296 -   );
  15.297 -/*++
  15.298 -Routine Description:
  15.299 -   Return a list of PHIDP_LINK_COLLECTION_NODEs used to describe the link
  15.300 -   collection tree of this hid device.  See the above description of
  15.301 -   struct _HIDP_LINK_COLLECTION_NODE.
  15.302 -
  15.303 -Arguments:
  15.304 -   LinkCollectionNodes - a caller allocated array into which
  15.305 -                 HidP_GetLinkCollectionNodes will store the information
  15.306 -
  15.307 -   LinKCollectionNodesLength - the caller sets this value to the length of the
  15.308 -                 the array in terms of number of elements.
  15.309 -                 HidP_GetLinkCollectionNodes sets this value to the actual
  15.310 -                 number of elements set. The total number of nodes required to
  15.311 -                 describe this HID device can be found in the
  15.312 -                 NumberLinkCollectionNodes field in the HIDP_CAPS structure.
  15.313 -
  15.314 ---*/
  15.315 -
  15.316 -NTSTATUS __stdcall
  15.317 -HidP_GetSpecificButtonCaps (
  15.318 -          HIDP_REPORT_TYPE     ReportType,
  15.319 -          USAGE                UsagePage,      // Optional (0 => ignore)
  15.320 -          USHORT               LinkCollection, // Optional (0 => ignore)
  15.321 -          USAGE                Usage,          // Optional (0 => ignore)
  15.322 -   PHIDP_BUTTON_CAPS    ButtonCaps,
  15.323 -     PUSHORT              ButtonCapsLength,
  15.324 -          PHIDP_PREPARSED_DATA PreparsedData
  15.325 -   );
  15.326 -/*++
  15.327 -Description:
  15.328 -   HidP_GetButtonCaps returns all the buttons (binary values) that are a part
  15.329 -   of the given report type for the Hid device represented by the given
  15.330 -   preparsed data.
  15.331 -
  15.332 -Parameters:
  15.333 -   ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  15.334 -
  15.335 -   UsagePage   A usage page value used to limit the button caps returned to
  15.336 -                those on a given usage page.  If set to 0, this parameter is
  15.337 -                ignored.  Can be used with LinkCollection and Usage parameters
  15.338 -                to further limit the number of button caps structures returned.
  15.339 -
  15.340 -   LinkCollection HIDP_LINK_COLLECTION node array index used to limit the
  15.341 -                  button caps returned to those buttons in a given link
  15.342 -                  collection.  If set to 0, this parameter is
  15.343 -                  ignored.  Can be used with UsagePage and Usage parameters
  15.344 -                  to further limit the number of button caps structures
  15.345 -                  returned.
  15.346 -
  15.347 -   Usage      A usage value used to limit the button caps returned to those
  15.348 -               with the specified usage value.  If set to 0, this parameter
  15.349 -               is ignored.  Can be used with LinkCollection and UsagePage
  15.350 -               parameters to further limit the number of button caps
  15.351 -               structures returned.
  15.352 -
  15.353 -   ButtonCaps A _HIDP_BUTTON_CAPS array containing information about all the
  15.354 -               binary values in the given report.  This buffer is provided by
  15.355 -               the caller.
  15.356 -
  15.357 -   ButtonLength   As input, this parameter specifies the length of the
  15.358 -                  ButtonCaps parameter (array) in number of array elements.
  15.359 -                  As output, this value is set to indicate how many of those
  15.360 -                  array elements were filled in by the function.  The maximum number of
  15.361 -                  button caps that can be returned is found in the HIDP_CAPS
  15.362 -                  structure.  If HIDP_STATUS_BUFFER_TOO_SMALL is returned,
  15.363 -                  this value contains the number of array elements needed to
  15.364 -                  successfully complete the request.
  15.365 -
  15.366 -   PreparsedData  The preparsed data returned from HIDCLASS.
  15.367 -
  15.368 -
  15.369 -Return Value
  15.370 -HidP_GetSpecificButtonCaps returns the following error codes:
  15.371 -  HIDP_STATUS_SUCCESS.
  15.372 -  HIDP_STATUS_INVALID_REPORT_TYPE
  15.373 -  HIDP_STATUS_INVALID_PREPARSED_DATA
  15.374 -  HIDP_STATUS_BUFFER_TOO_SMALL (all given entries however have been filled in)
  15.375 -  HIDP_STATUS_USAGE_NOT_FOUND
  15.376 ---*/
  15.377 -NTSTATUS __stdcall
  15.378 -HidP_GetButtonCaps (
  15.379 -          HIDP_REPORT_TYPE     ReportType,
  15.380 -   PHIDP_BUTTON_CAPS ButtonCaps,
  15.381 -       PUSHORT              ButtonCapsLength,
  15.382 -          PHIDP_PREPARSED_DATA PreparsedData
  15.383 -);
  15.384 -
  15.385 -NTSTATUS __stdcall
  15.386 -HidP_GetSpecificValueCaps (
  15.387 -          HIDP_REPORT_TYPE     ReportType,
  15.388 -          USAGE                UsagePage,      // Optional (0 => ignore)
  15.389 -          USHORT               LinkCollection, // Optional (0 => ignore)
  15.390 -          USAGE                Usage,          // Optional (0 => ignore)
  15.391 -          PHIDP_VALUE_CAPS     ValueCaps,
  15.392 -       PUSHORT              ValueCapsLength,
  15.393 -          PHIDP_PREPARSED_DATA PreparsedData
  15.394 -   );
  15.395 -/*++
  15.396 -Description:
  15.397 -   HidP_GetValueCaps returns all the values (non-binary) that are a part
  15.398 -   of the given report type for the Hid device represented by the given
  15.399 -   preparsed data.
  15.400 -
  15.401 -Parameters:
  15.402 -   ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  15.403 -
  15.404 -   UsagePage   A usage page value used to limit the value caps returned to
  15.405 -                those on a given usage page.  If set to 0, this parameter is
  15.406 -                ignored.  Can be used with LinkCollection and Usage parameters
  15.407 -                to further limit the number of value caps structures returned.
  15.408 -
  15.409 -   LinkCollection HIDP_LINK_COLLECTION node array index used to limit the
  15.410 -                  value caps returned to those buttons in a given link
  15.411 -                  collection.  If set to 0, this parameter is
  15.412 -                  ignored.  Can be used with UsagePage and Usage parameters
  15.413 -                  to further limit the number of value caps structures
  15.414 -                  returned.
  15.415 -
  15.416 -   Usage      A usage value used to limit the value caps returned to those
  15.417 -               with the specified usage value.  If set to 0, this parameter
  15.418 -               is ignored.  Can be used with LinkCollection and UsagePage
  15.419 -               parameters to further limit the number of value caps
  15.420 -               structures returned.
  15.421 -
  15.422 -   ValueCaps  A _HIDP_VALUE_CAPS array containing information about all the
  15.423 -               non-binary values in the given report.  This buffer is provided
  15.424 -               by the caller.
  15.425 -
  15.426 -   ValueLength   As input, this parameter specifies the length of the ValueCaps
  15.427 -                  parameter (array) in number of array elements.  As output,
  15.428 -                  this value is set to indicate how many of those array elements
  15.429 -                  were filled in by the function.  The maximum number of
  15.430 -                  value caps that can be returned is found in the HIDP_CAPS
  15.431 -                  structure.  If HIDP_STATUS_BUFFER_TOO_SMALL is returned,
  15.432 -                  this value contains the number of array elements needed to
  15.433 -                  successfully complete the request.
  15.434 -
  15.435 -   PreparsedData  The preparsed data returned from HIDCLASS.
  15.436 -
  15.437 -
  15.438 -Return Value
  15.439 -HidP_GetValueCaps returns the following error codes:
  15.440 -  HIDP_STATUS_SUCCESS.
  15.441 -  HIDP_STATUS_INVALID_REPORT_TYPE
  15.442 -  HIDP_STATUS_INVALID_PREPARSED_DATA
  15.443 -  HIDP_STATUS_BUFFER_TOO_SMALL (all given entries however have been filled in)
  15.444 -  HIDP_STATUS_USAGE_NOT_FOUND
  15.445 -
  15.446 ---*/
  15.447 -
  15.448 -NTSTATUS __stdcall
  15.449 -HidP_GetValueCaps (
  15.450 -          HIDP_REPORT_TYPE     ReportType,
  15.451 -   PHIDP_VALUE_CAPS ValueCaps,
  15.452 -       PUSHORT              ValueCapsLength,
  15.453 -          PHIDP_PREPARSED_DATA PreparsedData
  15.454 -);
  15.455 -
  15.456 -NTSTATUS __stdcall
  15.457 -HidP_GetExtendedAttributes (
  15.458 -          HIDP_REPORT_TYPE            ReportType,
  15.459 -          USHORT                      DataIndex,
  15.460 -          PHIDP_PREPARSED_DATA        PreparsedData,
  15.461 -    PHIDP_EXTENDED_ATTRIBUTES Attributes,
  15.462 -       PULONG                      LengthAttributes
  15.463 -    );
  15.464 -/*++
  15.465 -Description:
  15.466 -    Given a data index from the value or button capabilities of a given control
  15.467 -    return any extended attributes for the control if any exist.
  15.468 -
  15.469 -Parameters:
  15.470 -    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  15.471 -
  15.472 -    DataIndex   The data index for the given control, found in the capabilities
  15.473 -                structure for that control
  15.474 -
  15.475 -    PreparsedData   The preparsed data returned from HIDCLASS.
  15.476 -
  15.477 -    Attributes  Pointer to a buffer into which the extended attribute data will
  15.478 -                be copied.
  15.479 -
  15.480 -    LengthAttributes    Length of the given buffer in bytes.
  15.481 -
  15.482 -Return Value
  15.483 -    HIDP_STATUS_SUCCESS
  15.484 -    HIDP_STATUS_DATA_INDEX_NOT_FOUND
  15.485 ---*/
  15.486 -
  15.487 -NTSTATUS __stdcall
  15.488 -HidP_InitializeReportForID (
  15.489 -    HIDP_REPORT_TYPE ReportType,
  15.490 -    UCHAR ReportID,
  15.491 -    PHIDP_PREPARSED_DATA PreparsedData,
  15.492 -   PCHAR Report,
  15.493 -    ULONG ReportLength
  15.494 -   );
  15.495 -/*++
  15.496 -
  15.497 -Routine Description:
  15.498 -
  15.499 -    Initialize a report based on the given report ID.
  15.500 -
  15.501 -Parameters:
  15.502 -
  15.503 -    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  15.504 -
  15.505 -    PreparasedData  Preparsed data structure returned by HIDCLASS
  15.506 -
  15.507 -    Report      Buffer which to set the data into.
  15.508 -
  15.509 -    ReportLength Length of Report...Report should be at least as long as the
  15.510 -                value indicated in the HIDP_CAPS structure for the device and
  15.511 -                the corresponding ReportType
  15.512 -
  15.513 -Return Value
  15.514 -
  15.515 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  15.516 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  15.517 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not equal
  15.518 -                                        to the length specified in HIDP_CAPS
  15.519 -                                        structure for the given ReportType
  15.520 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  15.521 -                                        for the given ReportType
  15.522 -
  15.523 ---*/
  15.524 -
  15.525 -NTSTATUS __stdcall
  15.526 -HidP_SetData (
  15.527 -     HIDP_REPORT_TYPE ReportType,
  15.528 -    PHIDP_DATA DataList,
  15.529 -     PULONG DataLength,
  15.530 -     PHIDP_PREPARSED_DATA PreparsedData,
  15.531 -    PCHAR Report,
  15.532 -     ULONG ReportLength
  15.533 -    );
  15.534 -/*++
  15.535 -
  15.536 -Routine Description:
  15.537 -
  15.538 -    Please Note: Since usage value arrays deal with multiple fields for
  15.539 -                 for one usage value, they cannot be used with HidP_SetData
  15.540 -                 and HidP_GetData.  In this case,
  15.541 -                 HIDP_STATUS_IS_USAGE_VALUE_ARRAY will be returned.
  15.542 -
  15.543 -Parameters:
  15.544 -
  15.545 -    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  15.546 -
  15.547 -    DataList    Array of HIDP_DATA structures that contains the data values
  15.548 -                that are to be set into the given report
  15.549 -
  15.550 -    DataLength  As input, length in array elements of DataList.  As output,
  15.551 -                contains the number of data elements set on successful
  15.552 -                completion or an index into the DataList array to identify
  15.553 -                the faulting HIDP_DATA value if an error code is returned.
  15.554 -
  15.555 -    PreparasedData  Preparsed data structure returned by HIDCLASS
  15.556 -
  15.557 -    Report      Buffer which to set the data into.
  15.558 -
  15.559 -    ReportLength Length of Report...Report should be at least as long as the
  15.560 -                value indicated in the HIDP_CAPS structure for the device and
  15.561 -                the corresponding ReportType
  15.562 -
  15.563 -Return Value
  15.564 -    HidP_SetData returns the following error codes.  The report packet will
  15.565 -        have all the data set up until the HIDP_DATA structure that caused the
  15.566 -        error.  DataLength, in the error case, will return this problem index.
  15.567 -
  15.568 -  HIDP_STATUS_SUCCESS                -- upon successful insertion of all data
  15.569 -                                        into the report packet.
  15.570 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  15.571 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  15.572 -  HIDP_STATUS_DATA_INDEX_NOT_FOUND   -- if a HIDP_DATA structure referenced a
  15.573 -                                        data index that does not exist for this
  15.574 -                                        device's ReportType
  15.575 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not equal
  15.576 -                                        to the length specified in HIDP_CAPS
  15.577 -                                        structure for the given ReportType
  15.578 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  15.579 -                                        for the given ReportType
  15.580 -  HIDP_STATUS_IS_USAGE_VALUE_ARRAY   -- if one of the HIDP_DATA structures
  15.581 -                                        references a usage value array.
  15.582 -                                        DataLength will contain the index into
  15.583 -                                        the array that was invalid
  15.584 -  HIDP_STATUS_BUTTON_NOT_PRESSED     -- if a HIDP_DATA structure attempted
  15.585 -                                        to unset a button that was not already
  15.586 -                                        set in the Report
  15.587 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- a HIDP_DATA structure was found with
  15.588 -                                        a valid index value but is contained
  15.589 -                                        in a different report than the one
  15.590 -                                        currently being processed
  15.591 -  HIDP_STATUS_BUFFER_TOO_SMALL       -- if there are not enough entries in
  15.592 -                                        a given Main Array Item to report all
  15.593 -                                        buttons that have been requested to be
  15.594 -                                        set
  15.595 ---*/
  15.596 -
  15.597 -NTSTATUS __stdcall
  15.598 -HidP_GetData (
  15.599 -     HIDP_REPORT_TYPE ReportType,
  15.600 -    PHIDP_DATA DataList,
  15.601 -     PULONG DataLength,
  15.602 -     PHIDP_PREPARSED_DATA PreparsedData,
  15.603 -    PCHAR Report,
  15.604 -     ULONG ReportLength
  15.605 -    );
  15.606 -/*++
  15.607 -
  15.608 -Routine Description:
  15.609 -
  15.610 -    Please Note: For obvious reasons HidP_SetData and HidP_GetData will not
  15.611 -    access UsageValueArrays.
  15.612 -
  15.613 -Parameters:
  15.614 -    ReportType  One of HidP_Input, HidP_Output, or HidP_Feature.
  15.615 -
  15.616 -    DataList    Array of HIDP_DATA structures that will receive the data
  15.617 -                values that are set in the given report
  15.618 -
  15.619 -    DataLength  As input, length in array elements of DataList.  As output,
  15.620 -                contains the number of data elements that were successfully
  15.621 -                set by HidP_GetData.  The maximum size necessary for DataList
  15.622 -                can be determined by calling HidP_MaxDataListLength
  15.623 -
  15.624 -    PreparasedData  Preparsed data structure returned by HIDCLASS
  15.625 -
  15.626 -    Report      Buffer which to set the data into.
  15.627 -
  15.628 -    ReportLength Length of Report...Report should be at least as long as the
  15.629 -                value indicated in the HIDP_CAPS structure for the device and
  15.630 -                the corresponding ReportType
  15.631 -
  15.632 -Return Value
  15.633 -    HidP_GetData returns the following error codes.
  15.634 -
  15.635 -  HIDP_STATUS_SUCCESS                -- upon successful retrieval of all data
  15.636 -                                        from the report packet.
  15.637 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  15.638 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  15.639 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not equal
  15.640 -                                        to the length specified in HIDP_CAPS
  15.641 -                                        structure for the given ReportType
  15.642 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  15.643 -                                        for the given ReportType
  15.644 -  HIDP_STATUS_BUFFER_TOO_SMALL       -- if there are not enough array entries in
  15.645 -                                        DataList to store all the indice values
  15.646 -                                        in the given report.  DataLength will
  15.647 -                                        contain the number of array entries
  15.648 -                                        required to hold all data
  15.649 ---*/
  15.650 -
  15.651 -
  15.652 -ULONG __stdcall
  15.653 -HidP_MaxDataListLength (
  15.654 -    HIDP_REPORT_TYPE      ReportType,
  15.655 -    PHIDP_PREPARSED_DATA  PreparsedData
  15.656 -   );
  15.657 -/*++
  15.658 -Routine Description:
  15.659 -
  15.660 -    This function returns the maximum length of HIDP_DATA elements that
  15.661 -    HidP_GetData could return for the given report type.
  15.662 -
  15.663 -Parameters:
  15.664 -
  15.665 -    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
  15.666 -
  15.667 -    PreparsedData    Preparsed data structure returned by HIDCLASS
  15.668 -
  15.669 -Return Value:
  15.670 -
  15.671 -    The length of the data list array required for the HidP_GetData function
  15.672 -    call.  If an error occurs (either HIDP_STATUS_INVALID_REPORT_TYPE or
  15.673 -    HIDP_STATUS_INVALID_PREPARSED_DATA), this function returns 0.
  15.674 -
  15.675 ---*/
  15.676 -
  15.677 -#define HidP_SetButtons(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle) \
  15.678 -        HidP_SetUsages(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle)
  15.679 -
  15.680 -
  15.681 -NTSTATUS __stdcall
  15.682 -HidP_SetUsages (
  15.683 -    HIDP_REPORT_TYPE    ReportType,
  15.684 -    USAGE   UsagePage,
  15.685 -    USHORT  LinkCollection,
  15.686 -   PUSAGE  UsageList,
  15.687 -     PULONG  UsageLength,
  15.688 -    PHIDP_PREPARSED_DATA  PreparsedData,
  15.689 -   PCHAR   Report,
  15.690 -    ULONG   ReportLength 
  15.691 -   );
  15.692 -/*++
  15.693 -
  15.694 -Routine Description:
  15.695 -    This function sets binary values (buttons) in a report.  Given an
  15.696 -    initialized packet of correct length, it modifies the report packet so that
  15.697 -    each element in the given list of usages has been set in the report packet.
  15.698 -    For example, in an output report with 5 LED's, each with a given usage,
  15.699 -    an application could turn on any subset of these lights by placing their
  15.700 -    usages in any order into the usage array (UsageList).  HidP_SetUsages would,
  15.701 -    in turn, set the appropriate bit or add the corresponding byte into the
  15.702 -    HID Main Array Item.
  15.703 -
  15.704 -    A properly initialized Report packet is one of the correct byte length,
  15.705 -    and all zeros.
  15.706 -
  15.707 -    NOTE: A packet that has already been set with a call to a HidP_Set routine
  15.708 -          can also be passed in.  This routine then sets processes the UsageList
  15.709 -          in the same fashion but verifies that the ReportID already set in
  15.710 -          Report matches the report ID for the given usages.
  15.711 -
  15.712 -Parameters:
  15.713 -    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
  15.714 -
  15.715 -    UsagePage   All of the usages in the usage array, which HidP_SetUsages will
  15.716 -                set in the report, refer to this same usage page.
  15.717 -                If a client wishes to set usages in a report for multiple
  15.718 -                usage pages then that client needs to make multiple calls to
  15.719 -                HidP_SetUsages for each of the usage pages.
  15.720 -
  15.721 -    UsageList   A usage array containing the usages that HidP_SetUsages will set in
  15.722 -                the report packet.
  15.723 -
  15.724 -    UsageLength The length of the given usage array in array elements.
  15.725 -                The parser will set this value to the position in the usage
  15.726 -                array where it stopped processing.  If successful, UsageLength
  15.727 -                will be unchanged.  In any error condition, this parameter
  15.728 -                reflects how many of the usages in the usage list have
  15.729 -                actually been set by the parser.  This is useful for finding
  15.730 -                the usage in the list which caused the error.
  15.731 -
  15.732 -    PreparsedData The preparsed data recevied from HIDCLASS
  15.733 -
  15.734 -    Report      The report packet.
  15.735 -
  15.736 -    ReportLength   Length of the given report packet...Must be equal to the
  15.737 -                   value reported in the HIDP_CAPS structure for the device
  15.738 -                   and corresponding report type.
  15.739 -
  15.740 -Return Value
  15.741 -    HidP_SetUsages returns the following error codes.  On error, the report packet
  15.742 -    will be correct up until the usage element that caused the error.
  15.743 -
  15.744 -  HIDP_STATUS_SUCCESS                -- upon successful insertion of all usages
  15.745 -                                        into the report packet.
  15.746 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  15.747 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  15.748 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
  15.749 -                                        equal to the length specified in
  15.750 -                                        the HIDP_CAPS structure for the given
  15.751 -                                        ReportType
  15.752 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  15.753 -                                        for the given ReportType
  15.754 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if a usage was found that exists in a
  15.755 -                                        different report.  If the report is
  15.756 -                                        zero-initialized on entry the first
  15.757 -                                        usage in the list will determine which
  15.758 -                                        report ID is used.  Otherwise, the
  15.759 -                                        parser will verify that usage matches
  15.760 -                                        the passed in report's ID
  15.761 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage does not exist for any
  15.762 -                                        report (no matter what the report ID)
  15.763 -                                        for the given report type.
  15.764 -  HIDP_STATUS_BUFFER_TOO_SMALL       -- if there are not enough entries in a
  15.765 -                                        given Main Array Item to list all of
  15.766 -                                        the given usages.  The caller needs
  15.767 -                                        to split his request into more than
  15.768 -                                        one call
  15.769 ---*/
  15.770 -
  15.771 -#define HidP_UnsetButtons(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle) \
  15.772 -        HidP_UnsetUsages(Rty, Up, Lco, ULi, ULe, Ppd, Rep, Rle)
  15.773 -
  15.774 -
  15.775 -NTSTATUS __stdcall
  15.776 -HidP_UnsetUsages (
  15.777 -    HIDP_REPORT_TYPE      ReportType,
  15.778 -    USAGE   UsagePage,
  15.779 -   USHORT  LinkCollection,
  15.780 -   PUSAGE  UsageList,
  15.781 -     PULONG  UsageLength,
  15.782 -    PHIDP_PREPARSED_DATA  PreparsedData,
  15.783 -   PCHAR   Report,
  15.784 -    ULONG   ReportLength
  15.785 -   );
  15.786 -/*++
  15.787 -
  15.788 -Routine Description:
  15.789 -    This function unsets (turns off) binary values (buttons) in the report.  Given
  15.790 -    an initialized packet of correct length, it modifies the report packet so
  15.791 -    that each element in the given list of usages has been unset in the
  15.792 -    report packet.
  15.793 -
  15.794 -    This function is the "undo" operation for SetUsages.  If the given usage
  15.795 -    is not already set in the Report, it will return an error code of
  15.796 -    HIDP_STATUS_BUTTON_NOT_PRESSED.  If the button is pressed, HidP_UnsetUsages
  15.797 -    will unset the appropriate bit or remove the corresponding index value from
  15.798 -    the HID Main Array Item.
  15.799 -
  15.800 -    A properly initialized Report packet is one of the correct byte length,
  15.801 -    and all zeros..
  15.802 -
  15.803 -    NOTE: A packet that has already been set with a call to a HidP_Set routine
  15.804 -          can also be passed in.  This routine then processes the UsageList
  15.805 -          in the same fashion but verifies that the ReportID already set in
  15.806 -          Report matches the report ID for the given usages.
  15.807 -
  15.808 -Parameters:
  15.809 -    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
  15.810 -
  15.811 -    UsagePage   All of the usages in the usage array, which HidP_UnsetUsages will
  15.812 -                unset in the report, refer to this same usage page.
  15.813 -                If a client wishes to unset usages in a report for multiple
  15.814 -                usage pages then that client needs to make multiple calls to
  15.815 -                HidP_UnsetUsages for each of the usage pages.
  15.816 -
  15.817 -    UsageList   A usage array containing the usages that HidP_UnsetUsages will
  15.818 -                unset in the report packet.
  15.819 -
  15.820 -    UsageLength The length of the given usage array in array elements.
  15.821 -                The parser will set this value to the position in the usage
  15.822 -                array where it stopped processing.  If successful, UsageLength
  15.823 -                will be unchanged.  In any error condition, this parameter
  15.824 -                reflects how many of the usages in the usage list have
  15.825 -                actually been unset by the parser.  This is useful for finding
  15.826 -                the usage in the list which caused the error.
  15.827 -
  15.828 -    PreparsedData The preparsed data recevied from HIDCLASS
  15.829 -
  15.830 -    Report      The report packet.
  15.831 -
  15.832 -    ReportLength   Length of the given report packet...Must be equal to the
  15.833 -                   value reported in the HIDP_CAPS structure for the device
  15.834 -                   and corresponding report type.
  15.835 -
  15.836 -Return Value
  15.837 -    HidP_UnsetUsages returns the following error codes.  On error, the report
  15.838 -    packet will be correct up until the usage element that caused the error.
  15.839 -
  15.840 -  HIDP_STATUS_SUCCESS                -- upon successful "unsetting" of all usages
  15.841 -                                        in the report packet.
  15.842 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  15.843 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  15.844 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
  15.845 -                                        equal to the length specified in
  15.846 -                                        the HIDP_CAPS structure for the given
  15.847 -                                        ReportType
  15.848 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  15.849 -                                        for the given ReportType
  15.850 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if a usage was found that exists in a
  15.851 -                                        different report.  If the report is
  15.852 -                                        zero-initialized on entry the first
  15.853 -                                        usage in the list will determine which
  15.854 -                                        report ID is used.  Otherwise, the
  15.855 -                                        parser will verify that usage matches
  15.856 -                                        the passed in report's ID
  15.857 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage does not exist for any
  15.858 -                                        report (no matter what the report ID)
  15.859 -                                        for the given report type.
  15.860 -  HIDP_STATUS_BUTTON_NOT_PRESSED     -- if a usage corresponds to a button that
  15.861 -                                        is not already set in the given report
  15.862 ---*/
  15.863 -
  15.864 -#define HidP_GetButtons(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe) \
  15.865 -        HidP_GetUsages(Rty, UPa, LCo, ULi, ULe, Ppd, Rep, RLe)
  15.866 -
  15.867 -
  15.868 -NTSTATUS __stdcall
  15.869 -HidP_GetUsages (
  15.870 -    HIDP_REPORT_TYPE    ReportType,
  15.871 -    USAGE   UsagePage,
  15.872 -    USHORT  LinkCollection,
  15.873 -   PUSAGE UsageList,
  15.874 -       PULONG UsageLength,
  15.875 -    PHIDP_PREPARSED_DATA PreparsedData,
  15.876 -   PCHAR Report,
  15.877 -    ULONG   ReportLength
  15.878 -   );
  15.879 -/*++
  15.880 -
  15.881 -Routine Description:
  15.882 -    This function returns the binary values (buttons) that are set in a HID
  15.883 -    report.  Given a report packet of correct length, it searches the report
  15.884 -    packet for each usage for the given usage page and returns them in the
  15.885 -    usage list.
  15.886 -
  15.887 -Parameters:
  15.888 -    ReportType One of HidP_Input, HidP_Output or HidP_Feature.
  15.889 -
  15.890 -    UsagePage  All of the usages in the usage list, which HidP_GetUsages will
  15.891 -               retrieve in the report, refer to this same usage page.
  15.892 -               If the client wishes to get usages in a packet for multiple
  15.893 -               usage pages then that client needs to make multiple calls
  15.894 -               to HidP_GetUsages.
  15.895 -
  15.896 -    LinkCollection  An optional value which can limit which usages are returned
  15.897 -                    in the UsageList to those usages that exist in a specific
  15.898 -                    LinkCollection.  A non-zero value indicates the index into
  15.899 -                    the HIDP_LINK_COLLECITON_NODE list returned by
  15.900 -                    HidP_GetLinkCollectionNodes of the link collection the
  15.901 -                    usage should belong to.  A value of 0 indicates this
  15.902 -                    should value be ignored.
  15.903 -
  15.904 -    UsageList  The usage array that will contain all the usages found in
  15.905 -               the report packet.
  15.906 -
  15.907 -    UsageLength The length of the given usage array in array elements.
  15.908 -                On input, this value describes the length of the usage list.
  15.909 -                On output, HidP_GetUsages sets this value to the number of
  15.910 -                usages that was found.  Use HidP_MaxUsageListLength to
  15.911 -                determine the maximum length needed to return all the usages
  15.912 -                that a given report packet may contain.
  15.913 -
  15.914 -    PreparsedData Preparsed data structure returned by HIDCLASS
  15.915 -
  15.916 -    Report       The report packet.
  15.917 -
  15.918 -    ReportLength  Length (in bytes) of the given report packet
  15.919 -
  15.920 -
  15.921 -Return Value
  15.922 -    HidP_GetUsages returns the following error codes:
  15.923 -
  15.924 -  HIDP_STATUS_SUCCESS                -- upon successfully retrieving all the
  15.925 -                                        usages from the report packet
  15.926 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
  15.927 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
  15.928 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
  15.929 -                                        equal to the length specified in
  15.930 -                                        the HIDP_CAPS structure for the given
  15.931 -                                        ReportType
  15.932 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
  15.933 -                                        for the given ReportType
  15.934 -  HIDP_STATUS_BUFFER_TOO_SMALL       -- if the UsageList is not big enough to
  15.935 -                                        hold all the usages found in the report
  15.936 -                                        packet.  If this is returned, the buffer
  15.937 -                                        will contain UsageLength number of
  15.938 -                                        usages.  Use HidP_MaxUsageListLength to
  15.939 -                                        find the maximum length needed
  15.940 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if no usages were found but usages
  15.941 -                                        that match the UsagePage and
  15.942 -                                        LinkCollection specified could be found
  15.943 -                                        in a report with a different report ID
  15.944 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if there are no usages in a reports for
  15.945 -                                        the device and ReportType that match the
  15.946 -                                        UsagePage and LinkCollection that were
  15.947 -                                        specified
  15.948 ---*/
  15.949 -
  15.950 -#define HidP_GetButtonsEx(Rty, LCo, BLi, ULe, Ppd, Rep, RLe)  \
  15.951 -         HidP_GetUsagesEx(Rty, LCo, BLi, ULe, Ppd, Rep, RLe)
  15.952 -
  15.953 -NTSTATUS __stdcall
  15.954 -HidP_GetUsagesEx (
  15.955 -        HIDP_REPORT_TYPE    ReportType,
  15.956 -        USHORT  LinkCollection, // Optional
  15.957 -    PUSAGE_AND_PAGE  ButtonList,
  15.958 -       ULONG * UsageLength,
  15.959 -     PHIDP_PREPARSED_DATA PreparsedData,
  15.960 -    reads_bytes_(ReportLength)   PCHAR   Report,
  15.961 -     ULONG  ReportLength
  15.962 -   );
  15.963 -
  15.964 -/*++
  15.965 -
  15.966 -Routine Description:
  15.967 -    This function returns the binary values (buttons) in a HID report.
  15.968 -    Given a report packet of correct length, it searches the report packet
  15.969 -    for all buttons and returns the UsagePage and Usage for each of the buttons
  15.970 -    it finds.
  15.971 -
  15.972 -Parameters:
  15.973 -    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
  15.974 -
  15.975 -    LinkCollection  An optional value which can limit which usages are returned
  15.976 -                    in the ButtonList to those usages that exist in a specific
  15.977 -                    LinkCollection.  A non-zero value indicates the index into
  15.978 -                    the HIDP_LINK_COLLECITON_NODE list returned by
  15.979 -                    HidP_GetLinkCollectionNodes of the link collection the
  15.980 -                    usage should belong to.  A value of 0 indicates this
  15.981 -                    should value be ignored.
  15.982 -
  15.983 -    ButtonList  An array of USAGE_AND_PAGE structures describing all the
  15.984 -                buttons currently ``down'' in the device.
  15.985 -
  15.986 -    UsageLength The length of the given array in terms of elements.
  15.987 -                On input, this value describes the length of the list.  On
  15.988 -                output, HidP_GetUsagesEx sets this value to the number of
  15.989 -                usages that were found.  Use HidP_MaxUsageListLength to
  15.990 -                determine the maximum length needed to return all the usages
  15.991 -                that a given report packet may contain.
  15.992 -
  15.993 -    PreparsedData Preparsed data returned by HIDCLASS
  15.994 -
  15.995 -    Report       The report packet.
  15.996 -
  15.997 -    ReportLength Length (in bytes) of the given report packet.
  15.998 -
  15.999 -
 15.1000 -Return Value
 15.1001 -    HidP_GetUsagesEx returns the following error codes:
 15.1002 -
 15.1003 -  HIDP_STATUS_SUCCESS                -- upon successfully retrieving all the
 15.1004 -                                        usages from the report packet
 15.1005 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 15.1006 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 15.1007 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 15.1008 -                                        equal to the length specified in
 15.1009 -                                        the HIDP_CAPS structure for the given
 15.1010 -                                        ReportType
 15.1011 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
 15.1012 -                                        for the given ReportType
 15.1013 -  HIDP_STATUS_BUFFER_TOO_SMALL       -- if ButtonList is not big enough to
 15.1014 -                                        hold all the usages found in the report
 15.1015 -                                        packet.  If this is returned, the buffer
 15.1016 -                                        will contain UsageLength number of
 15.1017 -                                        usages.  Use HidP_MaxUsageListLength to
 15.1018 -                                        find the maximum length needed
 15.1019 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- if no usages were found but usages
 15.1020 -                                        that match the specified LinkCollection
 15.1021 -                                        exist in report with a different report
 15.1022 -                                        ID.
 15.1023 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if there are no usages in any reports that
 15.1024 -                                        match the LinkCollection parameter
 15.1025 ---*/
 15.1026 -        
 15.1027 -_IRQL_requires_max_(PASSIVE_LEVEL) 
 15.1028 -ULONG __stdcall
 15.1029 -HidP_MaxUsageListLength (
 15.1030 -    HIDP_REPORT_TYPE      ReportType,
 15.1031 -    USAGE                 UsagePage, // Optional
 15.1032 -    PHIDP_PREPARSED_DATA  PreparsedData
 15.1033 -   );
 15.1034 -/*++
 15.1035 -Routine Description:
 15.1036 -    This function returns the maximum number of usages that a call to
 15.1037 -    HidP_GetUsages or HidP_GetUsagesEx could return for a given HID report.
 15.1038 -    If calling for number of usages returned by HidP_GetUsagesEx, use 0 as
 15.1039 -    the UsagePage value.
 15.1040 -
 15.1041 -Parameters:
 15.1042 -    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
 15.1043 -
 15.1044 -    UsagePage   Specifies the optional UsagePage to query for.  If 0, will
 15.1045 -                return all the maximum number of usage values that could be
 15.1046 -                returned for a given ReportType.   If non-zero, will return
 15.1047 -                the maximum number of usages that would be returned for the
 15.1048 -                ReportType with the given UsagePage.
 15.1049 -
 15.1050 -    PreparsedData Preparsed data returned from HIDCLASS
 15.1051 -
 15.1052 -Return Value:
 15.1053 -    The length of the usage list array required for the HidP_GetUsages or
 15.1054 -    HidP_GetUsagesEx function call.  If an error occurs (such as
 15.1055 -    HIDP_STATUS_INVALID_REPORT_TYPE or HIDP_INVALID_PREPARSED_DATA, this
 15.1056 -    returns 0.
 15.1057 ---*/
 15.1058 -
 15.1059 -
 15.1060 -NTSTATUS __stdcall
 15.1061 -HidP_SetUsageValue (
 15.1062 -     HIDP_REPORT_TYPE ReportType,
 15.1063 -     USAGE UsagePage,
 15.1064 -     USHORT LinkCollection,
 15.1065 -     USAGE Usage,
 15.1066 -     ULONG UsageValue,
 15.1067 -     PHIDP_PREPARSED_DATA PreparsedData,
 15.1068 -    updates_bytes_(ReportLength) PCHAR Report,
 15.1069 -     ULONG ReportLength
 15.1070 -    );
 15.1071 -/*++
 15.1072 -Description:
 15.1073 -    HidP_SetUsageValue inserts a value into the HID Report Packet in the field
 15.1074 -    corresponding to the given usage page and usage.  HidP_SetUsageValue
 15.1075 -    casts this value to the appropriate bit length.  If a report packet
 15.1076 -    contains two different fields with the same Usage and UsagePage,
 15.1077 -    they can be distinguished with the optional LinkCollection field value.
 15.1078 -    Using this function sets the raw value into the report packet with
 15.1079 -    no checking done as to whether it actually falls within the logical
 15.1080 -    minimum/logical maximum range.  Use HidP_SetScaledUsageValue for this...
 15.1081 -
 15.1082 -    NOTE: Although the UsageValue parameter is a ULONG, any casting that is
 15.1083 -          done will preserve or sign-extend the value.  The value being set
 15.1084 -          should be considered a LONG value and will be treated as such by
 15.1085 -          this function.
 15.1086 -
 15.1087 -Parameters:
 15.1088 -
 15.1089 -    ReportType  One of HidP_Output or HidP_Feature.
 15.1090 -
 15.1091 -    UsagePage   The usage page to which the given usage refers.
 15.1092 -
 15.1093 -    LinkCollection  (Optional)  This value can be used to differentiate
 15.1094 -                                between two fields that may have the same
 15.1095 -                                UsagePage and Usage but exist in different
 15.1096 -                                collections.  If the link collection value
 15.1097 -                                is zero, this function will set the first field
 15.1098 -                                it finds that matches the usage page and
 15.1099 -                                usage.
 15.1100 -
 15.1101 -    Usage       The usage whose value HidP_SetUsageValue will set.
 15.1102 -
 15.1103 -    UsageValue  The raw value to set in the report buffer.  This value must be within
 15.1104 -                the logical range or if a NULL value this value should be the
 15.1105 -                most negative value that can be represented by the number of bits
 15.1106 -                for this field.
 15.1107 -
 15.1108 -    PreparsedData The preparsed data returned for HIDCLASS
 15.1109 -
 15.1110 -    Report      The report packet.
 15.1111 -
 15.1112 -    ReportLength Length (in bytes) of the given report packet.
 15.1113 -
 15.1114 -
 15.1115 -Return Value:
 15.1116 -    HidP_SetUsageValue returns the following error codes:
 15.1117 -
 15.1118 -  HIDP_STATUS_SUCCESS                -- upon successfully setting the value
 15.1119 -                                        in the report packet
 15.1120 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 15.1121 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 15.1122 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 15.1123 -                                        equal to the length specified in
 15.1124 -                                        the HIDP_CAPS structure for the given
 15.1125 -                                        ReportType
 15.1126 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
 15.1127 -                                        for the given ReportType
 15.1128 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 15.1129 -                                        link collection exist but exists in
 15.1130 -                                        a report with a different report ID
 15.1131 -                                        than the report being passed in.  To
 15.1132 -                                        set this value, call HidP_SetUsageValue
 15.1133 -                                        again with a zero-initizialed report
 15.1134 -                                        packet
 15.1135 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 15.1136 -                                        collection combination does not exist
 15.1137 -                                        in any reports for this ReportType
 15.1138 ---*/
 15.1139 -
 15.1140 -NTSTATUS __stdcall
 15.1141 -HidP_SetScaledUsageValue (
 15.1142 -     HIDP_REPORT_TYPE ReportType,
 15.1143 -     USAGE UsagePage,
 15.1144 -     USHORT LinkCollection,
 15.1145 -     USAGE Usage,
 15.1146 -     LONG UsageValue,
 15.1147 -     PHIDP_PREPARSED_DATA PreparsedData,
 15.1148 -    updates_bytes_(ReportLength) PCHAR Report,
 15.1149 -     ULONG ReportLength
 15.1150 -    );
 15.1151 -
 15.1152 -/*++
 15.1153 -Description:
 15.1154 -    HidP_SetScaledUsageValue inserts the UsageValue into the HID report packet
 15.1155 -    in the field corresponding to the given usage page and usage.  If a report
 15.1156 -    packet contains two different fields with the same Usage and UsagePage,
 15.1157 -    they can be distinguished with the optional LinkCollection field value.
 15.1158 -
 15.1159 -    If the specified field has a defined physical range, this function converts
 15.1160 -    the physical value specified to the corresponding logical value for the
 15.1161 -    report.  If a physical value does not exist, the function will verify that
 15.1162 -    the value specified falls within the logical range and set according.
 15.1163 -
 15.1164 -    If the range checking fails but the field has NULL values, the function will
 15.1165 -    set the field to the defined NULL value (most negative number possible) and
 15.1166 -    return HIDP_STATUS_NULL.  In other words, use this function to set NULL
 15.1167 -    values for a given field by passing in a value that falls outside the
 15.1168 -    physical range if it is defined or the logical range otherwise.
 15.1169 -
 15.1170 -    If the field does not support NULL values, an out of range error will be
 15.1171 -    returned instead.
 15.1172 -
 15.1173 -Parameters:
 15.1174 -
 15.1175 -    ReportType  One of HidP_Output or HidP_Feature.
 15.1176 -
 15.1177 -    UsagePage   The usage page to which the given usage refers.
 15.1178 -
 15.1179 -    LinkCollection  (Optional)  This value can be used to differentiate
 15.1180 -                                between two fields that may have the same
 15.1181 -                                UsagePage and Usage but exist in different
 15.1182 -                                collections.  If the link collection value
 15.1183 -                                is zero, this function will set the first field
 15.1184 -                                it finds that matches the usage page and
 15.1185 -                                usage.
 15.1186 -
 15.1187 -    Usage       The usage whose value HidP_SetScaledUsageValue will set.
 15.1188 -
 15.1189 -    UsageValue  The value to set in the report buffer.  See the routine
 15.1190 -                description above for the different interpretations of this
 15.1191 -                value
 15.1192 -
 15.1193 -    PreparsedData The preparsed data returned from HIDCLASS
 15.1194 -
 15.1195 -    Report      The report packet.
 15.1196 -
 15.1197 -    ReportLength Length (in bytes) of the given report packet.
 15.1198 -
 15.1199 -
 15.1200 -Return Value:
 15.1201 -   HidP_SetScaledUsageValue returns the following error codes:
 15.1202 -
 15.1203 -  HIDP_STATUS_SUCCESS                -- upon successfully setting the value
 15.1204 -                                        in the report packet
 15.1205 -  HIDP_STATUS_NULL                   -- upon successfully setting the value
 15.1206 -                                        in the report packet as a NULL value
 15.1207 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 15.1208 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 15.1209 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 15.1210 -                                        equal to the length specified in
 15.1211 -                                        the HIDP_CAPS structure for the given
 15.1212 -                                        ReportType
 15.1213 -  HIDP_STATUS_VALUEOF_RANGE     -- if the value specified failed to fall
 15.1214 -                                        within the physical range if it exists
 15.1215 -                                        or within the logical range otherwise
 15.1216 -                                        and the field specified by the usage
 15.1217 -                                        does not allow NULL values
 15.1218 -  HIDP_STATUS_BAD_LOG_PHY_VALUES     -- if the field has a physical range but
 15.1219 -                                        either the logical range is invalid
 15.1220 -                                        (max <= min) or the physical range is
 15.1221 -                                        invalid
 15.1222 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 15.1223 -                                        link collection exist but exists in
 15.1224 -                                        a report with a different report ID
 15.1225 -                                        than the report being passed in.  To
 15.1226 -                                        set this value, call
 15.1227 -                                        HidP_SetScaledUsageValue again with
 15.1228 -                                        a zero-initialized report packet
 15.1229 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 15.1230 -                                        collection combination does not exist
 15.1231 -                                        in any reports for this ReportType
 15.1232 ---*/
 15.1233 -
 15.1234 -NTSTATUS __stdcall
 15.1235 -HidP_SetUsageValueArray (
 15.1236 -     HIDP_REPORT_TYPE ReportType,
 15.1237 -     USAGE UsagePage,
 15.1238 -     USHORT LinkCollection,
 15.1239 -     USAGE Usage,
 15.1240 -    reads_bytes_(UsageValueByteLength) PCHAR UsageValue,
 15.1241 -     USHORT UsageValueByteLength,
 15.1242 -     PHIDP_PREPARSED_DATA PreparsedData,
 15.1243 -    updates_bytes_(ReportLength) PCHAR Report,
 15.1244 -     ULONG ReportLength
 15.1245 -    );
 15.1246 -
 15.1247 -/*++
 15.1248 -Routine Descripton:
 15.1249 -    A usage value array occurs when the last usage in the list of usages
 15.1250 -    describing a main item must be repeated because there are less usages defined
 15.1251 -    than there are report counts declared for the given main item.  In this case
 15.1252 -    a single value cap is allocated for that usage and the report count of that
 15.1253 -    value cap is set to reflect the number of fields to which that usage refers.
 15.1254 -
 15.1255 -    HidP_SetUsageValueArray sets the raw bits for that usage which spans
 15.1256 -    more than one field in a report.
 15.1257 -
 15.1258 -    NOTE: This function currently does not support value arrays where the
 15.1259 -          ReportSize for each of the fields in the array is not a multiple
 15.1260 -          of 8 bits.
 15.1261 -
 15.1262 -          The UsageValue buffer should have the values set as they would appear
 15.1263 -          in the report buffer.  If this function supported non 8-bit multiples
 15.1264 -          for the ReportSize then caller should format the input buffer so that
 15.1265 -          each new value begins at the bit immediately following the last bit
 15.1266 -          of the previous value
 15.1267 -
 15.1268 -Parameters:
 15.1269 -
 15.1270 -    ReportType  One of HidP_Output or HidP_Feature.
 15.1271 -
 15.1272 -    UsagePage   The usage page to which the given usage refers.
 15.1273 -
 15.1274 -    LinkCollection  (Optional)  This value can be used to differentiate
 15.1275 -                                between two fields that may have the same
 15.1276 -                                UsagePage and Usage but exist in different
 15.1277 -                                collections.  If the link collection value
 15.1278 -                                is zero, this function will set the first field
 15.1279 -                                it finds that matches the usage page and
 15.1280 -                                usage.
 15.1281 -
 15.1282 -    Usage       The usage whose value array HidP_SetUsageValueArray will set.
 15.1283 -
 15.1284 -    UsageValue  The buffer with the values to set into the value array.
 15.1285 -                The number of BITS required is found by multiplying the
 15.1286 -                BitSize and ReportCount fields of the Value Cap for this
 15.1287 -                control.  The least significant bit of this control found in the
 15.1288 -                given report will be placed in the least significan bit location
 15.1289 -                of the array given (little-endian format), regardless of whether
 15.1290 -                or not the field is byte alligned or if the BitSize is a multiple
 15.1291 -                of sizeof (CHAR).
 15.1292 -
 15.1293 -                See the above note for current implementation limitations.
 15.1294 -
 15.1295 -    UsageValueByteLength  Length of the UsageValue buffer (in bytes)
 15.1296 -
 15.1297 -    PreparsedData The preparsed data returned from HIDCLASS
 15.1298 -
 15.1299 -    Report      The report packet.
 15.1300 -
 15.1301 -    ReportLength Length (in bytes) of the given report packet.
 15.1302 -
 15.1303 -
 15.1304 -Return Value:
 15.1305 -  HIDP_STATUS_SUCCESS                -- upon successfully setting the value
 15.1306 -                                        array in the report packet
 15.1307 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 15.1308 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 15.1309 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 15.1310 -                                        equal to the length specified in
 15.1311 -                                        the HIDP_CAPS structure for the given
 15.1312 -                                        ReportType
 15.1313 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
 15.1314 -                                        for the given ReportType
 15.1315 -  HIDP_STATUS_NOT_VALUE_ARRAY        -- if the control specified is not a
 15.1316 -                                        value array -- a value array will have
 15.1317 -                                        a ReportCount field in the
 15.1318 -                                        HIDP_VALUE_CAPS structure that is > 1
 15.1319 -                                        Use HidP_SetUsageValue instead
 15.1320 -  HIDP_STATUS_BUFFER_TOO_SMALL       -- if the size of the passed in buffer with
 15.1321 -                                        the values to set is too small (ie. has
 15.1322 -                                        fewer values than the number of fields in
 15.1323 -                                        the array
 15.1324 -  HIDP_STATUS_NOT_IMPLEMENTED        -- if the usage value array has field sizes
 15.1325 -                                        that are not multiples of 8 bits, this
 15.1326 -                                        error code is returned since the function
 15.1327 -                                        currently does not handle setting into
 15.1328 -                                        such arrays.
 15.1329 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 15.1330 -                                        link collection exist but exists in
 15.1331 -                                        a report with a different report ID
 15.1332 -                                        than the report being passed in.  To
 15.1333 -                                        set this value, call
 15.1334 -                                        HidP_SetUsageValueArray again with
 15.1335 -                                        a zero-initialized report packet
 15.1336 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 15.1337 -                                        collection combination does not exist
 15.1338 -                                        in any reports for this ReportType
 15.1339 ---*/
 15.1340 -
 15.1341 -
 15.1342 -NTSTATUS __stdcall
 15.1343 -HidP_GetUsageValue (
 15.1344 -     HIDP_REPORT_TYPE ReportType,
 15.1345 -     USAGE UsagePage,
 15.1346 -     USHORT LinkCollection,
 15.1347 -     USAGE Usage,
 15.1348 -     PULONG UsageValue,
 15.1349 -     PHIDP_PREPARSED_DATA PreparsedData,
 15.1350 -    reads_bytes_(ReportLength) PCHAR Report,
 15.1351 -     ULONG ReportLength
 15.1352 -    );
 15.1353 -
 15.1354 -/*
 15.1355 -Description
 15.1356 -    HidP_GetUsageValue retrieves the value from the HID Report for the usage
 15.1357 -    specified by the combination of usage page, usage and link collection.
 15.1358 -    If a report packet contains two different fields with the same
 15.1359 -    Usage and UsagePage, they can be distinguished with the optional
 15.1360 -    LinkCollection field value.
 15.1361 -
 15.1362 -Parameters:
 15.1363 -
 15.1364 -    ReportType  One of HidP_Input or HidP_Feature.
 15.1365 -
 15.1366 -    UsagePage   The usage page to which the given usage refers.
 15.1367 -
 15.1368 -    LinkCollection  (Optional)  This value can be used to differentiate
 15.1369 -                                between two fields that may have the same
 15.1370 -                                UsagePage and Usage but exist in different
 15.1371 -                                collections.  If the link collection value
 15.1372 -                                is zero, this function will set the first field
 15.1373 -                                it finds that matches the usage page and
 15.1374 -                                usage.
 15.1375 -
 15.1376 -    Usage       The usage whose value HidP_GetUsageValue will retrieve
 15.1377 -
 15.1378 -    UsageValue  The raw value that is set for the specified field in the report
 15.1379 -                buffer. This value will either fall within the logical range
 15.1380 -                or if NULL values are allowed, a number outside the range to
 15.1381 -                indicate a NULL
 15.1382 -
 15.1383 -    PreparsedData The preparsed data returned for HIDCLASS
 15.1384 -
 15.1385 -    Report      The report packet.
 15.1386 -
 15.1387 -    ReportLength Length (in bytes) of the given report packet.
 15.1388 -
 15.1389 -
 15.1390 -Return Value:
 15.1391 -    HidP_GetUsageValue returns the following error codes:
 15.1392 -
 15.1393 -  HIDP_STATUS_SUCCESS                -- upon successfully retrieving the value
 15.1394 -                                        from the report packet
 15.1395 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 15.1396 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 15.1397 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 15.1398 -                                        equal to the length specified in
 15.1399 -                                        the HIDP_CAPS structure for the given
 15.1400 -                                        ReportType
 15.1401 -  HIDP_STATUS_REPORT_DOES_NOT_EXIST  -- if there are no reports on this device
 15.1402 -                                        for the given ReportType
 15.1403 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 15.1404 -                                        link collection exist but exists in
 15.1405 -                                        a report with a different report ID
 15.1406 -                                        than the report being passed in.  To
 15.1407 -                                        set this value, call HidP_GetUsageValue
 15.1408 -                                        again with a different report packet
 15.1409 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 15.1410 -                                        collection combination does not exist
 15.1411 -                                        in any reports for this ReportType
 15.1412 ---*/
 15.1413 -
 15.1414 -
 15.1415 -NTSTATUS __stdcall
 15.1416 -HidP_GetScaledUsageValue (
 15.1417 -     HIDP_REPORT_TYPE ReportType,
 15.1418 -     USAGE UsagePage,
 15.1419 -     USHORT LinkCollection,
 15.1420 -     USAGE Usage,
 15.1421 -     PLONG UsageValue,
 15.1422 -     PHIDP_PREPARSED_DATA PreparsedData,
 15.1423 -    reads_bytes_(ReportLength) PCHAR Report,
 15.1424 -     ULONG ReportLength
 15.1425 -    );
 15.1426 -
 15.1427 -/*++
 15.1428 -Description
 15.1429 -    HidP_GetScaledUsageValue retrieves a UsageValue from the HID report packet
 15.1430 -    in the field corresponding to the given usage page and usage.  If a report
 15.1431 -    packet contains two different fields with the same Usage and UsagePage,
 15.1432 -    they can be distinguished with the optional LinkCollection field value.
 15.1433 -
 15.1434 -    If the specified field has a defined physical range, this function converts
 15.1435 -    the logical value that exists in the report packet to the corresponding
 15.1436 -    physical value.  If a physical range does not exist, the function will
 15.1437 -    return the logical value.  This function will check to verify that the
 15.1438 -    logical value in the report falls within the declared logical range.
 15.1439 -
 15.1440 -    When doing the conversion between logical and physical values, this
 15.1441 -    function assumes a linear extrapolation between the physical max/min and
 15.1442 -    the logical max/min. (Where logical is the values reported by the device
 15.1443 -    and physical is the value returned by this function).  If the data field
 15.1444 -    size is less than 32 bits, then HidP_GetScaledUsageValue will sign extend
 15.1445 -    the value to 32 bits.
 15.1446 -
 15.1447 -    If the range checking fails but the field has NULL values, the function
 15.1448 -    will set UsageValue to 0 and return HIDP_STATUS_NULL.  Otherwise, it
 15.1449 -    returns a HIDP_STATUSOF_RANGE error.
 15.1450 -
 15.1451 -Parameters:
 15.1452 -
 15.1453 -    ReportType  One of HidP_Output or HidP_Feature.
 15.1454 -
 15.1455 -    UsagePage   The usage page to which the given usage refers.
 15.1456 -
 15.1457 -    LinkCollection  (Optional)  This value can be used to differentiate
 15.1458 -                                between two fields that may have the same
 15.1459 -                                UsagePage and Usage but exist in different
 15.1460 -                                collections.  If the link collection value
 15.1461 -                                is zero, this function will retrieve the first
 15.1462 -                                field it finds that matches the usage page
 15.1463 -                                and usage.
 15.1464 -
 15.1465 -    Usage       The usage whose value HidP_GetScaledUsageValue will retrieve
 15.1466 -
 15.1467 -    UsageValue  The value retrieved from the report buffer.  See the routine
 15.1468 -                description above for the different interpretations of this
 15.1469 -                value
 15.1470 -
 15.1471 -    PreparsedData The preparsed data returned from HIDCLASS
 15.1472 -
 15.1473 -    Report      The report packet.
 15.1474 -
 15.1475 -    ReportLength Length (in bytes) of the given report packet.
 15.1476 -
 15.1477 -
 15.1478 -Return Value:
 15.1479 -   HidP_GetScaledUsageValue returns the following error codes:
 15.1480 -
 15.1481 -  HIDP_STATUS_SUCCESS                -- upon successfully retrieving the value
 15.1482 -                                        from the report packet
 15.1483 -  HIDP_STATUS_NULL                   -- if the report packet had a NULL value
 15.1484 -                                        set
 15.1485 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 15.1486 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 15.1487 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 15.1488 -                                        equal to the length specified in
 15.1489 -                                        the HIDP_CAPS structure for the given
 15.1490 -                                        ReportType
 15.1491 -  HIDP_STATUS_VALUEOF_RANGE     -- if the value retrieved from the packet
 15.1492 -                                        falls outside the logical range and
 15.1493 -                                        the field does not support NULL values
 15.1494 -  HIDP_STATUS_BAD_LOG_PHY_VALUES     -- if the field has a physical range but
 15.1495 -                                        either the logical range is invalid
 15.1496 -                                        (max <= min) or the physical range is
 15.1497 -                                        invalid
 15.1498 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 15.1499 -                                        link collection exist but exists in
 15.1500 -                                        a report with a different report ID
 15.1501 -                                        than the report being passed in.  To
 15.1502 -                                        set this value, call
 15.1503 -                                        HidP_GetScaledUsageValue with a
 15.1504 -                                        different report packet
 15.1505 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 15.1506 -                                        collection combination does not exist
 15.1507 -                                        in any reports for this ReportType
 15.1508 ---*/
 15.1509 -
 15.1510 -NTSTATUS __stdcall
 15.1511 -HidP_GetUsageValueArray (
 15.1512 -     HIDP_REPORT_TYPE ReportType,
 15.1513 -     USAGE UsagePage,
 15.1514 -     USHORT LinkCollection,
 15.1515 -     USAGE Usage,
 15.1516 -    updates_bytes_(UsageValueByteLength) PCHAR UsageValue,
 15.1517 -     USHORT UsageValueByteLength,
 15.1518 -     PHIDP_PREPARSED_DATA PreparsedData,
 15.1519 -    reads_bytes_(ReportLength) PCHAR Report,
 15.1520 -     ULONG ReportLength
 15.1521 -    );
 15.1522 -
 15.1523 -/*++
 15.1524 -Routine Descripton:
 15.1525 -    A usage value array occurs when the last usage in the list of usages
 15.1526 -    describing a main item must be repeated because there are less usages defined
 15.1527 -    than there are report counts declared for the given main item.  In this case
 15.1528 -    a single value cap is allocated for that usage and the report count of that
 15.1529 -    value cap is set to reflect the number of fields to which that usage refers.
 15.1530 -
 15.1531 -    HidP_GetUsageValueArray returns the raw bits for that usage which spans
 15.1532 -    more than one field in a report.
 15.1533 -
 15.1534 -    NOTE: This function currently does not support value arrays where the
 15.1535 -          ReportSize for each of the fields in the array is not a multiple
 15.1536 -          of 8 bits.
 15.1537 -
 15.1538 -          The UsageValue buffer will have the raw values as they are set
 15.1539 -          in the report packet.
 15.1540 -
 15.1541 -Parameters:
 15.1542 -
 15.1543 -    ReportType  One of HidP_Input, HidP_Output or HidP_Feature.
 15.1544 -
 15.1545 -    UsagePage   The usage page to which the given usage refers.
 15.1546 -
 15.1547 -    LinkCollection  (Optional)  This value can be used to differentiate
 15.1548 -                                between two fields that may have the same
 15.1549 -                                UsagePage and Usage but exist in different
 15.1550 -                                collections.  If the link collection value
 15.1551 -                                is zero, this function will set the first field
 15.1552 -                                it finds that matches the usage page and
 15.1553 -                                usage.
 15.1554 -
 15.1555 -   Usage       The usage whose value HidP_GetUsageValueArray will retreive.
 15.1556 -
 15.1557 -   UsageValue  A pointer to an array of characters where the value will be
 15.1558 -               placed.  The number of BITS required is found by multiplying the
 15.1559 -               BitSize and ReportCount fields of the Value Cap for this
 15.1560 -               control.  The least significant bit of this control found in the
 15.1561 -               given report will be placed in the least significant bit location
 15.1562 -               of the buffer (little-endian format), regardless of whether
 15.1563 -               or not the field is byte aligned or if the BitSize is a multiple
 15.1564 -               of sizeof (CHAR).
 15.1565 -
 15.1566 -               See note above about current implementation limitations
 15.1567 -
 15.1568 -   UsageValueByteLength
 15.1569 -               the length of the given UsageValue buffer.
 15.1570 -
 15.1571 -   PreparsedData The preparsed data returned by the HIDCLASS
 15.1572 -
 15.1573 -   Report      The report packet.
 15.1574 -
 15.1575 -   ReportLength   Length of the given report packet.
 15.1576 -
 15.1577 -Return Value:
 15.1578 -
 15.1579 -  HIDP_STATUS_SUCCESS                -- upon successfully retrieving the value
 15.1580 -                                        from the report packet
 15.1581 -  HIDP_STATUS_INVALID_REPORT_TYPE    -- if ReportType is not valid.
 15.1582 -  HIDP_STATUS_INVALID_PREPARSED_DATA -- if PreparsedData is not valid
 15.1583 -  HIDP_STATUS_INVALID_REPORT_LENGTH  -- the length of the report packet is not
 15.1584 -                                        equal to the length specified in
 15.1585 -                                        the HIDP_CAPS structure for the given
 15.1586 -                                        ReportType
 15.1587 -  HIDP_STATUS_NOT_VALUE_ARRAY        -- if the control specified is not a
 15.1588 -                                        value array -- a value array will have
 15.1589 -                                        a ReportCount field in the
 15.1590 -                                        HIDP_VALUE_CAPS structure that is > 1
 15.1591 -                                        Use HidP_GetUsageValue instead
 15.1592 -  HIDP_STATUS_BUFFER_TOO_SMALL       -- if the size of the passed in buffer in
 15.1593 -                                        which to return the array is too small
 15.1594 -                                        (ie. has fewer values than the number of
 15.1595 -                                        fields in the array
 15.1596 -  HIDP_STATUS_NOT_IMPLEMENTED        -- if the usage value array has field sizes
 15.1597 -                                        that are not multiples of 8 bits, this
 15.1598 -                                        error code is returned since the function
 15.1599 -                                        currently does not handle getting values
 15.1600 -                                        from such arrays.
 15.1601 -  HIDP_STATUS_INCOMPATIBLE_REPORT_ID -- the specified usage page, usage and
 15.1602 -                                        link collection exist but exists in
 15.1603 -                                        a report with a different report ID
 15.1604 -                                        than the report being passed in.  To
 15.1605 -                                        set this value, call
 15.1606 -                                        HidP_GetUsageValueArray with a
 15.1607 -                                        different report packet
 15.1608 -  HIDP_STATUS_USAGE_NOT_FOUND        -- if the usage page, usage, and link
 15.1609 -                                        collection combination does not exist
 15.1610 -                                        in any reports for this ReportType
 15.1611 ---*/
 15.1612 -
 15.1613 -
 15.1614 -_IRQL_requires_max_(PASSIVE_LEVEL)
 15.1615 -NTSTATUS __stdcall
 15.1616 -HidP_UsageListDifference (
 15.1617 -   reads_(UsageListLength) PUSAGE  PreviousUsageList,
 15.1618 -   reads_(UsageListLength) PUSAGE  CurrentUsageList,
 15.1619 -   writes_(UsageListLength) PUSAGE  BreakUsageList,
 15.1620 -   writes_(UsageListLength) PUSAGE  MakeUsageList,
 15.1621 -    ULONG    UsageListLength
 15.1622 -    );
 15.1623 -/*++
 15.1624 -Routine Description:
 15.1625 -    This function will return the difference between a two lists of usages
 15.1626 -    (as might be returned from HidP_GetUsages),  In other words, it will return
 15.1627 -    return a list of usages that are in the current list but not the previous
 15.1628 -    list as well as a list of usages that are in the previous list but not
 15.1629 -    the current list.
 15.1630 -
 15.1631 -Parameters:
 15.1632 -
 15.1633 -    PreviousUsageList   The list of usages before.
 15.1634 -    CurrentUsageList    The list of usages now.
 15.1635 -    BreakUsageList      Previous - Current.
 15.1636 -    MakeUsageList       Current - Previous.
 15.1637 -    UsageListLength     Represents the length of the usage lists in array
 15.1638 -                        elements.  If comparing two lists with a differing
 15.1639 -                        number of array elements, this value should be
 15.1640 -                        the size of the larger of the two lists.  Any
 15.1641 -                        zero found with a list indicates an early termination
 15.1642 -                        of the list and any usages found after the first zero
 15.1643 -                        will be ignored.
 15.1644 ---*/
 15.1645 -
 15.1646 -
 15.1647 -_IRQL_requires_max_(PASSIVE_LEVEL)
 15.1648 -NTSTATUS __stdcall
 15.1649 -HidP_UsageAndPageListDifference (
 15.1650 -   reads_(UsageListLength) PUSAGE_AND_PAGE PreviousUsageList,
 15.1651 -   reads_(UsageListLength) PUSAGE_AND_PAGE CurrentUsageList,
 15.1652 -   writes_(UsageListLength) PUSAGE_AND_PAGE BreakUsageList,
 15.1653 -   writes_(UsageListLength) PUSAGE_AND_PAGE MakeUsageList,
 15.1654 -    ULONG           UsageListLength
 15.1655 -   );
 15.1656 -
 15.1657 -//
 15.1658 -// Produce Make or Break Codes
 15.1659 -//
 15.1660 -typedef enum _HIDP_KEYBOARD_DIRECTION {
 15.1661 -    HidP_Keyboard_Break,
 15.1662 -    HidP_Keyboard_Make
 15.1663 -} HIDP_KEYBOARD_DIRECTION;
 15.1664 -
 15.1665 -//
 15.1666 -// A bitmap of the current shift state of the keyboard when using the
 15.1667 -// below keyboard usages to i8042 translation function.
 15.1668 -//
 15.1669 -typedef struct _HIDP_KEYBOARD_MODIFIER_STATE {
 15.1670 -   union {
 15.1671 -      struct {
 15.1672 -         ULONG LeftControl: 1;
 15.1673 -         ULONG LeftShift: 1;
 15.1674 -         ULONG LeftAlt: 1;
 15.1675 -         ULONG LeftGUI: 1;
 15.1676 -         ULONG RightControl: 1;
 15.1677 -         ULONG RightShift: 1;
 15.1678 -         ULONG RightAlt: 1;
 15.1679 -         ULONG RigthGUI: 1;
 15.1680 -         ULONG CapsLock: 1;
 15.1681 -         ULONG ScollLock: 1;
 15.1682 -         ULONG NumLock: 1;
 15.1683 -         ULONG Reserved: 21;
 15.1684 -      };
 15.1685 -      ULONG ul;
 15.1686 -   };
 15.1687 -
 15.1688 -} HIDP_KEYBOARD_MODIFIER_STATE, * PHIDP_KEYBOARD_MODIFIER_STATE;
 15.1689 -
 15.1690 -//
 15.1691 -// A call back function to give the i8042 scan codes to the caller of
 15.1692 -// the below translation function.
 15.1693 -//
 15.1694 -typedef BOOLEAN (* PHIDP_INSERT_SCANCODES) (
 15.1695 -                   PVOID Context,  // Some caller supplied context.
 15.1696 -                  reads_bytes_(Length) PCHAR NewScanCodes, // A list of i8042 scan codes.
 15.1697 -                   ULONG Length // the length of the scan codes.
 15.1698 -                  );
 15.1699 -
 15.1700 -
 15.1701 -NTSTATUS __stdcall
 15.1702 -HidP_TranslateUsageAndPagesToI8042ScanCodes (
 15.1703 -    reads_(UsageListLength)     PUSAGE_AND_PAGE ChangedUsageList,
 15.1704 -         ULONG                         UsageListLength,
 15.1705 -         HIDP_KEYBOARD_DIRECTION       KeyAction,
 15.1706 -      PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
 15.1707 -         PHIDP_INSERT_SCANCODES        InsertCodesProcedure,
 15.1708 -     PVOID                         InsertCodesContext
 15.1709 -    );
 15.1710 -/*++
 15.1711 -Routine Description:
 15.1712 -Parameters:
 15.1713 ---*/
 15.1714 -
 15.1715 -NTSTATUS __stdcall
 15.1716 -HidP_TranslateUsagesToI8042ScanCodes (
 15.1717 -    reads_(UsageListLength)     PUSAGE ChangedUsageList,
 15.1718 -         ULONG                         UsageListLength,
 15.1719 -         HIDP_KEYBOARD_DIRECTION       KeyAction,
 15.1720 -      PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
 15.1721 -         PHIDP_INSERT_SCANCODES        InsertCodesProcedure,
 15.1722 -     PVOID                         InsertCodesContext
 15.1723 -    );
 15.1724 -/*++
 15.1725 -Routine Description:
 15.1726 -Parameters:
 15.1727 ---*/
 15.1728 -
 15.1729 -
 15.1730 -
 15.1731 -//
 15.1732 -// Define NT Status codes with Facility Code of FACILITY_HID_ERROR_CODE
 15.1733 -//
 15.1734 -
 15.1735 -// FACILITY_HID_ERROR_CODE defined in ntstatus.h
 15.1736 -#ifndef FACILITY_HID_ERROR_CODE
 15.1737 -#define FACILITY_HID_ERROR_CODE 0x11
 15.1738 -#endif
 15.1739 -
 15.1740 -#define HIDP_ERROR_CODES(SEV, CODE) \
 15.1741 -        ((NTSTATUS) (((SEV) << 28) | (FACILITY_HID_ERROR_CODE << 16) | (CODE)))
 15.1742 -
 15.1743 -#define HIDP_STATUS_SUCCESS                  (HIDP_ERROR_CODES(0x0,0))
 15.1744 -#define HIDP_STATUS_NULL                     (HIDP_ERROR_CODES(0x8,1))
 15.1745 -#define HIDP_STATUS_INVALID_PREPARSED_DATA   (HIDP_ERROR_CODES(0xC,1))
 15.1746 -#define HIDP_STATUS_INVALID_REPORT_TYPE      (HIDP_ERROR_CODES(0xC,2))
 15.1747 -#define HIDP_STATUS_INVALID_REPORT_LENGTH    (HIDP_ERROR_CODES(0xC,3))
 15.1748 -#define HIDP_STATUS_USAGE_NOT_FOUND          (HIDP_ERROR_CODES(0xC,4))
 15.1749 -#define HIDP_STATUS_VALUEOF_RANGE       (HIDP_ERROR_CODES(0xC,5))
 15.1750 -#define HIDP_STATUS_BAD_LOG_PHY_VALUES       (HIDP_ERROR_CODES(0xC,6))
 15.1751 -#define HIDP_STATUS_BUFFER_TOO_SMALL         (HIDP_ERROR_CODES(0xC,7))
 15.1752 -#define HIDP_STATUS_INTERNAL_ERROR           (HIDP_ERROR_CODES(0xC,8))
 15.1753 -#define HIDP_STATUS_I8042_TRANS_UNKNOWN      (HIDP_ERROR_CODES(0xC,9))
 15.1754 -#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID   (HIDP_ERROR_CODES(0xC,0xA))
 15.1755 -#define HIDP_STATUS_NOT_VALUE_ARRAY          (HIDP_ERROR_CODES(0xC,0xB))
 15.1756 -#define HIDP_STATUS_IS_VALUE_ARRAY           (HIDP_ERROR_CODES(0xC,0xC))
 15.1757 -#define HIDP_STATUS_DATA_INDEX_NOT_FOUND     (HIDP_ERROR_CODES(0xC,0xD))
 15.1758 -#define HIDP_STATUS_DATA_INDEXOF_RANGE  (HIDP_ERROR_CODES(0xC,0xE))
 15.1759 -#define HIDP_STATUS_BUTTON_NOT_PRESSED       (HIDP_ERROR_CODES(0xC,0xF))
 15.1760 -#define HIDP_STATUS_REPORT_DOES_NOT_EXIST    (HIDP_ERROR_CODES(0xC,0x10))
 15.1761 -#define HIDP_STATUS_NOT_IMPLEMENTED          (HIDP_ERROR_CODES(0xC,0x20))
 15.1762 -
 15.1763 -//
 15.1764 -// We blundered this status code.
 15.1765 -//
 15.1766 -#define HIDP_STATUS_I8242_TRANS_UNKNOWN HIDP_STATUS_I8042_TRANS_UNKNOWN
 15.1767 -
 15.1768 -/*++
 15.1769 -
 15.1770 -Copyright (c) Microsoft Corporation. All rights reserved.
 15.1771 -
 15.1772 -Module Name:
 15.1773 -
 15.1774 -    HIDSDI.H
 15.1775 -
 15.1776 -Abstract:
 15.1777 -
 15.1778 -    This module contains the PUBLIC definitions for the
 15.1779 -    code that implements the HID dll.
 15.1780 -
 15.1781 -Environment:
 15.1782 -
 15.1783 -    Kernel & user mode
 15.1784 -
 15.1785 ---*/
 15.1786 -
 15.1787 -
 15.1788 -
 15.1789 -
 15.1790 -typedef struct _HIDD_CONFIGURATION {
 15.1791 -    PVOID    cookie;
 15.1792 -    ULONG    size;
 15.1793 -    ULONG    RingBufferSize;
 15.1794 -} HIDD_CONFIGURATION, *PHIDD_CONFIGURATION;
 15.1795 -
 15.1796 -typedef struct _HIDD_ATTRIBUTES {
 15.1797 -    ULONG   Size; // = sizeof (struct _HIDD_ATTRIBUTES)
 15.1798 -
 15.1799 -    //
 15.1800 -    // Vendor ids of this hid device
 15.1801 -    //
 15.1802 -    USHORT  VendorID;
 15.1803 -    USHORT  ProductID;
 15.1804 -    USHORT  VersionNumber;
 15.1805 -
 15.1806 -    //
 15.1807 -    // Additional fields will be added to the end of this structure.
 15.1808 -    //
 15.1809 -} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
 15.1810 -
 15.1811 -
 15.1812 -BOOLEAN __stdcall
 15.1813 -HidD_GetAttributes (
 15.1814 -      HANDLE              HidDeviceObject,
 15.1815 -     PHIDD_ATTRIBUTES    Attributes
 15.1816 -    );
 15.1817 -/*++
 15.1818 -Routine Description:
 15.1819 -    Fill in the given HIDD_ATTRIBUTES structure with the attributes of the
 15.1820 -    given hid device.
 15.1821 -
 15.1822 ---*/
 15.1823 -
 15.1824 -
 15.1825 -void __stdcall
 15.1826 -HidD_GetHidGuid (
 15.1827 -     LPGUID   HidGuid
 15.1828 -   );
 15.1829 -
 15.1830 -
 15.1831 -BOOLEAN __stdcall
 15.1832 -HidD_GetPreparsedData (
 15.1833 -      HANDLE                  HidDeviceObject,
 15.1834 -    PHIDP_PREPARSED_DATA  * PreparsedData
 15.1835 -   );
 15.1836 -/*++
 15.1837 -Routine Description:
 15.1838 -    Given a handle to a valid Hid Class Device Object, retrieve the preparsed
 15.1839 -    data for the device.  This routine will allocate the appropriately 
 15.1840 -    sized buffer to hold this preparsed data.  It is up to client to call
 15.1841 -    HidP_FreePreparsedData to free the memory allocated to this structure when
 15.1842 -    it is no longer needed.
 15.1843 -
 15.1844 -Arguments:
 15.1845 -   HidDeviceObject A handle to a Hid Device that the client obtains using 
 15.1846 -                   a call to CreateFile on a valid Hid device string name.
 15.1847 -                   The string name can be obtained using standard PnP calls.
 15.1848 -
 15.1849 -   PreparsedData   An opaque data structure used by other functions in this 
 15.1850 -                   library to retrieve information about a given device.
 15.1851 -
 15.1852 -Return Value:
 15.1853 -   TRUE if successful.
 15.1854 -   FALSE otherwise  -- Use GetLastError() to get extended error information
 15.1855 ---*/
 15.1856 -BOOLEAN __stdcall
 15.1857 -HidD_FreePreparsedData (
 15.1858 -    __drv_freesMem(Mem) PHIDP_PREPARSED_DATA PreparsedData
 15.1859 -   );
 15.1860 -
 15.1861 -BOOLEAN __stdcall
 15.1862 -HidD_FlushQueue (
 15.1863 -       HANDLE                HidDeviceObject
 15.1864 -   );
 15.1865 -/*++
 15.1866 -Routine Description:
 15.1867 -    Flush the input queue for the given HID device.
 15.1868 -
 15.1869 -Arguments:
 15.1870 -   HidDeviceObject A handle to a Hid Device that the client obtains using 
 15.1871 -                   a call to CreateFile on a valid Hid device string name.
 15.1872 -                   The string name can be obtained using standard PnP calls.
 15.1873 -
 15.1874 -Return Value:
 15.1875 -   TRUE if successful
 15.1876 -   FALSE otherwise  -- Use GetLastError() to get extended error information
 15.1877 ---*/
 15.1878 -
 15.1879 -BOOLEAN __stdcall
 15.1880 -HidD_GetConfiguration (
 15.1881 -      HANDLE               HidDeviceObject,
 15.1882 -   PHIDD_CONFIGURATION Configuration,
 15.1883 -      ULONG                ConfigurationLength
 15.1884 -   );
 15.1885 -/*++
 15.1886 -Routine Description:
 15.1887 -    Get the configuration information for this Hid device
 15.1888 -
 15.1889 -Arguments:
 15.1890 -   HidDeviceObject      A handle to a Hid Device Object.
 15.1891 -
 15.1892 -   Configuration        A configuration structure.  HidD_GetConfiguration MUST
 15.1893 -                        be called before the configuration can be modified and
 15.1894 -                        set using HidD_SetConfiguration
 15.1895 -
 15.1896 -   ConfigurationLength  That is ``sizeof (HIDD_CONFIGURATION)''. Using this
 15.1897 -                        parameter, we can later increase the length of the 
 15.1898 -                        configuration array and not break older apps.
 15.1899 -
 15.1900 -Return Value:
 15.1901 -   TRUE if successful
 15.1902 -   FALSE otherwise  -- Use GetLastError() to get extended error information
 15.1903 ---*/
 15.1904 -
 15.1905 -BOOLEAN __stdcall
 15.1906 -HidD_SetConfiguration (
 15.1907 -      HANDLE               HidDeviceObject,
 15.1908 -   reads_bytes_(ConfigurationLength) PHIDD_CONFIGURATION Configuration,
 15.1909 -      ULONG                ConfigurationLength
 15.1910 -   );
 15.1911 -/*++
 15.1912 -Routine Description:
 15.1913 -   Set the configuration information for this Hid device...
 15.1914 -   
 15.1915 -   NOTE: HidD_GetConfiguration must be called to retrieve the current 
 15.1916 -         configuration information before this information can be modified 
 15.1917 -         and set.
 15.1918 -
 15.1919 -Arguments:
 15.1920 -    HidDeviceObject      A handle to a Hid Device Object.
 15.1921 - 
 15.1922 -    Configuration        A configuration structure.  HidD_GetConfiguration MUST
 15.1923 -                         be called before the configuration can be modified and
 15.1924 -                         set using HidD_SetConfiguration
 15.1925 - 
 15.1926 -    ConfigurationLength  That is ``sizeof (HIDD_CONFIGURATION)''. Using this
 15.1927 -                         parameter, we can later increase the length of the 
 15.1928 -                         configuration array and not break older apps.
 15.1929 -
 15.1930 -Return Value:
 15.1931 -    TRUE if successful
 15.1932 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.1933 ---*/
 15.1934 -
 15.1935 -BOOLEAN __stdcall
 15.1936 -HidD_GetFeature (
 15.1937 -       HANDLE   HidDeviceObject,
 15.1938 -   PVOID ReportBuffer,
 15.1939 -       ULONG    ReportBufferLength
 15.1940 -   );
 15.1941 -/*++
 15.1942 -Routine Description:
 15.1943 -    Retrieve a feature report from a HID device.
 15.1944 -
 15.1945 -Arguments:
 15.1946 -    HidDeviceObject      A handle to a Hid Device Object.
 15.1947 - 
 15.1948 -    ReportBuffer         The buffer that the feature report should be placed 
 15.1949 -                         into.  The first byte of the buffer should be set to
 15.1950 -                         the report ID of the desired report
 15.1951 - 
 15.1952 -    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
 15.1953 -                         should be greater than or equal to the 
 15.1954 -                         FeatureReportByteLength field as specified in the 
 15.1955 -                         HIDP_CAPS structure for the device
 15.1956 -Return Value:
 15.1957 -    TRUE if successful
 15.1958 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.1959 ---*/
 15.1960 -
 15.1961 -BOOLEAN __stdcall
 15.1962 -HidD_SetFeature (
 15.1963 -       HANDLE   HidDeviceObject,
 15.1964 -   reads_bytes_(ReportBufferLength) PVOID ReportBuffer,
 15.1965 -       ULONG    ReportBufferLength
 15.1966 -   );
 15.1967 -/*++
 15.1968 -Routine Description:
 15.1969 -    Send a feature report to a HID device.
 15.1970 -
 15.1971 -Arguments:
 15.1972 -    HidDeviceObject      A handle to a Hid Device Object.
 15.1973 - 
 15.1974 -    ReportBuffer         The buffer of the feature report to send to the device
 15.1975 - 
 15.1976 -    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
 15.1977 -                         should be greater than or equal to the 
 15.1978 -                         FeatureReportByteLength field as specified in the 
 15.1979 -                         HIDP_CAPS structure for the device
 15.1980 -Return Value:
 15.1981 -    TRUE if successful
 15.1982 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.1983 ---*/
 15.1984 -
 15.1985 -
 15.1986 -
 15.1987 -BOOLEAN __stdcall
 15.1988 -HidD_GetInputReport (
 15.1989 -       HANDLE   HidDeviceObject,
 15.1990 -   PVOID ReportBuffer,
 15.1991 -       ULONG    ReportBufferLength
 15.1992 -   );
 15.1993 -/*++
 15.1994 -Routine Description:
 15.1995 -    Retrieve an input report from a HID device.
 15.1996 -
 15.1997 -Arguments:
 15.1998 -    HidDeviceObject      A handle to a Hid Device Object.
 15.1999 - 
 15.2000 -    ReportBuffer         The buffer that the input report should be placed 
 15.2001 -                         into.  The first byte of the buffer should be set to
 15.2002 -                         the report ID of the desired report
 15.2003 - 
 15.2004 -    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
 15.2005 -                         should be greater than or equal to the 
 15.2006 -                         InputReportByteLength field as specified in the 
 15.2007 -                         HIDP_CAPS structure for the device
 15.2008 -Return Value:
 15.2009 -    TRUE if successful
 15.2010 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2011 ---*/
 15.2012 -
 15.2013 -BOOLEAN __stdcall
 15.2014 -HidD_SetOutputReport (
 15.2015 -       HANDLE   HidDeviceObject,
 15.2016 -   reads_bytes_(ReportBufferLength) PVOID ReportBuffer,
 15.2017 -       ULONG    ReportBufferLength
 15.2018 -   );
 15.2019 -/*++
 15.2020 -Routine Description:
 15.2021 -    Send an output report to a HID device.
 15.2022 -
 15.2023 -Arguments:
 15.2024 -    HidDeviceObject      A handle to a Hid Device Object.
 15.2025 - 
 15.2026 -    ReportBuffer         The buffer of the output report to send to the device
 15.2027 - 
 15.2028 -    ReportBufferLength   The size (in bytes) of ReportBuffer.  This value 
 15.2029 -                         should be greater than or equal to the 
 15.2030 -                         OutputReportByteLength field as specified in the 
 15.2031 -                         HIDP_CAPS structure for the device
 15.2032 -Return Value:
 15.2033 -    TRUE if successful
 15.2034 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2035 ---*/
 15.2036 -
 15.2037 -#endif
 15.2038 -
 15.2039 -BOOLEAN __stdcall
 15.2040 -HidD_GetNumInputBuffers (
 15.2041 -      HANDLE  HidDeviceObject,
 15.2042 -     PULONG  NumberBuffers
 15.2043 -    );
 15.2044 -/*++
 15.2045 -Routine Description:
 15.2046 -    This function returns the number of input buffers used by the specified
 15.2047 -    file handle to the Hid device.  Each file object has a number of buffers
 15.2048 -    associated with it to queue reports read from the device but which have
 15.2049 -    not yet been read by the user-mode app with a handle to that device.
 15.2050 -
 15.2051 -Arguments:
 15.2052 -    HidDeviceObject      A handle to a Hid Device Object.
 15.2053 - 
 15.2054 -    NumberBuffers        Number of buffers currently being used for this file
 15.2055 -                         handle to the Hid device
 15.2056 -
 15.2057 -Return Value:
 15.2058 -    TRUE if successful
 15.2059 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2060 ---*/
 15.2061 -
 15.2062 -BOOLEAN __stdcall
 15.2063 -HidD_SetNumInputBuffers (
 15.2064 -     HANDLE HidDeviceObject,
 15.2065 -     ULONG  NumberBuffers
 15.2066 -    );
 15.2067 -/*++
 15.2068 -
 15.2069 -Routine Description:
 15.2070 -    This function sets the number of input buffers used by the specified
 15.2071 -    file handle to the Hid device.  Each file object has a number of buffers
 15.2072 -    associated with it to queue reports read from the device but which have
 15.2073 -    not yet been read by the user-mode app with a handle to that device.
 15.2074 -
 15.2075 -Arguments:
 15.2076 -    HidDeviceObject      A handle to a Hid Device Object.
 15.2077 - 
 15.2078 -    NumberBuffers        New number of buffers to use for this file handle to
 15.2079 -                         the Hid device
 15.2080 -
 15.2081 -Return Value:
 15.2082 -    TRUE if successful
 15.2083 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2084 ---*/
 15.2085 -
 15.2086 -BOOLEAN __stdcall
 15.2087 -HidD_GetPhysicalDescriptor (
 15.2088 -       HANDLE   HidDeviceObject,
 15.2089 -   PVOID Buffer,
 15.2090 -       ULONG    BufferLength
 15.2091 -   );
 15.2092 -/*++
 15.2093 -Routine Description:
 15.2094 -    This function retrieves the raw physical descriptor for the specified
 15.2095 -    Hid device.  
 15.2096 -
 15.2097 -Arguments:
 15.2098 -    HidDeviceObject      A handle to a Hid Device Object.
 15.2099 - 
 15.2100 -    Buffer               Buffer which on return will contain the physical
 15.2101 -                         descriptor if one exists for the specified device
 15.2102 -                         handle
 15.2103 -
 15.2104 -    BufferLength         Length of buffer (in bytes)
 15.2105 -
 15.2106 -
 15.2107 -Return Value:
 15.2108 -    TRUE if successful
 15.2109 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2110 ---*/
 15.2111 -
 15.2112 -BOOLEAN __stdcall
 15.2113 -HidD_GetManufacturerString (
 15.2114 -       HANDLE   HidDeviceObject,
 15.2115 -   PVOID Buffer,
 15.2116 -       ULONG    BufferLength
 15.2117 -   );
 15.2118 -/*++
 15.2119 -Routine Description:
 15.2120 -    This function retrieves the manufacturer string from the specified 
 15.2121 -    Hid device.  
 15.2122 -
 15.2123 -Arguments:
 15.2124 -    HidDeviceObject      A handle to a Hid Device Object.
 15.2125 - 
 15.2126 -    Buffer               Buffer which on return will contain the manufacturer
 15.2127 -                         string returned from the device.  This string is a 
 15.2128 -                         wide-character string
 15.2129 -
 15.2130 -    BufferLength         Length of Buffer (in bytes)
 15.2131 -
 15.2132 -
 15.2133 -Return Value:
 15.2134 -    TRUE if successful
 15.2135 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2136 ---*/
 15.2137 -
 15.2138 -BOOLEAN __stdcall
 15.2139 -HidD_GetProductString (
 15.2140 -       HANDLE   HidDeviceObject,
 15.2141 -   PVOID Buffer,
 15.2142 -       ULONG    BufferLength
 15.2143 -   );
 15.2144 -/*++
 15.2145 -Routine Description:
 15.2146 -    This function retrieves the product string from the specified 
 15.2147 -    Hid device.  
 15.2148 -
 15.2149 -Arguments:
 15.2150 -    HidDeviceObject      A handle to a Hid Device Object.
 15.2151 - 
 15.2152 -    Buffer               Buffer which on return will contain the product
 15.2153 -                         string returned from the device.  This string is a 
 15.2154 -                         wide-character string
 15.2155 -
 15.2156 -    BufferLength         Length of Buffer (in bytes)
 15.2157 -
 15.2158 -
 15.2159 -Return Value:
 15.2160 -    TRUE if successful
 15.2161 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2162 ---*/
 15.2163 -
 15.2164 -BOOLEAN __stdcall
 15.2165 -HidD_GetIndexedString (
 15.2166 -       HANDLE   HidDeviceObject,
 15.2167 -       ULONG    StringIndex,
 15.2168 -   PVOID Buffer,
 15.2169 -       ULONG    BufferLength
 15.2170 -   );
 15.2171 -/*++
 15.2172 -Routine Description:
 15.2173 -    This function retrieves a string from the specified Hid device that is
 15.2174 -    specified with a certain string index.
 15.2175 -
 15.2176 -Arguments:
 15.2177 -    HidDeviceObject      A handle to a Hid Device Object.
 15.2178 - 
 15.2179 -    StringIndex          Index of the string to retrieve
 15.2180 -
 15.2181 -    Buffer               Buffer which on return will contain the product
 15.2182 -                         string returned from the device.  This string is a 
 15.2183 -                         wide-character string
 15.2184 -
 15.2185 -    BufferLength         Length of Buffer (in bytes)
 15.2186 -
 15.2187 -Return Value:
 15.2188 -    TRUE if successful
 15.2189 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2190 ---*/
 15.2191 -
 15.2192 -BOOLEAN __stdcall
 15.2193 -HidD_GetSerialNumberString (
 15.2194 -       HANDLE   HidDeviceObject,
 15.2195 -   PVOID Buffer,
 15.2196 -       ULONG    BufferLength
 15.2197 -   );
 15.2198 -/*++
 15.2199 -Routine Description:
 15.2200 -    This function retrieves the serial number string from the specified 
 15.2201 -    Hid device.  
 15.2202 -
 15.2203 -Arguments:
 15.2204 -    HidDeviceObject      A handle to a Hid Device Object.
 15.2205 - 
 15.2206 -    Buffer               Buffer which on return will contain the serial number
 15.2207 -                         string returned from the device.  This string is a 
 15.2208 -                         wide-character string
 15.2209 -
 15.2210 -    BufferLength         Length of Buffer (in bytes)
 15.2211 -
 15.2212 -Return Value:
 15.2213 -    TRUE if successful
 15.2214 -    FALSE otherwise  -- Use GetLastError() to get extended error information
 15.2215 ---*/
 15.2216 -
 15.2217 -
 15.2218 -
 15.2219 -BOOLEAN __stdcall
 15.2220 -HidD_GetMsGenreDescriptor (
 15.2221 -       HANDLE   HidDeviceObject,
 15.2222 -   PVOID Buffer,
 15.2223 -       ULONG    BufferLength
 15.2224 -   );
 15.2225 -
 15.2226 -
 15.2227 -
 15.2228 -
 15.2229 -
    16.1 --- a/pinvoke-interop-assistant-input.c	Sun Mar 15 20:25:58 2015 +0100
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,154 +0,0 @@
    16.4 -
    16.5 -typedef USHORT USAGE, *PUSAGE;
    16.6 -typedef LONG NTSTATUS;
    16.7 -
    16.8 -typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA;
    16.9 -
   16.10 -typedef enum _HIDP_REPORT_TYPE
   16.11 -{
   16.12 -    HidP_Input,
   16.13 -    HidP_Output,
   16.14 -    HidP_Feature
   16.15 -} HIDP_REPORT_TYPE;
   16.16 -
   16.17 -typedef struct _HIDP_CAPS
   16.18 -{
   16.19 -    USAGE    Usage;
   16.20 -    USAGE    UsagePage;
   16.21 -    USHORT   InputReportByteLength;
   16.22 -    USHORT   OutputReportByteLength;
   16.23 -    USHORT   FeatureReportByteLength;
   16.24 -    USHORT   Reserved[17];
   16.25 -
   16.26 -    USHORT   NumberLinkCollectionNodes;
   16.27 -
   16.28 -    USHORT   NumberInputButtonCaps;
   16.29 -    USHORT   NumberInputValueCaps;
   16.30 -    USHORT   NumberInputDataIndices;
   16.31 -
   16.32 -    USHORT   NumberOutputButtonCaps;
   16.33 -    USHORT   NumberOutputValueCaps;
   16.34 -    USHORT   NumberOutputDataIndices;
   16.35 -
   16.36 -    USHORT   NumberFeatureButtonCaps;
   16.37 -    USHORT   NumberFeatureValueCaps;
   16.38 -    USHORT   NumberFeatureDataIndices;
   16.39 -} HIDP_CAPS, *PHIDP_CAPS;
   16.40 -
   16.41 -
   16.42 -typedef struct _HIDP_BUTTON_CAPS
   16.43 -{
   16.44 -    USAGE    UsagePage;
   16.45 -    UCHAR    ReportID;
   16.46 -    BOOLEAN  IsAlias;
   16.47 -
   16.48 -    USHORT   BitField;
   16.49 -    USHORT   LinkCollection;   // A unique internal index pointer
   16.50 -
   16.51 -    USAGE    LinkUsage;
   16.52 -    USAGE    LinkUsagePage;
   16.53 -
   16.54 -    BOOLEAN  IsRange;
   16.55 -    BOOLEAN  IsStringRange;
   16.56 -    BOOLEAN  IsDesignatorRange;
   16.57 -    BOOLEAN  IsAbsolute;
   16.58 -
   16.59 -    ULONG    Reserved[10];
   16.60 -    union {
   16.61 -        struct {
   16.62 -            USAGE    UsageMin,         UsageMax;
   16.63 -            USHORT   StringMin,        StringMax;
   16.64 -            USHORT   DesignatorMin,    DesignatorMax;
   16.65 -            USHORT   DataIndexMin,     DataIndexMax;
   16.66 -        } Range;
   16.67 -        struct  {
   16.68 -            USAGE    Usage,            Reserved1;
   16.69 -            USHORT   StringIndex,      Reserved2;
   16.70 -            USHORT   DesignatorIndex,  Reserved3;
   16.71 -            USHORT   DataIndex,        Reserved4;
   16.72 -        } NotRange;
   16.73 -    };
   16.74 -
   16.75 -} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
   16.76 -
   16.77 -typedef struct _HIDP_VALUE_CAPS
   16.78 -{
   16.79 -    USAGE    UsagePage;
   16.80 -    UCHAR    ReportID;
   16.81 -    BOOLEAN  IsAlias;
   16.82 -
   16.83 -    USHORT   BitField;
   16.84 -    USHORT   LinkCollection;   // A unique internal index pointer
   16.85 -
   16.86 -    USAGE    LinkUsage;
   16.87 -    USAGE    LinkUsagePage;
   16.88 -
   16.89 -    BOOLEAN  IsRange;
   16.90 -    BOOLEAN  IsStringRange;
   16.91 -    BOOLEAN  IsDesignatorRange;
   16.92 -    BOOLEAN  IsAbsolute;
   16.93 -
   16.94 -    BOOLEAN  HasNull;        // Does this channel have a null report   union
   16.95 -    UCHAR    Reserved;
   16.96 -    USHORT   BitSize;        // How many bits are devoted to this value?
   16.97 -
   16.98 -    USHORT   ReportCount;    // See Note below.  Usually set to 1.
   16.99 -    USHORT   Reserved2[5];
  16.100 -
  16.101 -    ULONG    UnitsExp;
  16.102 -    ULONG    Units;
  16.103 -
  16.104 -    LONG     LogicalMin,       LogicalMax;
  16.105 -    LONG     PhysicalMin,      PhysicalMax;
  16.106 -
  16.107 -    union {
  16.108 -        struct {
  16.109 -            USAGE    UsageMin,         UsageMax;
  16.110 -            USHORT   StringMin,        StringMax;
  16.111 -            USHORT   DesignatorMin,    DesignatorMax;
  16.112 -            USHORT   DataIndexMin,     DataIndexMax;
  16.113 -        } Range;
  16.114 -
  16.115 -        struct {
  16.116 -            USAGE    Usage,            Reserved1;
  16.117 -            USHORT   StringIndex,      Reserved2;
  16.118 -            USHORT   DesignatorIndex,  Reserved3;
  16.119 -            USHORT   DataIndex,        Reserved4;
  16.120 -        } NotRange;
  16.121 -    };
  16.122 -} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
  16.123 -
  16.124 -NTSTATUS __stdcall
  16.125 -HidP_GetCaps (
  16.126 -         PHIDP_PREPARSED_DATA      PreparsedData,
  16.127 -        PHIDP_CAPS                Capabilities
  16.128 -   );
  16.129 -
  16.130 -   NTSTATUS __stdcall
  16.131 -HidP_GetButtonCaps (
  16.132 -          HIDP_REPORT_TYPE     ReportType,
  16.133 -   PHIDP_BUTTON_CAPS ButtonCaps,
  16.134 -       PUSHORT              ButtonCapsLength,
  16.135 -          PHIDP_PREPARSED_DATA PreparsedData
  16.136 -);
  16.137 -
  16.138 -NTSTATUS __stdcall
  16.139 -HidP_GetValueCaps (
  16.140 -          HIDP_REPORT_TYPE     ReportType,
  16.141 -   PHIDP_VALUE_CAPS ValueCaps,
  16.142 -       PUSHORT              ValueCapsLength,
  16.143 -          PHIDP_PREPARSED_DATA PreparsedData
  16.144 -);
  16.145 -
  16.146 -NTSTATUS __stdcall
  16.147 -HidP_GetUsageValue (
  16.148 -     HIDP_REPORT_TYPE ReportType,
  16.149 -     USAGE UsagePage,
  16.150 -     USHORT LinkCollection,
  16.151 -     USAGE Usage,
  16.152 -     PULONG UsageValue,
  16.153 -     PHIDP_PREPARSED_DATA PreparsedData,
  16.154 -     PCHAR Report,
  16.155 -     ULONG ReportLength
  16.156 -    );
  16.157 -