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.

327 lines
17 KiB

  1. <html xmlns:o="urn:schemas-microsoft-com:office:office"
  2. xmlns:w="urn:schemas-microsoft-com:office:word"
  3. xmlns="http://www.w3.org/TR/REC-html40">
  4. <head>
  5. <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  6. <meta name=ProgId content=Word.Document>
  7. <meta name=Generator content="Microsoft Word 9">
  8. <meta name=Originator content="Microsoft Word 9">
  9. <link rel=File-List href="./fakemodem_files/filelist.xml">
  10. <title>UNIMODEM sample controller-less modem driver (fakemodem)</title>
  11. <style>
  12. <!--
  13. /* Font Definitions */
  14. @font-face
  15. {font-family:Courier;
  16. panose-1:0 0 0 0 0 0 0 0 0 0;
  17. mso-font-charset:0;
  18. mso-generic-font-family:modern;
  19. mso-font-format:other;
  20. mso-font-pitch:fixed;
  21. mso-font-signature:3 0 0 0 1 0;}
  22. @font-face
  23. {font-family:"MS Sans Serif";
  24. panose-1:0 0 0 0 0 0 0 0 0 0;
  25. mso-font-charset:0;
  26. mso-generic-font-family:swiss;
  27. mso-font-format:other;
  28. mso-font-pitch:variable;
  29. mso-font-signature:3 0 0 0 1 0;}
  30. @font-face
  31. {font-family:Verdana;
  32. panose-1:2 11 6 4 3 5 4 4 2 4;
  33. mso-font-charset:0;
  34. mso-generic-font-family:swiss;
  35. mso-font-pitch:variable;
  36. mso-font-signature:536871559 0 0 0 415 0;}
  37. /* Style Definitions */
  38. p.MsoNormal, li.MsoNormal, div.MsoNormal
  39. {mso-style-parent:"";
  40. margin:0in;
  41. margin-bottom:.0001pt;
  42. mso-pagination:widow-orphan;
  43. font-size:12.0pt;
  44. font-family:"Times New Roman";
  45. mso-fareast-font-family:"Times New Roman";}
  46. h2
  47. {margin-right:0in;
  48. mso-margin-top-alt:auto;
  49. mso-margin-bottom-alt:auto;
  50. margin-left:0in;
  51. mso-pagination:widow-orphan;
  52. mso-outline-level:2;
  53. font-size:18.0pt;
  54. font-family:"Times New Roman";
  55. font-weight:bold;}
  56. h3
  57. {margin-right:0in;
  58. mso-margin-top-alt:auto;
  59. mso-margin-bottom-alt:auto;
  60. margin-left:0in;
  61. mso-pagination:widow-orphan;
  62. mso-outline-level:3;
  63. font-size:13.5pt;
  64. font-family:"Times New Roman";
  65. font-weight:bold;}
  66. h4
  67. {margin-right:0in;
  68. mso-margin-top-alt:auto;
  69. mso-margin-bottom-alt:auto;
  70. margin-left:0in;
  71. mso-pagination:widow-orphan;
  72. mso-outline-level:4;
  73. font-size:12.0pt;
  74. font-family:"Times New Roman";
  75. font-weight:bold;}
  76. p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
  77. {margin:0in;
  78. margin-bottom:.0001pt;
  79. mso-pagination:widow-orphan;
  80. font-size:10.0pt;
  81. font-family:Verdana;
  82. mso-fareast-font-family:"Times New Roman";
  83. mso-bidi-font-family:"Times New Roman";}
  84. a:link, span.MsoHyperlink
  85. {color:blue;
  86. text-decoration:underline;
  87. text-underline:single;}
  88. a:visited, span.MsoHyperlinkFollowed
  89. {color:blue;
  90. text-decoration:underline;
  91. text-underline:single;}
  92. p
  93. {margin-right:0in;
  94. mso-margin-top-alt:auto;
  95. mso-margin-bottom-alt:auto;
  96. margin-left:0in;
  97. mso-pagination:widow-orphan;
  98. font-size:12.0pt;
  99. font-family:"Times New Roman";
  100. mso-fareast-font-family:"Times New Roman";}
  101. pre
  102. {margin:0in;
  103. margin-bottom:.0001pt;
  104. mso-pagination:widow-orphan;
  105. 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;
  106. font-size:10.0pt;
  107. font-family:"Courier New";
  108. mso-fareast-font-family:"Courier New";}
  109. @page Section1
  110. {size:8.5in 11.0in;
  111. margin:1.0in 1.25in 1.0in 1.25in;
  112. mso-header-margin:.5in;
  113. mso-footer-margin:.5in;
  114. mso-paper-source:0;}
  115. div.Section1
  116. {page:Section1;}
  117. /* List Definitions */
  118. @list l0
  119. {mso-list-id:837157684;
  120. mso-list-type:hybrid;
  121. mso-list-template-ids:152977158 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
  122. ol
  123. {margin-bottom:0in;}
  124. ul
  125. {margin-bottom:0in;}
  126. -->
  127. </style>
  128. </head>
  129. <body lang=EN-US link=blue vlink=blue style='tab-interval:.5in'>
  130. <div class=Section1>
  131. <h2><span style='font-family:Verdana'>UNIMODEM sample controller-less modem
  132. driver (Fakemodem)<o:p></o:p></span></h2>
  133. <p><span style='font-size:10.0pt;font-family:Arial;color:red'>[This is
  134. preliminary documentation and subject to change.]</span><span style='font-size:
  135. 10.0pt;font-family:Verdana'><o:p></o:p></span></p>
  136. <h3 style='tab-stops:120.0pt'><span style='font-family:Verdana'>SUMMARY<span
  137. style='mso-tab-count:1'>��������� </span><o:p></o:p></span></h3>
  138. <p><span style='font-size:10.0pt;font-family:Verdana'>This sample demonstrates
  139. a simple controller-less modem driver. This driver supports sending and
  140. receiving AT commands using the ReadFile/WriteFile calls or via a TAPI
  141. interface using an application such as HyperTerminal.<o:p></o:p></span></p>
  142. <p><span style='font-size:10.0pt;font-family:Verdana'>The sample works on
  143. Windows 2000, 32-bit and 64-bit platforms, and Windows XP. Both checked
  144. and free builds are available.<o:p></o:p></span></p>
  145. <h3><span style='font-family:Verdana'>BUILDING THE SAMPLE<o:p></o:p></span></h3>
  146. <p class=MsoNormal><span style='font-size:10.0pt;font-family:Verdana'>From the
  147. Free or Checked Build environment, execute <b>build</b> in the sample\sys
  148. directory. <o:p></o:p></span></p>
  149. <h3><span style='font-family:Verdana'>INSTALLATION<o:p></o:p></span></h3>
  150. <p><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>The
  151. driver is installed using the INF file mdmfake.inf, which is provided in the
  152. sample\inf directory. <span style="mso-spacerun: yes"></span><o:p></o:p></span></p>
  153. <p><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>To
  154. install this driver, a PCI enumeration event must first take place. <span
  155. style="mso-spacerun: yes">�</span>Mdmfake.inf has been pre-configured with the
  156. device ID <b>PCI\VEN_9999&amp;DEV_9999</b>.<b><o:p></o:p></b></span></p>
  157. <p><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>In
  158. the Phone and Modem Options CPL:<o:p></o:p></span></p>
  159. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  160. tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
  161. mso-bidi-font-size:12.0pt;font-family:Verdana'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  162. </span></span><![endif]><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  163. font-family:Verdana'>Click <b>Modems</b> to view the list of modems installed.<o:p></o:p></span></p>
  164. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  165. tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
  166. mso-bidi-font-size:12.0pt;font-family:Verdana'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  167. </span></span><![endif]><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  168. font-family:Verdana'>Click <b>Add</b> then <b>Next</b><o:p></o:p></span></p>
  169. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  170. tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
  171. mso-bidi-font-size:12.0pt;font-family:Verdana'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  172. </span></span><![endif]><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  173. font-family:Verdana'>The PCI device will then enumerate a <b>PCI Simple
  174. Communications Controller</b>.<o:p></o:p></span></p>
  175. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  176. tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
  177. mso-bidi-font-size:12.0pt;font-family:Verdana'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  178. </span></span><![endif]><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  179. font-family:Verdana'>At the found new hardware wizard, select <b>Install from a
  180. list or specific location (Advanced)</b>.<o:p></o:p></span></p>
  181. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  182. tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
  183. mso-bidi-font-size:12.0pt;font-family:Verdana'>5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  184. </span></span><![endif]><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  185. font-family:Verdana'>Uncheck <b>Search removable media (floppy, CD-ROM�)</b><o:p></o:p></span></p>
  186. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  187. tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
  188. mso-bidi-font-size:12.0pt;font-family:Verdana'>6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  189. </span></span><![endif]><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  190. font-family:Verdana'>Check <b>Include this location in the search:</b><o:p></o:p></span></p>
  191. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  192. tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
  193. mso-bidi-font-size:12.0pt;font-family:Verdana'>7.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  194. </span></span><![endif]><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  195. font-family:Verdana'>In the directory pull down list, enter the location of the
  196. driver.<o:p></o:p></span></p>
  197. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  198. tab-stops:list .5in'><![if !supportLists]><span style='font-size:10.0pt;
  199. mso-bidi-font-size:12.0pt;font-family:Verdana'>8.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  200. </span></span><![endif]><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;
  201. font-family:Verdana'>Click <b>Next</b>.<o:p></o:p></span></p>
  202. <p><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>Note
  203. that if you get a warning dialog with regards to Windows Logo, or unsigned
  204. drivers, testing then click on <b>continue</b>.<o:p></o:p></span></p>
  205. <h3><span style='font-family:Verdana'>USAGE<o:p></o:p></span></h3>
  206. <p><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>Once
  207. installed, you can talk to the fakemodem driver through HyperTerminal, or via
  208. ReadFile/WriteFile calls.<span style="mso-spacerun: yes"></span>The AT
  209. command set supported by fakemodem includes:<o:p></o:p></span></p>
  210. <p><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'><span
  211. style='mso-tab-count:1'>��������� </span><b>AT</b><span style='mso-tab-count:
  212. 3'>������������������������ </span>returns <b>OK</b><br>
  213. <br>
  214. <span style='mso-tab-count:1'>��������� </span><b>ATA</b><span
  215. style='mso-tab-count:3'>���������������������� </span>returns <b>CONNECT<o:p></o:p></b></span></p>
  216. <p><b><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'><span
  217. style='mso-tab-count:1'>����������� </span>ATD</span></b><span
  218. style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:Verdana'>&lt;number&gt;<span
  219. style='mso-tab-count:2'>��������� </span>returns <b>CONNECT</b><o:p></o:p></span></p>
  220. <h3 style='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'><span
  221. style='font-family:Verdana'>TIPS<o:p></o:p></span></h3>
  222. <p class=MsoNormal style='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'><span
  223. style='font-size:10.0pt;font-family:Verdana'>With a checked version of
  224. fakemodem.sys, you can control the volume of debug information generated by
  225. changing the registry variable DebugFlags. Refer to fakemodem.h for more
  226. information.<o:p></o:p></span></p>
  227. <h3 style='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'><span
  228. style='font-family:Verdana'>CODE TOUR<o:p></o:p></span></h3>
  229. <h4 style='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'><span
  230. style='font-family:Verdana'>File Manifest<o:p></o:p></span></h4>
  231. <pre><b><span style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>Directory: Inf</span></b><span
  232. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><o:p></o:p></span></pre><pre><span
  233. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></pre><pre><u><span
  234. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>File</span></u><span
  235. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  236. style='mso-tab-count:2'>������������ </span><u>Description<o:p></o:p></u></span></pre><pre><b><span
  237. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>mdmfake.inf</span></b><span
  238. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  239. style='mso-tab-count:1'>����� </span>INF file for installing the fakemodem driver<o:p></o:p></span></pre><pre><span
  240. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  241. style='mso-tab-count:1'>�������� </span><o:p></o:p></span></pre><pre><b><span
  242. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>Directory: Sys</span></b><span
  243. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><br
  244. style='mso-special-character:line-break'>
  245. <![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
  246. <![endif]><o:p></o:p></span></pre><pre><span style='font-size:9.0pt;mso-bidi-font-size:
  247. 7.5pt;font-family:Courier'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></pre><pre><span
  248. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></pre><pre><u><span
  249. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>File</span></u><span
  250. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  251. style='mso-tab-count:2'>������������ </span><u>Description<o:p></o:p></u></span></pre><pre><b><span
  252. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>init.c</span></b><span
  253. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  254. style='mso-tab-count:2'>���������� </span>Fakemodem driver initialization entry points<o:p></o:p></span></pre><pre><b><span
  255. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>readwrit.c</span></b><span
  256. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  257. style='mso-tab-count:1'>������ </span>Routines for receiving and sending text. This includes processing AT commands.<o:p></o:p></span></pre><pre><b><span
  258. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>open.c</span></b><span
  259. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  260. style='mso-tab-count:2'>���������� </span>Routines for opening and closing device extensions.<o:p></o:p></span></pre><pre><b><span
  261. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>util.c</span></b><span
  262. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  263. style='mso-tab-count:2'>���������� </span>Auxiliary functions.<o:p></o:p></span></pre><pre><b><span
  264. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>pnp.c</span></b><span
  265. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  266. style='mso-tab-count:2'>����������� </span>Routines for handling Plug &amp; Play events.<o:p></o:p></span></pre><pre><b><span
  267. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>ioctl.c</span></b><span
  268. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  269. style='mso-tab-count:2'>��������� </span>Routines to handle IOCTL messages.<o:p></o:p></span></pre><pre><b><span
  270. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'>power.c</span></b><span
  271. style='font-size:9.0pt;mso-bidi-font-size:7.5pt;font-family:Courier'><span
  272. style='mso-tab-count:2'>��������� </span>Routines to handle power management messages.<o:p></o:p></span></pre><pre><span
  273. style='font-size:7.5pt;font-family:Courier'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></pre>
  274. <p align=center style='text-align:center;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'><span
  275. style='font-size:10.0pt;font-family:Verdana'><a href="#top">Top of page</a> <o:p></o:p></span></p>
  276. <table border=0 cellspacing=0 cellpadding=0 width=624 style='width:6.5in;
  277. mso-cellspacing:0in;mso-padding-alt:0in 0in 0in 0in'>
  278. <tr style='height:1.5pt'>
  279. <td style='background:aqua;padding:.75pt .75pt .75pt .75pt;height:1.5pt'>
  280. <p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
  281. </td>
  282. </tr>
  283. </table>
  284. <p style='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'><span
  285. style='font-size:7.5pt;font-family:"MS Sans Serif"'>� Microsoft Corporation
  286. 2000</span><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
  287. </div>
  288. </body>
  289. </html>