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