summaryrefslogtreecommitdiff
path: root/hid/hclient
diff options
context:
space:
mode:
authorBarry Golden <[email protected]>2015-08-06 20:06:07 -0700
committerBarry Golden <[email protected]>2015-08-06 20:06:07 -0700
commit9026073a419b5ef68fb46d4f7fae52dbef09dbe1 (patch)
treeb81f73f650af9ac82a7e8739e989456f6e192b37 /hid/hclient
parentbd17fd844b4f074821b9d4c7bc86b9dc7f0e4a59 (diff)
Remove obsolete readme.htm files
Diffstat (limited to 'hid/hclient')
-rw-r--r--hid/hclient/hclient.htm775
1 files changed, 0 insertions, 775 deletions
diff --git a/hid/hclient/hclient.htm b/hid/hclient/hclient.htm
deleted file mode 100644
index de1fa7b6..00000000
--- a/hid/hclient/hclient.htm
+++ /dev/null
@@ -1,775 +0,0 @@
-<html xmlns:v="urn:schemas-microsoft-com:vml"
-xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 11">
-<meta name=Originator content="Microsoft Word 11">
-<link rel=File-List href="hclient_files/filelist.xml">
-<title>HCLIENT</title>
-<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
- name="State"/>
-<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
- name="City"/>
-<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
- name="place"/>
-<!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:SpellingState>Clean</w:SpellingState>
- <w:GrammarState>Clean</w:GrammarState>
- <w:ValidateAgainstSchemas/>
- <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
- <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
- <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
- <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
- </w:WordDocument>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
- </w:LatentStyles>
-</xml><![endif]--><!--[if !mso]><object
- classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
-<style>
-st1\:*{behavior:url(#ieooui) }
-</style>
-<![endif]-->
-<style>
-<!--
- /* Font Definitions */
- @font-face
- {font-family:Courier;
- panose-1:2 7 4 9 2 2 5 2 4 4;
- mso-font-charset:0;
- mso-generic-font-family:modern;
- mso-font-format:other;
- mso-font-pitch:fixed;
- mso-font-signature:3 0 0 0 1 0;}
-@font-face
- {font-family:Wingdings;
- panose-1:5 0 0 0 0 0 0 0 0 0;
- mso-font-charset:2;
- mso-generic-font-family:auto;
- mso-font-pitch:variable;
- mso-font-signature:0 268435456 0 0 -2147483648 0;}
-@font-face
- {font-family:Verdana;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:536871559 0 0 0 415 0;}
-@font-face
- {font-family:"MS Sans Serif";
- panose-1:0 0 0 0 0 0 0 0 0 0;
- mso-font-alt:"Times New Roman";
- mso-font-charset:0;
- mso-generic-font-family:roman;
- mso-font-format:other;
- mso-font-pitch:auto;
- mso-font-signature:0 0 0 0 0 0;}
- /* Style Definitions */
- p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-h2
- {mso-margin-top-alt:auto;
- margin-right:0in;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- mso-outline-level:2;
- font-size:18.0pt;
- font-family:"Times New Roman";
- font-weight:bold;}
-h3
- {mso-margin-top-alt:auto;
- margin-right:0in;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- mso-outline-level:3;
- font-size:13.5pt;
- font-family:"Times New Roman";
- font-weight:bold;}
-h4
- {mso-margin-top-alt:auto;
- margin-right:0in;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- mso-outline-level:4;
- font-size:12.0pt;
- font-family:"Times New Roman";
- font-weight:bold;}
-a:link, span.MsoHyperlink
- {color:blue;
- text-decoration:underline;
- text-underline:single;}
-a:visited, span.MsoHyperlinkFollowed
- {color:purple;
- text-decoration:underline;
- text-underline:single;}
-p
- {mso-margin-top-alt:auto;
- margin-right:0in;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-pre
- {margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
- font-size:10.0pt;
- font-family:"Courier New";
- mso-fareast-font-family:"Times New Roman";}
-span.SpellE
- {mso-style-name:"";
- mso-spl-e:yes;}
-span.GramE
- {mso-style-name:"";
- mso-gram-e:yes;}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
- /* List Definitions */
- @list l0
- {mso-list-id:338625954;
- mso-list-template-ids:-1497861504;}
-@list l0:level1
- {mso-level-number-format:bullet;
- mso-level-text:\F0B7;
- mso-level-tab-stop:.5in;
- mso-level-number-position:left;
- text-indent:-.25in;
- mso-ansi-font-size:10.0pt;
- font-family:Symbol;}
-@list l1
- {mso-list-id:361787635;
- mso-list-template-ids:-756894292;}
-@list l1:level1
- {mso-level-number-format:bullet;
- mso-level-text:\F0B7;
- mso-level-tab-stop:.5in;
- mso-level-number-position:left;
- text-indent:-.25in;
- mso-ansi-font-size:10.0pt;
- font-family:Symbol;}
-@list l2
- {mso-list-id:517618851;
- mso-list-template-ids:-711566768;}
-@list l2:level1
- {mso-level-number-format:bullet;
- mso-level-text:\F0B7;
- mso-level-tab-stop:.5in;
- mso-level-number-position:left;
- text-indent:-.25in;
- mso-ansi-font-size:10.0pt;
- font-family:Symbol;}
-@list l3
- {mso-list-id:1205487990;
- mso-list-template-ids:-543120596;}
-@list l3:level1
- {mso-level-number-format:bullet;
- mso-level-text:\F0B7;
- mso-level-tab-stop:.5in;
- mso-level-number-position:left;
- text-indent:-.25in;
- mso-ansi-font-size:10.0pt;
- font-family:Symbol;}
-@list l4
- {mso-list-id:1374160723;
- mso-list-template-ids:1440887904;}
-@list l5
- {mso-list-id:1777210894;
- mso-list-template-ids:-1505962734;}
-@list l5:level1
- {mso-level-number-format:bullet;
- mso-level-text:\F0B7;
- mso-level-tab-stop:.5in;
- mso-level-number-position:left;
- text-indent:-.25in;
- mso-ansi-font-size:10.0pt;
- font-family:Symbol;}
-ol
- {margin-bottom:0in;}
-ul
- {margin-bottom:0in;}
--->
-</style>
-<!--[if gte mso 10]>
-<style>
- /* Style Definitions */
- table.MsoNormalTable
- {mso-style-name:"Table Normal";
- mso-tstyle-rowband-size:0;
- mso-tstyle-colband-size:0;
- mso-style-noshow:yes;
- mso-style-parent:"";
- mso-padding-alt:0in 5.4pt 0in 5.4pt;
- mso-para-margin:0in;
- mso-para-margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:10.0pt;
- font-family:"Times New Roman";
- mso-ansi-language:#0400;
- mso-fareast-language:#0400;
- mso-bidi-language:#0400;}
-</style>
-<![endif]-->
-<meta name=Template content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
-<!--[if gte mso 9]><xml>
- <o:shapedefaults v:ext="edit" spidmax="2050"/>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <o:shapelayout v:ext="edit">
- <o:idmap v:ext="edit" data="1"/>
- </o:shapelayout></xml><![endif]-->
-</head>
-
-<body bgcolor=white lang=EN-US link=blue vlink=purple style='tab-interval:.5in'
-leftmargin=8>
-
-<div class=Section1>
-
-<h2><a name=MYSAMPLE><span style='font-family:Verdana'>HCLIENT</span></a><span
-style='font-family:Verdana'> <o:p></o:p></span></h2>
-
-<h3><span style='font-family:Verdana'>SUMMARY<o:p></o:p></span></h3>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>This document and
-associated sample code describe how to write a user-mode client application to
-communicate with devices that conform to the HID device class specification.
-This article is useful to application writers who need to develop a user-mode
-application that communicates with and extracts information from an
-HID-compatible device. This sample illustrates the method for detecting HID
-devices, opening those HID devices for communication, and extracting and
-formatting the data into or from device reports.<o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The HID class consists
-primarily of devices that are used by humans to control the operation of
-computer systems. Typical HID devices include keyboards, mice, and joysticks.
-Non-typical devices might include front-panel controls (knobs, switches, or
-buttons) or controls found on devices such as telephones, VCR remote controls,
-games, and simulation devices. The underlying common feature of all HID devices
-is the need for guaranteed delivery of small amounts of non-periodic data. <o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The basic communication
-mechanism for HID class devices is the HID report. Every HID device must supply
-a report descriptor that details the format of the different reports that it
-creates for its device. The HID class drivers and HID.DLL is <span class=GramE>provide</span>
-an interface for extracting the relevant data from these reports.<o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>Although the <span
-class=SpellE>HClient</span> sample is a user-mode application, many of the
-functions available in HID.DLL are available to kernel-mode HID clients as
-well. The functions exported by HID.DLL have a prefix of either <span
-class=SpellE>HidD</span>_ or <span class=SpellE>HidP</span>_. All functions
-with a <span class=SpellE>HidP</span>_ prefix are available to kernel-mode
-clients. However, the mechanism for opening HID devices and obtaining the
-necessary information such as <span class=SpellE>preparsed</span> data is
-different in this context. </span></p>
-
-<h3>BUILDING THE SAMPLE</h3>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>To build the HClient.exe
-sample, follow these instructions.<o:p></o:p></span></p>
-
-<ol start=1 type=1>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l4 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Run the standard Windows NT�/Windows� 2000 DDK build
- environment (checked or free)<o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l4 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Change to the .\<span class=SpellE>src\wdm\hid\hclient</span>
- directory<o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l4 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Execute <b>build</b><o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l4 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>The built HClient.exe will be found in
- .\lib\&lt;i386|alpha&gt;\&lt;<span class=SpellE>checked|free</span>&gt;<o:p></o:p></span></li>
-</ol>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The <span class=SpellE>HClient</span>
-sources are dependent on the following system include files and libraries.<o:p></o:p></span></p>
-
-<pre>&nbsp;<span style='mso-tab-count:1'>������ </span>HIDSDI.H <span
-style='mso-tab-count:1'>����� </span>User-mode only definitions and declarations</pre><pre><span
-style='mso-tab-count:1'>������� </span>HIDPI.H <span style='mso-tab-count:1'>������ </span>Definitions and declarations for user-mode and kernel-mode HID clients</pre><pre><span
-style='mso-tab-count:1'>������� </span>HIDUSAGE.H <span style='mso-tab-count:
-1'>��� </span>Macro definitions for predefined usage table and usage values as </pre><pre><span
-style='mso-tab-count:3'>���������������������� </span><span class=GramE>defined</span> in the HID Spec 1.0 and HID Usage Table Spec 1.0</pre><pre><span
-style='mso-tab-count:1'>������� </span>HID.LIB <span style='mso-tab-count:1'>������ </span>Library file needed to resolve exported HID.DLL functions</pre>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>Kernel-mode clients may
-also need the following files:<o:p></o:p></span></p>
-
-<pre>&nbsp;<span style='mso-tab-count:1'>������ </span>HIDPDDI.H <span
-style='mso-tab-count:1'>���� </span>Declarations and definitions for features available through the HID <span
-class=SpellE>ioctl</span> interface</pre><pre><span style='mso-tab-count:1'>������� </span>HIDPARSE.LIB <span
-style='mso-tab-count:1'>� </span>Library file needed to resolve exported HIDPARSE.SYS functions</pre>
-
-<h3><span style='font-family:Verdana'>TOOLS<o:p></o:p></span></h3>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The only tools needed to
-work with <span class=SpellE>HClient</span> are HID devices. In the Windows
-NT/Windows 2000 system, file handles cannot be opened on mice and keyboards.
-However, all other HID devices will be available and recognized by <span
-class=SpellE>HClient</span> for testing purposes.<o:p></o:p></span></p>
-
-<h3><span style='font-family:Verdana'>RESOURCES<o:p></o:p></span></h3>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>See the <a
-href="http://www.usb.org/">Universal Serial Bus</a> Device Class Definition for
-Human Interface Devices (HID) Version 1.0 and Universal Serial Bus HID Usage
-Tables 1.0. <o:p></o:p></span></p>
-
-<h3><span style='font-family:Verdana'>CODE TOUR<o:p></o:p></span></h3>
-
-<h4>File Manifest</h4>
-
-<pre><u>Files<span style='mso-spacerun:yes'>�������� </span>Description</u></pre><pre><span
-style='font-family:Courier'><o:p>&nbsp;</o:p></span></pre><pre><span
-style='font-family:Courier'>HCLIENT.HTM<span style='mso-tab-count:1'>��� </span>The documentation for this sample (this file)<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>SOURCES<span style='mso-tab-count:2'>������� </span>The generic file for building the code sample<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>BUFFERS.C<span style='mso-tab-count:1'>����� </span>Code for displaying HID report buffers in the extended calls <o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>dialog</span> box.<span style='mso-tab-count:2'>����������� </span><o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>BUFFERS.H<span style='mso-tab-count:1'>����� </span>Function and structure declaration visible to other modules<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>DEBUG.C<span style='mso-tab-count:2'>������� </span>Contains the function definitions for debug memory allocation tracking<span
-style='mso-tab-count:1'>����� </span><o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>DEBUG.H <span style='mso-tab-count:1'>������ </span>Contains public macro definitions and function declarations for <o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>the</span> debugging routines to deal with asserts, traps, and memory allocations<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>ECDISP.C<span style='mso-spacerun:yes'>��� </span><span
-style='mso-tab-count:1'>�� </span>Code to handle the extended calls dialog box<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>ECDISP.H<span style='mso-spacerun:yes'>��� </span><span
-style='mso-tab-count:1'>�� </span>Contains public declarations for the extended calls dialog<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>box</span><o:p></o:p></span></pre><pre><span style='font-family:
-Courier'>HCLIENT.C<span style='mso-tab-count:1'>����� </span>Code for handling <span
-class=SpellE>HClient's</span> main dialog box <o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>HCLIENT.H<span style='mso-tab-count:1'>����� </span>Contains public declarations and definitions for HCLIENT.C and<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>visible</span> to other modules<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>HCLIENT.RC<span style='mso-tab-count:1'>���� </span>Visual C++ generated resource file for <span
-class=SpellE>HClient</span><o:p></o:p></span></pre><pre><span style='font-family:
-Courier'>HID.H <span style='mso-tab-count:2'>�������� </span>Contains declarations and definitions for handling devices and<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>data</span> within <span class=SpellE>HClient</span><o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>LIST.H <span style='mso-tab-count:2'>������� </span>Contains public macro definitions for manipulating doubly-linked lists<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>LOGPNP.C<span style='mso-tab-count:1'>������ </span>Code for finding, loading and building logical HID device <o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>structures</span> <o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>LOGPNP.H<span style='mso-spacerun:yes'>��� </span><span
-style='mso-tab-count:1'>�� </span>Contains public function declarations for LOGPNP.C<o:p></o:p></span></pre><pre><st1:place
-w:st="on"><st1:City w:st="on"><span style='font-family:Courier'>MAKEFILE</span></st1:City><span
- style='mso-tab-count:1'>������ </span><st1:State w:st="on"><span
- style='font-family:Courier'>NT</span></st1:State></st1:place><span
-style='font-family:Courier'> DDK build environment <span class=SpellE>makefile</span><span
-style='mso-tab-count:1'>���� </span><o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>PNP.C <span style='mso-tab-count:2'>�������� </span>Contains the code for finding, adding, removing, and<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>identifying</span> hid devices.<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>REPORT.C<span style='mso-spacerun:yes'>�� </span><span
-style='mso-tab-count:1'>��� </span>Contains the code for reading/writing hid reports and<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>translating</span> those HID reports into useful information.<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>RESOURCE.H<span style='mso-tab-count:1'>���� </span>Visual C++ generated resource definition file<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>STRINGS.C<span style='mso-tab-count:1'>����� </span>Code for converting data buffers and integer values<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'><span style='mso-tab-count:2'>�������������� </span><span
-class=GramE>to</span> and from string representation for display.<o:p></o:p></span></pre><pre><span
-style='font-family:Courier'>STRINGS.H<span style='mso-tab-count:1'>����� </span>Contains public function definitions for STRINGS.C<o:p></o:p></span></pre>
-
-<h4>Programming Tour</h4>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The core functionality
-relevant to HID client applications is contained in the files REPORT.C and
-PNP.C. The code in these files implements the basic features that most clients
-will require. Most of the other source files contain code for handling the user
-interface and calling the main tasks that are in the above two files. This
-section covers those relevant topics. <o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The major topics covered
-in this tour are: <o:p></o:p></span></p>
-
-<ul type=disc>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l5 level1 lfo2;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Detecting Installed HID devices <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l5 level1 lfo2;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Opening HID Devices <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l5 level1 lfo2;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Communicating with HID Devices <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l5 level1 lfo2;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Building/Interpreting HID Reports<o:p></o:p></span></li>
-</ul>
-
-<p><u><span style='font-size:10.0pt;font-family:Verdana'>Detecting Installed
-HID Devices</span></u><span style='font-size:10.0pt;font-family:Verdana'><o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>A necessary component of
-a HID client application is the detection of installed HID devices. The
-function <span class=SpellE><span class=GramE>FindKnownHidDevices</span></span><span
-class=GramE>(</span>) in PNP.C details how to do that work. The basic steps for
-identifying attached HID devices are:<o:p></o:p></span></p>
-
-<ul type=disc>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l3 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE>HidD_GetHidGuid</span>() �
- Get the HID device class GUID <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l3 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE>SetupDiGetClassDevs</span>()
- � Get a handle to a set of devices which implement the HID interface <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l3 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE><span class=GramE>SetupDiEnumDeviceInterfaces</span></span><span
- class=GramE>(</span>) � For each device in the returned set of devices,
- obtain the interface information for all exposed HID interfaces. <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l3 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE><span class=GramE>SetupDiGetDeviceInterfaceDetail</span></span><span
- class=GramE>(</span>) � For each interface obtained in the previous call,
- get the detailed information block for that interface. This detailed
- information includes the string that can be passed to <span class=SpellE>CreateFile</span>()
- to open a handle to the device <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l3 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE><span class=GramE>SetupDiDestroyDeviceInfoList</span></span><span
- class=GramE>(</span>) � Free up the device information set that was
- obtained in the call to <span class=SpellE>SetupDiGetClassDevs</span>().<o:p></o:p></span></li>
-</ul>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The remainder of the code
-implemented in the function deals with creating a list of HID_DEVICE structures
-which contain information for each HID device in the system. This sample client
-accesses all HID devices in the system. A more specific implementation may only
-be looking for a certain type of HID device such as a joystick/<span
-class=SpellE>gamepad</span>.<o:p></o:p></span></p>
-
-<p><u><span style='font-size:10.0pt;font-family:Verdana'>Opening HID Devices</span></u><span
-style='font-size:10.0pt;font-family:Verdana'><o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>After detecting a HID
-device, <span class=SpellE>HClient</span> proceeds to open that device. When
-opening the device, <span class=SpellE>HClient</span> creates a HID_DEVICE
-structure to contain any information about the device that further routines
-might use. HID_DEVICE is defined as follows in HID.H:<o:p></o:p></span></p>
-
-<div align=center>
-
-<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=499
- style='width:374.25pt;mso-cellspacing:0in'>
- <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'>
- <td style='padding:.75pt .75pt .75pt .75pt'><pre>&nbsp;<span class=SpellE>typedef</span> <span
- class=SpellE>struct</span> _HID_DEVICE {<span style='mso-spacerun:yes'>�� </span></pre><pre><span style='mso-spacerun:yes'>����</span>HANDLE<span style='mso-spacerun:yes'>�������������� </span><span
- class=SpellE>HidDevice</span>; // A file handle to the hid device.</pre><pre><span style='mso-spacerun:yes'>��� </span>PHIDP_PREPARSED_DATA <span
- class=SpellE>Ppd</span>;<span style='mso-spacerun:yes'>������ </span>// The opaque parser info describing this device</pre><pre><span style='mso-spacerun:yes'>��� </span>HIDP_CAPS<span style='mso-spacerun:yes'>����������� </span>Caps;<span style='mso-spacerun:yes'>����� </span>// The Capabilities of this hid device.</pre><pre><span style='mso-spacerun:yes'>��� </span>HIDD_ATTRIBUTES<span style='mso-spacerun:yes'>����� </span>Attributes;</pre><pre><o:p>&nbsp;</o:p></pre><pre><span style='mso-spacerun:yes'>��� </span>PCHAR<span style='mso-spacerun:yes'>��������������� </span><span
- class=SpellE>InputReportBuffer</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>PHID_DATA<span style='mso-spacerun:yes'>����������� </span><span
- class=SpellE>InputData</span>;<span style='mso-spacerun:yes'>������ </span>// array of hid data structures</pre><pre><span style='mso-spacerun:yes'>��� </span>ULONG<span style='mso-spacerun:yes'>��������������� </span><span
- class=SpellE>InputDataLength</span>; // Num elements in this array.</pre><pre><span style='mso-spacerun:yes'>��� </span>PHIDP_BUTTON_CAPS<span style='mso-spacerun:yes'>�� </span><span style='mso-spacerun:yes'>�</span><span
- class=SpellE>InputButtonCaps</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>PHIDP_VALUE_CAPS<span style='mso-spacerun:yes'>���� </span><span
- class=SpellE>InputValueCaps</span>;</pre><pre><o:p>&nbsp;</o:p></pre><pre><span style='mso-spacerun:yes'>��� </span>PCHAR<span style='mso-spacerun:yes'>��������������� </span><span
- class=SpellE>OutputReportBuffer</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>PHID_DATA<span style='mso-spacerun:yes'>����������� </span><span
- class=SpellE>OutputData</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>ULONG<span style='mso-spacerun:yes'>��������������� </span><span
- class=SpellE>OutputDataLength</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>PHIDP_BUTTON_CAPS<span style='mso-spacerun:yes'>��� </span><span
- class=SpellE>OutputButtonCaps</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>PHIDP_VALUE_CAPS<span style='mso-spacerun:yes'>���� </span><span
- class=SpellE>OutputValueCaps</span>;</pre><pre><o:p>&nbsp;</o:p></pre><pre><span style='mso-spacerun:yes'>��� </span>PCHAR<span style='mso-spacerun:yes'>��������������� </span><span
- class=SpellE>FeatureReportBuffer</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>PHID_DATA<span style='mso-spacerun:yes'>����������� </span><span
- class=SpellE>FeatureData</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>ULONG<span style='mso-spacerun:yes'>��������������� </span><span
- class=SpellE>FeatureDataLength</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>PHIDP_BUTTON_CAPS<span style='mso-spacerun:yes'>��� </span><span
- class=SpellE>FeatureButtonCaps</span>;</pre><pre><span style='mso-spacerun:yes'>��� </span>PHIDP_VALUE_CAPS<span style='mso-spacerun:yes'>���� </span><span
- class=SpellE>FeatureValueCaps</span>;</pre><pre><o:p>&nbsp;</o:p></pre><pre>} HID_DEVICE, *PHID_DEVICE;</pre></td>
- </tr>
-</table>
-
-</div>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>In addition to storing
-the basic HID structures as defined in HIDPI.H and HIDSDI.H, the HID_DEVICE
-structure also maintains an array of HID_DATA structures for each report type.
-These structures contain the most recent value used for each of the controls
-defined in the HIDP_VALUE_CAPS list and HIDP_BUTTON_CAPS list for the given
-report type. The fields within this structure are used by routines that
-pack/unpack data reports. The usage of these fields is discussed further in the
-section entitled <i>Building/Interpreting HID Reports</i>.<o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The function <span
-class=SpellE><span class=GramE>OpenHidDevice</span></span><span class=GramE>(</span>)
-in PNP.C performs the necessary steps to fill a HID_DEVICE structure for a
-device. In order to do so, it performs the following steps:<o:p></o:p></span></p>
-
-<ul type=disc>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l2 level1 lfo4;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE><span class=GramE>CreateFile</span></span><span
- class=GramE>(</span>) � Open a handle to the specific HID device. In this
- case, we request read/write access to the device, allow the device to be
- shared, and synchronize access to the device handle (no OVERLAPPED flag). <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l2 level1 lfo4;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE>HidD_<span class=GramE>GetPreparsedData</span></span><span
- class=GramE>(</span>) � Get the <span class=SpellE>preparsed</span> data
- for the device. The <span class=SpellE>preparsed</span> data is a HID
- parser specific block of data used for processing HID reports. The memory
- for this structure is allocated by the HID.DLL function and must be freed
- when no longer needed with <span class=SpellE>HidD_<span class=GramE>FreePreparsedData</span></span><span
- class=GramE>(</span>). <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l2 level1 lfo4;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE>HidD_<span class=GramE>GetAttributes</span></span><span
- class=GramE>(</span>) � Get the attributes of the device. The attributes
- structure contains the vendor ID, product ID and version number of the
- given HID device <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l2 level1 lfo4;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE>HidD_<span class=GramE>GetCaps</span></span><span
- class=GramE>(</span>) � Get the capabilities of the device. The device
- capabilities include the usage page and usage of the device, the required
- buffer length for the different reports on the device, the number of link
- collection nodes on the device and a count of the number of buttons and
- values for each of the different report types. <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l2 level1 lfo4;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Call <span class=SpellE><span class=GramE>FillDeviceInfo</span></span><span
- class=GramE>(</span>) � Fill in the rest of the HID_DEVICE structure. This
- function allocates space for and retrieves the link collection nodes, the
- value caps, and the button caps for the device.<o:p></o:p></span></li>
-</ul>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>A given client application
-may not need to perform all of the above steps. For instance, if a client
-application only operates with a specific HID device (<span class=SpellE>ie</span>.
-vendor ID/product ID), it may forego any more processing after retrieving the
-attributes if the device it is currently opening is not the one it�s interested
-in. <o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>A client application may
-also work only for a given usage page/usage combination. For example, a monitor
-control application would only need to open devices that match the monitor
-usage page and usage combination. <o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>Lastly, a HID client may
-require only a subset of the detailed information currently stored in the
-HID_DEVICE structure. This sample application performs a broad range of
-functionality to provide a detailed sample.<o:p></o:p></span></p>
-
-<p><u><span style='font-size:10.0pt;font-family:Verdana'>Communicating with HID
-Devices</span></u><span style='font-size:10.0pt;font-family:Verdana'><o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>As mentioned above, a HID
-device�s basic method of communication is through reports. A HID device can
-contain as many as 255 reports for each report type (Input, Output, and
-Feature). In order to properly communicate with a device, a client application
-must be able to create reports (when sending data) or extract data from reports
-(when receiving data). See the section titled: <i>Building/Interpreting HID
-Reports</i> for information on how to manipulate these report buffers. <o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>A HID device reports
-information to the host through Input reports or Feature Reports. Typically,
-input reports contain the data generated by user interaction, such as a button
-press. Feature reports, on the other hand, report the current state or settings
-for a device. The methods for obtaining these two different reports are
-implemented in the functions <span class=GramE>Read(</span>) and <span
-class=SpellE>GetFeature</span>() in REPORT.C. <o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>In order to receive data,
-<span class=SpellE>HClient</span> must use the file handle created in <span
-class=SpellE>OpenHidDevice</span> that has READ access and the buffer allocated
-for the given report type. For input reports, <span class=GramE>Read(</span>)
-calls the Win32 API <span class=SpellE>ReadFile</span>() and waits for the
-device to return a report. For feature reports, <span class=SpellE><span
-class=GramE>GetFeature</span></span><span class=GramE>(</span>) sets the first
-byte of the report buffer to the desired report ID and calls <span
-class=SpellE>HidD_GetFeature</span>() to obtain that feature report. After
-receiving a report back from the underlying drivers, these routines call <span
-class=SpellE><span class=GramE>UnpackReport</span></span><span class=GramE>(</span>)
-to fill in the corresponding HID_DATA structures.<o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>Outputting data to a
-device is a bit more complicated. Once again, there are two different types of
-reports that can be sent to a device, Output and Feature. The corresponding
-functions for outputting data are <span class=GramE>Write(</span>) and <span
-class=SpellE>SetFeature</span>() in REPORT.C.<o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The first step that both
-of these functions perform is creating the desired report buffer. First, the
-HID_DATA structure with the desired report ID value is found. Then, these
-functions call <span class=SpellE><span class=GramE>PackReport</span></span><span
-class=GramE>(</span>) to set the data values within the allocated report buffer
-for that report ID. Once the report buffer has been created, either <span
-class=SpellE><span class=GramE>WriteFile</span></span><span class=GramE>(</span>)
-or <span class=SpellE>HidD_SetFeature</span>() is called to send the report
-packet to the device. <o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>It is important to
-understand that all access to a HID device file handle is synchronized.
-Therefore, all threads using that handle will block until all previous requests
-to the device have completed. One possible client implementation would have one
-thread continuously read input reports while another thread sends or receives
-feature reports. Since the <span class=SpellE>HidD_<span class=GramE>GetFeature</span></span><span
-class=GramE>(</span>) and <span class=SpellE>HidD_SetFeature</span> functions
-are implemented as <span class=SpellE>DeviceIoControl</span> calls, they are
-also synchronized with <span class=SpellE>ReadFile</span> and <span
-class=SpellE>WriteFile</span>(). There are two solutions to this scenario. One <span
-class=GramE>solutions</span> uses overlapped I/O for asynchronous control. The
-second is to open two handles for the device, one for the read thread and one
-for the feature thread. <o:p></o:p></span></p>
-
-<p><u><span style='font-size:10.0pt;font-family:Verdana'>Building/Interpreting
-HID Reports</span></u><span style='font-size:10.0pt;font-family:Verdana'><o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>The last important idea
-when dealing with reports is extracting/setting data values from/in a given
-report buffer. The section covers the details of the functions <span
-class=SpellE><span class=GramE>PackReport</span></span><span class=GramE>(</span>)
-and <span class=SpellE>UnpackReport</span>() as implemented in REPORT.C. <o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>As mentioned above, in
-order to communicate with a HID device, the client application must be able to
-either create the appropriate report to send to the device or extract the
-relevant information from a report received from the device. When <span
-class=SpellE>Hclient</span> initially opened the HID device and created the
-HID_DEVICE structure for that device, it also created an array of HID_DATA
-structures for each of the report types. The format of this HID_DATA structure
-is as follows:<o:p></o:p></span></p>
-
-<div align=center>
-
-<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=499
- style='width:374.25pt;mso-cellspacing:0in'>
- <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'>
- <td style='padding:.75pt .75pt .75pt .75pt'><pre>&nbsp;<span class=SpellE>typedef</span> <span
- class=SpellE>struct</span> _HID_DATA {</pre><pre><span style='mso-spacerun:yes'>�� </span>BOOLEAN<span style='mso-spacerun:yes'>���� </span><span
- class=SpellE>IsButtonData</span>;</pre><pre><span style='mso-spacerun:yes'>�� </span>UCHAR<span style='mso-spacerun:yes'>������ </span>Reserved;</pre><pre><span style='mso-spacerun:yes'>�� </span>USAGE<span style='mso-spacerun:yes'>������ </span><span
- class=SpellE>UsagePage</span>;<span style='mso-spacerun:yes'>�� </span>// The usage page for which we are looking.</pre><pre><span style='mso-spacerun:yes'>�� </span>ULONG<span style='mso-spacerun:yes'>������ </span>Status;<span style='mso-spacerun:yes'>����� </span>// The last status returned from the <span
- class=SpellE>accessor</span> function</pre><pre><span style='mso-spacerun:yes'>��������������������������� </span>// when updating this field.</pre><pre><span style='mso-spacerun:yes'>�� </span>ULONG<span style='mso-spacerun:yes'>������ </span><span
- class=SpellE>ReportID</span>;<span style='mso-spacerun:yes'>��� </span>// <span
- class=SpellE>ReportID</span> for this given data structure</pre><pre><span style='mso-spacerun:yes'>�� </span>BOOLEAN<span style='mso-spacerun:yes'>���� </span><span
- class=SpellE>IsDataSet</span>;<span style='mso-spacerun:yes'>�� </span>// Variable to track whether a given data structure</pre><pre><span style='mso-spacerun:yes'>��������������������������� </span>//<span style='mso-spacerun:yes'>� </span>has already been added to a report structure</pre><pre><o:p>&nbsp;</o:p></pre><pre><span style='mso-spacerun:yes'>�� </span>union {</pre><pre><span style='mso-spacerun:yes'>����� </span><span
- class=SpellE>struct</span> {</pre><pre><span style='mso-spacerun:yes'>�������� </span>ULONG<span style='mso-spacerun:yes'>������ </span><span
- class=SpellE>UsageMin</span>;<span style='mso-spacerun:yes'>������ </span>// Variables to track the usage minimum and max</pre><pre><span style='mso-spacerun:yes'>�������� </span>ULONG<span style='mso-spacerun:yes'>������ </span><span
- class=SpellE>UsageMax</span>;<span style='mso-spacerun:yes'>������ </span>// If equal, then only a single usage</pre><pre><span style='mso-spacerun:yes'>�������� </span>ULONG<span style='mso-spacerun:yes'>������ </span><span
- class=SpellE>MaxUsageLength</span>; // Usages buffer length.</pre><pre><span style='mso-spacerun:yes'>������ </span><span style='mso-spacerun:yes'>��</span>PUSAGE<span style='mso-spacerun:yes'>����� </span>Usages;<span style='mso-spacerun:yes'>�������� </span>// list of usages (buttons ``down'' on the device.</pre><pre><o:p>&nbsp;</o:p></pre><pre><span style='mso-spacerun:yes'>����� </span>} <span
- class=SpellE>ButtonData</span>;</pre><pre><span style='mso-spacerun:yes'>����� </span><span
- class=SpellE>struct</span> {</pre><pre><span style='mso-spacerun:yes'>�������� </span>USAGE<span style='mso-spacerun:yes'>������ </span><span
- class=SpellE>Usage</span>; // The usage describing this value;</pre><pre><span style='mso-spacerun:yes'>�������� </span>USHORT<span style='mso-spacerun:yes'>����� </span>Reserved;</pre><pre><o:p>&nbsp;</o:p></pre><pre><span style='mso-spacerun:yes'>�������� </span>ULONG<span style='mso-spacerun:yes'>������ </span>Value;</pre><pre><span style='mso-spacerun:yes'>�������� </span>LONG<span style='mso-spacerun:yes'>� </span><span style='mso-spacerun:yes'>������</span><span
- class=SpellE>ScaledValue</span>;</pre><pre><span style='mso-spacerun:yes'>����� </span>} <span
- class=SpellE>ValueData</span>;</pre><pre><span style='mso-spacerun:yes'>�� </span>};</pre><pre>} HID_DATA, *PHID_DATA;</pre></td>
- </tr>
-</table>
-
-</div>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>When creating the HID
-reports for sending to the device, the function <span class=SpellE><span
-class=GramE>PackReport</span></span><span class=GramE>(</span>) is used. <span
-class=SpellE>PackReport</span> takes as input a pointer to a HID_DATA structure
-and the appropriate report buffer. The pointer should point to the first
-HID_DATA structure in the array that contains the report ID for the report to
-be created. With this information, <span class=SpellE><span class=GramE>PackReport</span></span><span
-class=GramE>(</span>) performs the following steps:<o:p></o:p></span></p>
-
-<ul type=disc>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l1 level1 lfo5;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Zeroes out the current report buffer <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l1 level1 lfo5;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Searches the array of HID_DATA structures looking all
- data values that match the report ID <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l1 level1 lfo5;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>For each data value structure found, it calls <span
- class=SpellE>HidP_SetUsageValue</span> to set the value currently stored
- in the structure into the report. <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l1 level1 lfo5;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>For each button structure found, it calls <span
- class=SpellE>HidP_SetUsages</span> with the corresponding usage value to
- set the button state in the report to &quot;On&quot;. <o:p></o:p></span></li>
-</ul>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>After having looped
-through the array of HID_DATA structures, the report buffer will have the
-appropriate report ID set as the first byte in the buffer and is ready to be
-sent to the device.<o:p></o:p></span></p>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>In a similar manner, <span
-class=SpellE><span class=GramE>UnpackReport</span></span><span class=GramE>(</span>)
-extracts data from a given report. Like <span class=SpellE><span class=GramE>PackReport</span></span><span
-class=GramE>(</span>), this function receives a report buffer returned by the
-device and an array of HID_DATA structures that could possibly be filled in.
-This routine performs the following steps:<o:p></o:p></span></p>
-
-<ul type=disc>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l0 level1 lfo6;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Extracts the report ID from the first byte of the
- report buffer <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l0 level1 lfo6;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>Searches the array of HID_DATA structures looking for
- all structures that match the report ID <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l0 level1 lfo6;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>For each data value structure found, it <span
- class=GramE>call</span> <span class=SpellE>HidP_GetUsageValue</span> and <span
- class=SpellE>HidP_GetScaledUsageValue</span> to set the Value and <span
- class=SpellE>ScaledValue</span> fields. <o:p></o:p></span></li>
- <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
- mso-list:l0 level1 lfo6;tab-stops:list .5in'><span style='font-size:10.0pt;
- font-family:Verdana'>For each button structure, <span class=SpellE><span
- class=GramE>UnpackReport</span></span><span class=GramE>(</span>) calls <span
- class=SpellE>HidP_GetUsages</span>() to retrieve all the &quot;On&quot;
- buttons for that data structure.<o:p></o:p></span></li>
-</ul>
-
-<p><span style='font-size:10.0pt;font-family:Verdana'>Once finished, the array
-of HID_DATA structures will contain the new settings based on the information
-returned in the report buffer.<o:p></o:p></span></p>
-
-<p align=center style='text-align:center'><span style='font-size:10.0pt;
-font-family:Verdana'><a href="#top">Top of page</a> <o:p></o:p></span></p>
-
-<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=624
- style='width:6.5in;mso-cellspacing:0in'>
- <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes;
- height:1.5pt'>
- <td style='background:aqua;padding:.75pt .75pt .75pt .75pt;height:1.5pt'>
- <p class=MsoNormal><span style='color:black'><o:p>&nbsp;</o:p></span></p>
- </td>
- </tr>
-</table>
-
-<p><span style='font-size:7.5pt;font-family:"MS Sans Serif"'>� 2004 Microsoft
-Corporation</span><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
-
-</div>
-
-</body>
-
-</html>