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.

485 lines
26 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:st1="urn:schemas-microsoft-com:office:smarttags"
  5. xmlns="http://www.w3.org/TR/REC-html40">
  6. <head>
  7. <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  8. <meta name=ProgId content=Word.Document>
  9. <meta name=Generator content="Microsoft Word 10">
  10. <meta name=Originator content="Microsoft Word 10">
  11. <link rel=File-List href="passthru_files/filelist.xml">
  12. <title>passthru</title>
  13. <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
  14. name="place"/>
  15. <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
  16. name="PlaceType"/>
  17. <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
  18. name="PlaceName"/>
  19. <!--[if gte mso 9]><xml>
  20. <w:WordDocument>
  21. <w:SpellingState>Clean</w:SpellingState>
  22. <w:GrammarState>Clean</w:GrammarState>
  23. <w:Compatibility>
  24. <w:UseFELayout/>
  25. </w:Compatibility>
  26. <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  27. </w:WordDocument>
  28. </xml><![endif]--><!--[if !mso]><object
  29. classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
  30. <style>
  31. st1\:*{behavior:url(#ieooui) }
  32. </style>
  33. <![endif]-->
  34. <style>
  35. <!--
  36. /* Font Definitions */
  37. @font-face
  38. {font-family:"MS Mincho";
  39. panose-1:2 2 6 9 4 2 5 8 3 4;
  40. mso-font-alt:"\FF2D\FF33 \660E\671D";
  41. mso-font-charset:128;
  42. mso-generic-font-family:modern;
  43. mso-font-pitch:fixed;
  44. mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
  45. @font-face
  46. {font-family:Verdana;
  47. panose-1:2 11 6 4 3 5 4 4 2 4;
  48. mso-font-charset:0;
  49. mso-generic-font-family:swiss;
  50. mso-font-pitch:variable;
  51. mso-font-signature:536871559 0 0 0 415 0;}
  52. @font-face
  53. {font-family:"\@MS Mincho";
  54. panose-1:2 2 6 9 4 2 5 8 3 4;
  55. mso-font-charset:128;
  56. mso-generic-font-family:modern;
  57. mso-font-pitch:fixed;
  58. mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
  59. @font-face
  60. {font-family:"MS Sans Serif";
  61. panose-1:0 0 0 0 0 0 0 0 0 0;
  62. mso-font-charset:0;
  63. mso-generic-font-family:swiss;
  64. mso-font-format:other;
  65. mso-font-pitch:variable;
  66. mso-font-signature:3 0 0 0 1 0;}
  67. /* Style Definitions */
  68. p.MsoNormal, li.MsoNormal, div.MsoNormal
  69. {mso-style-parent:"";
  70. margin:0in;
  71. margin-bottom:.0001pt;
  72. mso-pagination:widow-orphan;
  73. font-size:12.0pt;
  74. font-family:"Times New Roman";
  75. mso-fareast-font-family:"Times New Roman";
  76. color:black;}
  77. h2
  78. {mso-margin-top-alt:auto;
  79. margin-right:0in;
  80. mso-margin-bottom-alt:auto;
  81. margin-left:0in;
  82. mso-pagination:widow-orphan;
  83. mso-outline-level:2;
  84. font-size:18.0pt;
  85. font-family:"Times New Roman";
  86. mso-fareast-font-family:"MS Mincho";
  87. color:black;
  88. font-weight:bold;}
  89. h3
  90. {mso-margin-top-alt:auto;
  91. margin-right:0in;
  92. mso-margin-bottom-alt:auto;
  93. margin-left:0in;
  94. mso-pagination:widow-orphan;
  95. mso-outline-level:3;
  96. font-size:13.5pt;
  97. font-family:"Times New Roman";
  98. mso-fareast-font-family:"MS Mincho";
  99. color:black;
  100. font-weight:bold;}
  101. h4
  102. {mso-margin-top-alt:auto;
  103. margin-right:0in;
  104. mso-margin-bottom-alt:auto;
  105. margin-left:0in;
  106. mso-pagination:widow-orphan;
  107. mso-outline-level:4;
  108. font-size:12.0pt;
  109. font-family:"Times New Roman";
  110. mso-fareast-font-family:"MS Mincho";
  111. color:black;
  112. font-weight:bold;}
  113. a:link, span.MsoHyperlink
  114. {color:blue;
  115. text-decoration:underline;
  116. text-underline:single;}
  117. a:visited, span.MsoHyperlinkFollowed
  118. {color:purple;
  119. text-decoration:underline;
  120. text-underline:single;}
  121. p
  122. {mso-margin-top-alt:auto;
  123. margin-right:0in;
  124. mso-margin-bottom-alt:auto;
  125. margin-left:0in;
  126. mso-pagination:widow-orphan;
  127. font-size:12.0pt;
  128. font-family:"Times New Roman";
  129. mso-fareast-font-family:"Times New Roman";
  130. color:black;}
  131. pre
  132. {margin:0in;
  133. margin-bottom:.0001pt;
  134. mso-pagination:widow-orphan;
  135. 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;
  136. font-size:10.0pt;
  137. font-family:"Courier New";
  138. mso-fareast-font-family:"Courier New";
  139. color:black;}
  140. span.SpellE
  141. {mso-style-name:"";
  142. mso-spl-e:yes;}
  143. span.GramE
  144. {mso-style-name:"";
  145. mso-gram-e:yes;}
  146. @page Section1
  147. {size:8.5in 11.0in;
  148. margin:1.0in 1.25in 1.0in 1.25in;
  149. mso-header-margin:.5in;
  150. mso-footer-margin:.5in;
  151. mso-paper-source:0;}
  152. div.Section1
  153. {page:Section1;}
  154. -->
  155. </style>
  156. <!--[if gte mso 10]>
  157. <style>
  158. /* Style Definitions */
  159. table.MsoNormalTable
  160. {mso-style-name:"Table Normal";
  161. mso-tstyle-rowband-size:0;
  162. mso-tstyle-colband-size:0;
  163. mso-style-noshow:yes;
  164. mso-style-parent:"";
  165. mso-padding-alt:0in 5.4pt 0in 5.4pt;
  166. mso-para-margin:0in;
  167. mso-para-margin-bottom:.0001pt;
  168. mso-pagination:widow-orphan;
  169. font-size:10.0pt;
  170. font-family:"Times New Roman";}
  171. </style>
  172. <![endif]-->
  173. <meta name=Template content="C:\Program Files\Microsoft Office\Office\html.dot">
  174. <!--[if gte mso 9]><xml>
  175. <o:shapedefaults v:ext="edit" spidmax="3074"/>
  176. </xml><![endif]--><!--[if gte mso 9]><xml>
  177. <o:shapelayout v:ext="edit">
  178. <o:idmap v:ext="edit" data="1"/>
  179. </o:shapelayout></xml><![endif]-->
  180. </head>
  181. <body bgcolor=white lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
  182. <div class=Section1>
  183. <h2><a name=MYSAMPLE></a><a name=top></a><span style='mso-bookmark:MYSAMPLE'>
  184. <!doctype HTML>
  185. <span style='font-family:Verdana'><! ---------------- Snip Snip ---------------- >PASSTHRU.SYS
  186. - Sample NDIS Intermediate Driver</span></span><span style='font-family:Verdana'><o:p></o:p></span></h2>
  187. <h3><span style='font-family:Verdana'>SUMMARY<o:p></o:p></span></h3>
  188. <p><st1:place><st1:PlaceName><span class=SpellE><b><span style='font-family:
  189. Verdana'>Passthru</span></b></span></st1:PlaceName><b><span style='font-family:
  190. Verdana'> </span></b><st1:PlaceName><b><span style='font-family:Verdana'>Intermediate</span></b></st1:PlaceName><b><span
  191. style='font-family:Verdana'> </span></b><st1:PlaceType><b><span
  192. style='font-family:Verdana'>Miniport</span></b></st1:PlaceType></st1:place><b><span
  193. style='font-family:Verdana'> Driver<o:p></o:p></span></b></p>
  194. <p><span style='font-size:10.0pt;font-family:Verdana'>The <span class=SpellE>Passthru</span>
  195. sample is a do-nothing pass-through NDIS 5 driver that demonstrates the basic
  196. principles underlying an NDIS Intermediate Miniport (IM) driver. This driver
  197. exposes a virtual adapter for each binding to a real or virtual NDIS adapter.
  198. Protocols bind to these virtual adapters as if they are real adapters. <o:p></o:p></span></p>
  199. <p><span style='font-size:10.0pt;font-family:Verdana'>The <span class=SpellE>Passthru</span>
  200. driver re-packages and sends down all requests and sends submitted to this
  201. virtual adapter. The <span class=SpellE>Passthru</span> driver can be modified
  202. to change the data before passing it along. For example, it could
  203. encrypt/compress outgoing and decrypt/decompress incoming data.<o:p></o:p></span></p>
  204. <p><span class=SpellE><span style='font-size:10.0pt;font-family:Verdana'>Passthru</span></span><span
  205. style='font-size:10.0pt;font-family:Verdana'> also re-packages and indicates up
  206. all received data and status indications that it receives at its lower
  207. (protocol) edge.<o:p></o:p></span></p>
  208. <h3><span style='font-family:Verdana'>BUILDING THE SAMPLE<o:p></o:p></span></h3>
  209. <p><span style='font-size:10.0pt;font-family:Verdana'>Run the <b>build</b>
  210. command from this directory to build the sample�it creates the binary <span
  211. class=SpellE>Passthru.sys</span>. <o:p></o:p></span></p>
  212. <p><span style='font-size:10.0pt;font-family:Verdana'>To install this driver on
  213. Windows� 2000, use the PASSTHRU sample notification object and <span
  214. class=SpellE>INFs</span>, also found in this DDK.<o:p></o:p></span></p>
  215. <h3><span style='font-family:Verdana'>INSTALLING THE SAMPLE<o:p></o:p></span></h3>
  216. <p><span class=SpellE><span style='font-size:10.0pt;font-family:Verdana'>Passthru</span></span><span
  217. style='font-size:10.0pt;font-family:Verdana'> is installed as a service (called
  218. <span class=SpellE>Passthru</span> Driver� in the supplied <span class=SpellE>INFs</span>/notification
  219. object). To install, follow the steps below.<o:p></o:p></span></p>
  220. <p><span style='font-size:10.0pt;font-family:Verdana'>Prepare a floppy disk (or
  221. installation directory) that contains these files: <span class=SpellE>netsf.inf</span>,
  222. <span class=SpellE>netsf_m.inf</span> and <span class=SpellE>passthru.sys</span>.<o:p></o:p></span></p>
  223. <p><span style='font-size:10.0pt;font-family:Verdana'>On the desktop,
  224. right-click the <b>My Network Places</b> icon and choose <b>Properties</b>. <o:p></o:p></span></p>
  225. <p><span style='font-size:10.0pt;font-family:Verdana'>Right-click on the
  226. relevant Local Area Connection icon and choose <b>Properties</b>. <o:p></o:p></span></p>
  227. <p><span style='font-size:10.0pt;font-family:Verdana'>Click <b>Install</b>,
  228. then <b>Service</b>, then <b>Add</b>, <span class=GramE>then</span> <b>Have Disk</b>.
  229. <o:p></o:p></span></p>
  230. <p><span style='font-size:10.0pt;font-family:Verdana'>Browse to the
  231. drive/directory containing the files listed above. Click <b>OK</b>. This should
  232. show �<span class=SpellE>Passthru</span> Driver� in a list of Network Services.
  233. Highlight this and click <b>OK</b>. This should install the <span class=SpellE>Passthru</span>
  234. driver. <o:p></o:p></span></p>
  235. <p><span style='font-size:10.0pt;font-family:Verdana'>Click <b>OK</b> or <span
  236. class=GramE><b>Yes</b></span> each time the system prompts with a warning
  237. regarding installation of unsigned files. This is necessary because binaries
  238. generated via the DDK build environment are not signed.<o:p></o:p></span></p>
  239. <p><span style='font-size:10.0pt;font-family:Verdana'>Two .INF files are needed
  240. rather than one because <span class=SpellE>Passthru</span> is installed both as
  241. a protocol and a miniport.<o:p></o:p></span></p>
  242. <h3><span style='font-family:Verdana'>CODE TOUR<o:p></o:p></span></h3>
  243. <h4><span style='font-family:Verdana'>File Manifest<o:p></o:p></span></h4>
  244. <pre><u>File<span style='mso-tab-count:2'>���������� </span>Description<o:p></o:p></u></pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  245. class=SpellE>Makefile</span><span style='mso-tab-count:1'>������ </span>Used during compilation to create the object and sys files</pre><pre><span
  246. class=SpellE>Miniport.c</span><span style='mso-tab-count:1'>���� </span>Miniport related functions of the <span
  247. class=SpellE>passthru</span> driver</pre><pre><span class=SpellE>Netsf.inf</span><span
  248. style='mso-tab-count:1'>����� </span>Installation INF for the service (protocol side installation)</pre><pre><span
  249. class=SpellE>Netsf_m.inf</span><span style='mso-tab-count:1'>��� </span>Installation INF for the miniport (virtual device installation)</pre><pre><span
  250. class=SpellE>Passthru.c</span><span style='mso-tab-count:1'>���� </span><span
  251. class=SpellE>DriverEntry</span> routine and any routines common to the <span
  252. class=SpellE>passthru</span> miniport and protocol </pre><pre><span
  253. class=SpellE>Passthru.h</span><span style='mso-tab-count:1'>���� </span>Prototypes of all functions and data structures used by the <span
  254. class=SpellE>Passthru</span> driver</pre><pre>Passthru.htm<span
  255. style='mso-tab-count:1'>�� </span>Documentation for the <span class=SpellE>Passthru</span> driver (this file)</pre><pre><span
  256. class=SpellE>Passthru.rc</span><span style='mso-tab-count:1'>��� </span>Resource <span
  257. class=GramE>file</span> for the <span class=SpellE>Passthru</span> driver</pre><pre><span
  258. class=SpellE>Precomp.h</span><span style='mso-tab-count:1'>����� </span><span
  259. class=SpellE>Precompile</span> header file</pre><pre><span class=SpellE>Protocol.c</span><span
  260. style='mso-tab-count:1'>���� </span>Protocol related functions of the <span
  261. class=SpellE>Passthru</span> driver</pre><pre>Sources<span style='mso-tab-count:
  262. 2'>������� </span>List of source files that are compiled and linked to create the <span
  263. class=SpellE>passthru</span> driver. This can be modified to create binaries that operate on previous Windows versions (e.g. Windows 2000).</pre>
  264. <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
  265. style='font-family:Verdana'>Programming Tour<o:p></o:p></span></h4>
  266. <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
  267. style='font-size:10.0pt;font-family:Verdana'>Basic steps in initializing and
  268. halting of <span class=SpellE>Passthru</span> driver:<o:p></o:p></span></p>
  269. <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
  270. style='font-size:10.0pt;font-family:Verdana'>1) During <span class=SpellE>DriverEntry</span>,
  271. the <span class=SpellE>Passthru</span> driver registers as a protocol and an
  272. Intermediate miniport driver.<o:p></o:p></span></p>
  273. <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
  274. style='font-size:10.0pt;font-family:Verdana'>2) Later on, NDIS calls <span
  275. class=SpellE>Passthru�s</span> <span class=SpellE>BindAdapterHandler</span>, <span
  276. class=SpellE>PtBindAdapter</span>, for each underlying NDIS adapter to which it
  277. is configured to bind.<o:p></o:p></span></p>
  278. <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
  279. style='font-size:10.0pt;font-family:Verdana'>3) In the context of <span
  280. class=SpellE>BindAdapterHandler</span> and after successfully opening a binding
  281. to the underlying adapter, the <span class=SpellE>Passthru</span> driver
  282. queries the reserved keyword &quot;<span class=SpellE>UpperBindings</span>&quot;
  283. to get a list of device names for the virtual adapters that this particular
  284. binding is to expose. Since this driver implements a 1:1 relationship between
  285. lower bindings and virtual adapters, this list contains a single name. �<span
  286. class=SpellE>Mux</span>� IM drivers that expose multiple virtual adapters over
  287. a single underlying adapter will process multiple entries in <span
  288. class=SpellE>UpperBindings</span>.<o:p></o:p></span></p>
  289. <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
  290. style='font-size:10.0pt;font-family:Verdana'>4) For each device name, the <span
  291. class=SpellE>Passthru</span> driver calls <span class=SpellE>NdisIMInitializeDeviceInstanceEx</span>.<o:p></o:p></span></p>
  292. <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
  293. style='font-size:10.0pt;font-family:Verdana'>5) In response, NDIS will
  294. eventually call back <span class=SpellE>Passthru</span> miniport�s <span
  295. class=SpellE>MiniportInitialize</span> entry point, <span class=SpellE>MPInitialize</span>.<o:p></o:p></span></p>
  296. <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
  297. style='font-size:10.0pt;font-family:Verdana'>6) After <span class=SpellE>MPInitialize</span>
  298. successfully returns, NDIS takes care of getting upper-layer protocols to bind
  299. to the newly created virtual adapter(s).<o:p></o:p></span></p>
  300. <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
  301. style='font-size:10.0pt;font-family:Verdana'>7) All requests and sends coming
  302. from upper-layer protocols for the <span class=SpellE>Passthru</span> miniport
  303. driver are repackaged and sent down to NDIS, to be passed to the underlying
  304. NDIS adapter.<o:p></o:p></span></p>
  305. <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
  306. style='font-size:10.0pt;font-family:Verdana'>8) All indications arriving from
  307. bindings to an underlying NDIS adapter are forwarded up as if they generated
  308. from <span class=SpellE>Passthru�s</span> virtual adapters.<o:p></o:p></span></p>
  309. <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
  310. style='font-size:10.0pt;font-family:Verdana'>9) NDIS calls the <span
  311. class=SpellE>Passthru</span> driver�s <span class=SpellE>ProtocolUnbind</span>
  312. entry point to request it to close the binding between an underlying adapter
  313. and <span class=SpellE>Passthru</span> protocol. In processing this, the <span
  314. class=SpellE>Passthru</span> driver first calls <span class=SpellE>NdisIMDeInitializeDeviceInstance</span>
  315. for the virtual adapter(s) representing that particular binding.<o:p></o:p></span></p>
  316. <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
  317. style='font-size:10.0pt;font-family:Verdana'>10) NDIS in turn will close all
  318. the bindings between upper-layer protocols and virtual <span class=SpellE>Passthru</span>
  319. adapter.<o:p></o:p></span></p>
  320. <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
  321. style='font-size:10.0pt;font-family:Verdana'>11) After all the bindings are
  322. closed, NDIS calls the <span class=SpellE>Passthru</span> driver�s <span
  323. class=SpellE>MiniportHalt</span> entry point (<span class=SpellE>MPHalt</span>)
  324. for the virtual adapter.<o:p></o:p></span></p>
  325. <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
  326. style='font-size:10.0pt;font-family:Verdana'>12) The <span class=SpellE>Passthru</span>
  327. protocol then closes the binding to the underlying adapter by calling <span
  328. class=SpellE>NdisCloseAdapter</span>, and completes the unbind request issued
  329. in step 9.<o:p></o:p></span></p>
  330. <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
  331. style='font-size:10.0pt;font-family:Verdana'>13) <b>Handling Power Management</b><o:p></o:p></span></p>
  332. <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
  333. style='font-size:10.0pt;font-family:Verdana'>13.1 During initialization, the <span
  334. class=SpellE>Passthru</span> miniport should set the Attribute '<i>NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND</i>'
  335. in its call to <span class=SpellE>NdisMSetAttributesEx</span>. <o:p></o:p></span></p>
  336. <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
  337. style='font-size:10.0pt;font-family:Verdana'>13.2 When the <span class=SpellE>Passthru</span>
  338. miniport is requested to report its Plug and Play capabilities
  339. (OID_PNP_CAPABILITIES), the <span class=SpellE>Passthru</span> miniport must
  340. pass the request to the underlying miniport. If this request succeeds, then the
  341. <span class=SpellE>Passthru</span> miniport should overwrite the following
  342. fields before successfully completing the original request: <o:p></o:p></span></p>
  343. <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
  344. style='font-size:10.0pt;font-family:Verdana'>NDIS_DEVICE_POWER_STATE<span
  345. style='mso-tab-count:1'>��������� </span><span class=SpellE>MinMagicPacketWakeUp</span>
  346. = <span class=SpellE>NdisDeviceStateUnspecified</span>;<o:p></o:p></span></p>
  347. <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
  348. style='font-size:10.0pt;font-family:Verdana'>NDIS_DEVICE_POWER_STATE<span
  349. style='mso-tab-count:1'>��������� </span><span class=SpellE>MinPatternWakeUp</span>=
  350. <span class=SpellE>NdisDeviceStateUnspecified</span>;<o:p></o:p></span></p>
  351. <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
  352. style='font-size:10.0pt;font-family:Verdana'>NDIS_DEVICE_POWER_STATE<span
  353. style='mso-tab-count:1'>��������� </span><span class=SpellE>MinLinkChangeWakeUp</span>=<span
  354. class=SpellE>NdisDeviceStateUnspecified</span><o:p></o:p></span></p>
  355. <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
  356. style='font-size:10.0pt;font-family:Verdana'>If the miniport below the <span
  357. class=SpellE>Passthru</span> protocol fails this request, then the status that
  358. was returned should be used to respond to the original request that was made to
  359. the <span class=SpellE>Passthru</span> miniport. <o:p></o:p></span></p>
  360. <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
  361. style='font-size:10.0pt;font-family:Verdana'>13.3 OID_PNP_SET_POWER and OID_PNP_QUERY_POWER
  362. should not be passed to the miniport below the <span class=SpellE>Passthru</span>
  363. protocol, as those <span class=SpellE>miniports</span> will receive independent
  364. requests from NDIS.<o:p></o:p></span></p>
  365. <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
  366. style='font-size:10.0pt;font-family:Verdana'>13.4 NDIS calls the <span
  367. class=SpellE>Passthru</span> driver�s <span class=SpellE>ProtocolPnPEvent</span>
  368. entry point (<span class=SpellE>PtPnPHandler</span>) whenever the underlying adapter
  369. is transitioned to a different power state. If the underlying adapter is
  370. transitioning to a low power state, the IM driver should wait for all
  371. outstanding sends and requests to complete.<o:p></o:p></span></p>
  372. <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
  373. style='font-size:10.0pt;font-family:Verdana'>14) <b>NDIS 5.1 Features</b><o:p></o:p></span></p>
  374. <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
  375. style='font-size:10.0pt;font-family:Verdana'>14.1 All NDIS 5.1 features in <span
  376. class=SpellE>Passthru</span> are identified by #<span class=SpellE>ifdef</span>
  377. NDIS51 compiler directives. The following major features are illustrated (refer
  378. to the DDK documentation for more information on these):<o:p></o:p></span></p>
  379. <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'><b><span
  380. style='font-size:10.0pt;font-family:Verdana'>Packet stacking</span></b><span
  381. style='font-size:10.0pt;font-family:Verdana'>: this allows an IM driver to
  382. reuse a packet submitted to its protocol or miniport edge to forward data down
  383. (or up) to the adjacent layer.<o:p></o:p></span></p>
  384. <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'><b><span
  385. style='font-size:10.0pt;font-family:Verdana'>Canceling Sends</span></b><span
  386. style='font-size:10.0pt;font-family:Verdana'>: <span class=SpellE>Passthru</span>
  387. propagates send cancellations from protocols above it to lower <span
  388. class=SpellE>miniports</span>.<o:p></o:p></span></p>
  389. <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'><b><span
  390. style='font-size:10.0pt;font-family:Verdana'>PnP Event Propagation</span></b><span
  391. style='font-size:10.0pt;font-family:Verdana'>: <span class=SpellE>Passthru</span>
  392. propagates PnP events arriving at its protocol (lower) edge to higher layer
  393. protocols that are bound to its virtual adapter.<o:p></o:p></span></p>
  394. <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
  395. class=SpellE><b><span style='font-size:10.0pt;font-family:Verdana'>NdisQueryPendingIOCount</span></b></span><span
  396. style='font-size:10.0pt;font-family:Verdana'>: <span class=SpellE>Passthru</span>
  397. uses this new API to determine if any I/O operations are in progress on its
  398. lower binding.<o:p></o:p></span></p>
  399. <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
  400. style='font-size:10.0pt;font-family:Verdana'>15) For Win2K SP2 and <span
  401. class=SpellE>WinXP</span>, the <span class=SpellE>Passthru</span> sample no
  402. longer requires a Notify Object. The Notify Object has been removed. <o:p></o:p></span></p>
  403. <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
  404. style='font-size:10.0pt;font-family:Verdana'><span
  405. style='mso-spacerun:yes'>�</span><o:p></o:p></span></p>
  406. <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'><a
  407. href="#top"><span style='font-size:10.0pt;font-family:Verdana'>Top of page</span></a><span
  408. style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
  409. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=624
  410. style='width:6.5in;mso-cellspacing:0in;mso-padding-alt:0in 0in 0in 0in'>
  411. <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes;height:1.5pt'>
  412. <td style='background:aqua;padding:.75pt .75pt .75pt .75pt;height:1.5pt'>
  413. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  414. </td>
  415. </tr>
  416. </table>
  417. <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
  418. style='font-size:7.5pt;font-family:"MS Sans Serif"'>� 1999 Microsoft
  419. Corporation</span><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
  420. </div>
  421. </body>
  422. </html>