Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

299 lines
13 KiB

  1. <html xmlns:v="urn:schemas-microsoft-com:vml"
  2. xmlns:o="urn:schemas-microsoft-com:office:office"
  3. xmlns:w="urn:schemas-microsoft-com:office:word"
  4. xmlns="http://www.w3.org/TR/REC-html40">
  5. <head>
  6. <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  7. <meta name=ProgId content=Word.Document>
  8. <meta name=Generator content="Microsoft Word 10">
  9. <meta name=Originator content="Microsoft Word 10">
  10. <link rel=File-List href="irclass_files/filelist.xml">
  11. <title>Irclass</title>
  12. <!--[if gte mso 9]><xml>
  13. <w:WordDocument>
  14. <w:Zoom>90</w:Zoom>
  15. <w:SpellingState>Clean</w:SpellingState>
  16. <w:GrammarState>Clean</w:GrammarState>
  17. <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  18. </w:WordDocument>
  19. </xml><![endif]-->
  20. <style>
  21. <!--
  22. /* Font Definitions */
  23. @font-face
  24. {font-family:Courier;
  25. panose-1:2 7 4 9 2 2 5 2 4 4;
  26. mso-font-charset:0;
  27. mso-generic-font-family:modern;
  28. mso-font-format:other;
  29. mso-font-pitch:fixed;
  30. mso-font-signature:3 0 0 0 1 0;}
  31. @font-face
  32. {font-family:Wingdings;
  33. panose-1:5 0 0 0 0 0 0 0 0 0;
  34. mso-font-charset:2;
  35. mso-generic-font-family:auto;
  36. mso-font-pitch:variable;
  37. mso-font-signature:0 268435456 0 0 -2147483648 0;}
  38. @font-face
  39. {font-family:Verdana;
  40. panose-1:2 11 6 4 3 5 4 4 2 4;
  41. mso-font-charset:0;
  42. mso-generic-font-family:swiss;
  43. mso-font-pitch:variable;
  44. mso-font-signature:536871559 0 0 0 415 0;}
  45. @font-face
  46. {font-family:"MS Sans Serif";
  47. panose-1:0 0 0 0 0 0 0 0 0 0;
  48. mso-font-alt:"Times New Roman";
  49. mso-font-charset:0;
  50. mso-generic-font-family:roman;
  51. mso-font-format:other;
  52. mso-font-pitch:auto;
  53. mso-font-signature:0 0 0 0 0 0;}
  54. /* Style Definitions */
  55. p.MsoNormal, li.MsoNormal, div.MsoNormal
  56. {mso-style-parent:"";
  57. margin:0in;
  58. margin-bottom:.0001pt;
  59. mso-pagination:widow-orphan;
  60. font-size:12.0pt;
  61. font-family:"Times New Roman";
  62. mso-fareast-font-family:"Times New Roman";
  63. color:black;}
  64. h2
  65. {color:black;}
  66. h3
  67. {color:black;}
  68. h4
  69. {color:black;}
  70. a:link, span.MsoHyperlink
  71. {color:blue;
  72. text-decoration:underline;
  73. text-underline:single;}
  74. a:visited, span.MsoHyperlinkFollowed
  75. {color:purple;
  76. text-decoration:underline;
  77. text-underline:single;}
  78. p
  79. {font-size:12.0pt;
  80. font-family:"Times New Roman";
  81. mso-fareast-font-family:"Times New Roman";
  82. color:black;}
  83. pre
  84. {margin-top:0in;
  85. margin-bottom:0in;
  86. margin-bottom:.0001pt;
  87. font-size:10.0pt;
  88. font-family:"Courier New";
  89. mso-fareast-font-family:"Times New Roman";
  90. color:black;}
  91. span.SpellE
  92. {mso-style-name:"";
  93. mso-spl-e:yes;}
  94. span.GramE
  95. {mso-style-name:"";
  96. mso-gram-e:yes;}
  97. @page Section1
  98. {size:8.5in 11.0in;
  99. margin:1.0in 1.25in 1.0in 1.25in;
  100. mso-header-margin:.5in;
  101. mso-footer-margin:.5in;
  102. mso-paper-source:0;}
  103. div.Section1
  104. {page:Section1;}
  105. /* List Definitions */
  106. @list l0
  107. {mso-list-id:810489118;
  108. mso-list-template-ids:-2052968106;}
  109. @list l0:level1
  110. {mso-level-number-format:bullet;
  111. mso-level-text:\F0B7;
  112. mso-level-tab-stop:.5in;
  113. mso-level-number-position:left;
  114. text-indent:-.25in;
  115. mso-ansi-font-size:10.0pt;
  116. font-family:Symbol;}
  117. ol
  118. {margin-bottom:0in;}
  119. ul
  120. {margin-bottom:0in;}
  121. -->
  122. </style>
  123. <!--[if gte mso 10]>
  124. <style>
  125. /* Style Definitions */
  126. table.MsoNormalTable
  127. {mso-style-name:"Table Normal";
  128. mso-tstyle-rowband-size:0;
  129. mso-tstyle-colband-size:0;
  130. mso-style-noshow:yes;
  131. mso-style-parent:"";
  132. mso-padding-alt:0in 5.4pt 0in 5.4pt;
  133. mso-para-margin:0in;
  134. mso-para-margin-bottom:.0001pt;
  135. mso-pagination:widow-orphan;
  136. font-size:10.0pt;
  137. font-family:"Times New Roman";}
  138. </style>
  139. <![endif]-->
  140. <meta name=Template content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
  141. <!--[if gte mso 9]><xml>
  142. <o:shapedefaults v:ext="edit" spidmax="2050"/>
  143. </xml><![endif]--><!--[if gte mso 9]><xml>
  144. <o:shapelayout v:ext="edit">
  145. <o:idmap v:ext="edit" data="1"/>
  146. </o:shapelayout></xml><![endif]-->
  147. </head>
  148. <body bgcolor=white lang=EN-US link=blue vlink=purple style='tab-interval:.5in'
  149. leftmargin=8>
  150. <div class=Section1>
  151. <h2><a name=MYSAMPLE><span style='font-family:Verdana'>Infrared (Network) Class
  152. </span></a><span class=SpellE><span style='mso-bookmark:MYSAMPLE'><span
  153. style='font-family:Verdana'>Coinstaller</span></span></span><span
  154. style='mso-bookmark:MYSAMPLE'><span style='font-family:Verdana'> </span></span><span
  155. style='font-family:Verdana'><o:p></o:p></span></h2>
  156. <h3><span style='font-family:Verdana'>SUMMARY<o:p></o:p></span></h3>
  157. <p class=MsoNormal><span style='font-size:10.0pt;font-family:Verdana'>This
  158. sample demonstrates the handling of DIF_ calls during device installation and
  159. the insertion of a property page into the install wizard and into the device
  160. properties. <o:p></o:p></span></p>
  161. <h3><span style='font-family:Verdana'>BUILDING THE SAMPLE<o:p></o:p></span></h3>
  162. <p><span style='font-size:10.0pt;font-family:Verdana'>To build Irclass.dll,
  163. select either the checked or free DDK environment, change to the directory <span
  164. class=SpellE>Irclass</span>, and type <b>BUILD</b>.<o:p></o:p></span></p>
  165. <p><span style='font-size:10.0pt;font-family:Verdana'>This sample is included
  166. as part of Windows� 2000 for installing and configuring serial infrared
  167. devices. The corresponding .<span class=SpellE>inf</span> file, <span
  168. class=SpellE>Netirsir.inf</span>, can be found in the \<span class=SpellE>WinNt\Inf</span>
  169. directory after installation of the operating system.<o:p></o:p></span></p>
  170. <h3><span style='font-family:Verdana'>CODE TOUR<o:p></o:p></span></h3>
  171. <h4><span style='font-family:Verdana'>File Manifest<o:p></o:p></span></h4>
  172. <pre><o:p>&nbsp;</o:p></pre><pre><u><span style='font-family:Courier'>Files<span style='mso-spacerun:yes'>������� </span>Description</span><o:p></o:p></u></pre><pre><span
  173. class=GramE><span style='font-family:Courier'>Irclass.htm<span style='mso-spacerun:yes'></span>The</span></span><span
  174. style='font-family:Courier'> documentation for this sample (this file)</span><u><o:p></o:p></u></pre><pre><span
  175. style='font-family:Courier'>Sources<span style='mso-spacerun:yes'>����� </span>The generic file for building the code sample<o:p></o:p></span></pre><pre><span
  176. class=SpellE><span style='font-family:Courier'>Irclass.c</span></span><span
  177. style='font-family:Courier'><span style='mso-spacerun:yes'>��� </span>The only source code for this sample<o:p></o:p></span></pre><pre><span
  178. class=SpellE><span style='font-family:Courier'>Irclass.h</span></span><span
  179. style='font-family:Courier'><span style='mso-spacerun:yes'>��� </span>Header for <span
  180. class=SpellE>Irclass.c</span><o:p></o:p></span></pre><pre><span class=SpellE><span
  181. class=GramE><span style='font-family:Courier'>Irclass.def</span></span></span><span
  182. class=GramE><span style='font-family:Courier'><span style='mso-spacerun:yes'></span>DLL</span></span><span
  183. style='font-family:Courier'> definition and exports<o:p></o:p></span></pre><pre><span
  184. class=SpellE><span style='font-family:Courier'>Irclass.rc</span></span><span
  185. style='font-family:Courier'><span style='mso-spacerun:yes'>�� </span>Dialogs and string tables<o:p></o:p></span></pre><pre><span
  186. class=SpellE><span style='font-family:Courier'>Irexe.ico</span></span><span
  187. style='font-family:Courier'><span style='mso-spacerun:yes'>��� </span>Icon for infrared devices<o:p></o:p></span></pre><pre><span
  188. class=SpellE><span style='font-family:Courier'>Makefile</span></span><span
  189. style='font-family:Courier'><span style='mso-spacerun:yes'>���� </span>Standard <span
  190. class=SpellE>makefile</span><o:p></o:p></span></pre><pre><span class=SpellE><span
  191. style='font-family:Courier'>Resource.h</span></span><span style='font-family:
  192. Courier'><span style='mso-spacerun:yes'>�� </span>Microsoft Developer Studio generated include file<o:p></o:p></span></pre>
  193. <h4><span style='font-family:Verdana'>Programming Tour</span></h4>
  194. <p><span style='font-size:10.0pt;font-family:Verdana'>This code tour focuses on
  195. insertion of page into the install wizard.<o:p></o:p></span></p>
  196. <p><span style='font-size:10.0pt;font-family:Verdana'>The major topics covered
  197. in this tour include the following. <o:p></o:p></span></p>
  198. <ul type=disc>
  199. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  200. mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
  201. font-family:Verdana'>Device <span class=SpellE>Coinstaller</span><o:p></o:p></span></li>
  202. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  203. mso-list:l0 level1 lfo1;tab-stops:list .5in'><span style='font-size:10.0pt;
  204. font-family:Verdana'>Property Page Provider<o:p></o:p></span></li>
  205. </ul>
  206. <h4><span style='font-size:10.0pt;font-family:Verdana'>Device <span
  207. class=SpellE>Coinstaller</span><o:p></o:p></span></h4>
  208. <p><span style='font-size:10.0pt;font-family:Verdana'>Device <span
  209. class=SpellE>Coinstallers</span> are meant to handle special cases of
  210. installation of which a generic class installer may not be aware.&nbsp;
  211. Infrared devices are essentially network devices, and so the majority of the
  212. installation is handled by the network class installer.&nbsp; There are details
  213. about an infrared device of which the network class installer is unaware, such
  214. as the selection of the serial port the device is attached to, and the device <span
  215. class=SpellE>coinstaller</span> mechanism is provided to extend the
  216. functionality of a more generic class installer in these situations.<o:p></o:p></span></p>
  217. <p><span style='font-size:10.0pt;font-family:Verdana'>A device <span
  218. class=SpellE>coinstaller</span> is very similar to a regular class installer.&nbsp;
  219. It receives each DIF_* call before the regular class installer does, but it
  220. only needs to provide handlers for those DIF_* calls where it desires to modify
  221. or extend the behavior or the regular class installer.&nbsp; In this sample, <span
  222. class=SpellE>IrSIRClassCoinstaller</span> is the main <span class=SpellE>coinstaller</span>
  223. function, and it only handles two calls, DIF_INSTALLDEVICE and
  224. DIF_NEWDEVICEWIZARD_FINISHINSTALL.<o:p></o:p></span></p>
  225. <p><span style='font-size:10.0pt;font-family:Verdana'>DIF_INSTALLDEVICE is
  226. handled by the <span class=SpellE>coinstaller</span> to allow it to check and
  227. modify the UPPERFILTER and LOWERFILTER values for the <span class=SpellE>Irsir.sys</span>
  228. driver. &nbsp; <span class=SpellE>Irsir.sys</span> may use <span class=SpellE>Serial.sys</span>
  229. as a lower filter, and it sets this value here. &nbsp; It reads the <span
  230. class=SpellE>LowerFilters</span> entry from <span class=SpellE>Netirsir.inf</span>,
  231. and writes this value to the registry.&nbsp; It also clears the UPPERFILTER
  232. value because <span class=SpellE>Serial.sys</span> may use <span class=SpellE>Serenum.sys</span>
  233. as an upper filter, which is inappropriate for <span class=SpellE>Irsir.sys</span>.
  234. &nbsp; DIF_INSTALLDEVICE is the most convenient place to do this because at
  235. this point the driver has not yet been loaded.<o:p></o:p></span></p>
  236. <p><span style='font-size:10.0pt;font-family:Verdana'>DIF_NEWDEVICEWIZARD_FINISHINSTALL
  237. is the <span class=SpellE>coinstaller's</span> best opportunity to prompt for
  238. special parameters for the driver.&nbsp; The driver may have already been
  239. started at this point, so you should ensure that your driver does not crash if
  240. any parameter is not set yet.&nbsp; This function allows us to insert a final
  241. page into the wizard to query the user.&nbsp; The <span class=SpellE>PortSelectionDlg</span>
  242. function handles inserting the page, which will subsequently be invoked by the
  243. install mechanism.<o:p></o:p></span></p>
  244. <h4><span style='font-size:10.0pt;font-family:Verdana'>Property Page Provider</span><span
  245. style='font-family:Verdana'><o:p></o:p></span></h4>
  246. <p><span style='font-size:10.0pt;font-family:Verdana'>You should note that the
  247. Property Page Provider and the Wizard page share a common message handling
  248. function, <span class=SpellE>PortDlgProc</span>.&nbsp; Minor differences are
  249. handled by the <span class=SpellE>FirstTimeInstall</span> flag which is set to
  250. TRUE in the wizard page initialization code, and FALSE otherwise.&nbsp; At the
  251. dialog completion, it calls <span class=SpellE>WriteRegistrySettings</span>,
  252. which sets the flag DI_FLAGSEX_PROPCHANGE_PENDING. &nbsp; This is the cue to
  253. the OS that a driver's settings have changed, and the driver needs to either
  254. reload them or be restarted depending on its capabilities.<o:p></o:p></span></p>
  255. <p align=center style='text-align:center'><a href="#top"><span
  256. style='font-size:10.0pt;font-family:Verdana'>Top of page</span></a><span
  257. style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
  258. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=624
  259. style='width:6.5in;mso-cellspacing:0in'>
  260. <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes;height:1.5pt'>
  261. <td style='background:aqua;padding:.75pt .75pt .75pt .75pt;height:1.5pt'>
  262. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  263. </td>
  264. </tr>
  265. </table>
  266. <p><span style='font-size:7.5pt;font-family:"MS Sans Serif"'>� 1999 Microsoft
  267. Corporation</span><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
  268. </div>
  269. </body>
  270. </html>