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.

320 lines
18 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 10">
  8. <meta name=Originator content="Microsoft Word 10">
  9. <link rel=File-List href="BDATuner_files/filelist.xml">
  10. <title>BDA Sample Generic Tuner Driver</title>
  11. <!--[if gte mso 9]><xml>
  12. <w:WordDocument>
  13. <w:SpellingState>Clean</w:SpellingState>
  14. <w:GrammarState>Clean</w:GrammarState>
  15. <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  16. </w:WordDocument>
  17. </xml><![endif]-->
  18. <style>
  19. <!--
  20. /* Font Definitions */
  21. @font-face
  22. {font-family:Verdana;
  23. panose-1:2 11 6 4 3 5 4 4 2 4;
  24. mso-font-charset:0;
  25. mso-generic-font-family:swiss;
  26. mso-font-pitch:variable;
  27. mso-font-signature:536871559 0 0 0 415 0;}
  28. @font-face
  29. {font-family:"MS Sans Serif";
  30. panose-1:0 0 0 0 0 0 0 0 0 0;
  31. mso-font-alt:"Times New Roman";
  32. mso-font-charset:0;
  33. mso-generic-font-family:roman;
  34. mso-font-format:other;
  35. mso-font-pitch:auto;
  36. mso-font-signature:0 0 0 0 0 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. {mso-margin-top-alt:auto;
  48. margin-right:0in;
  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. {mso-margin-top-alt:auto;
  58. margin-right:0in;
  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. p
  67. {mso-margin-top-alt:auto;
  68. margin-right:0in;
  69. mso-margin-bottom-alt:auto;
  70. margin-left:0in;
  71. mso-pagination:widow-orphan;
  72. font-size:12.0pt;
  73. font-family:"Times New Roman";
  74. mso-fareast-font-family:"Times New Roman";}
  75. pre
  76. {margin-top:0in;
  77. margin-bottom:0in;
  78. margin-bottom:.0001pt;
  79. font-size:10.0pt;
  80. font-family:"Courier New";
  81. mso-fareast-font-family:"Times New Roman";}
  82. span.SpellE
  83. {mso-style-name:"";
  84. mso-spl-e:yes;}
  85. span.GramE
  86. {mso-style-name:"";
  87. mso-gram-e:yes;}
  88. @page Section1
  89. {size:8.5in 11.0in;
  90. margin:1.0in 1.25in 1.0in 1.25in;
  91. mso-header-margin:.5in;
  92. mso-footer-margin:.5in;
  93. mso-paper-source:0;}
  94. div.Section1
  95. {page:Section1;}
  96. -->
  97. </style>
  98. <!--[if gte mso 10]>
  99. <style>
  100. /* Style Definitions */
  101. table.MsoNormalTable
  102. {mso-style-name:"Table Normal";
  103. mso-tstyle-rowband-size:0;
  104. mso-tstyle-colband-size:0;
  105. mso-style-noshow:yes;
  106. mso-style-parent:"";
  107. mso-padding-alt:0in 5.4pt 0in 5.4pt;
  108. mso-para-margin:0in;
  109. mso-para-margin-bottom:.0001pt;
  110. mso-pagination:widow-orphan;
  111. font-size:10.0pt;
  112. font-family:"Times New Roman";}
  113. </style>
  114. <![endif]-->
  115. <meta name=Template content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
  116. </head>
  117. <body lang=EN-US link=blue vlink=blue style='tab-interval:.5in' topmargin=0>
  118. <div class=Section1>
  119. <h2><a name=MYSAMPLE><span style='font-family:Verdana'>BDA Sample Generic Tuner
  120. Driver</span></a><span style='font-family:Verdana'> <o:p></o:p></span></h2>
  121. <h3><span style='font-family:Verdana'>SUMMARY<o:p></o:p></span></h3>
  122. <p><span style='font-size:10.0pt;font-family:Verdana'>This sample is the source
  123. code for a generic tuner sample Broadcast Driver Architecture (BDA) driver for
  124. Windows� XP. It is provided as an example of a BDA device <span class=SpellE>minidriver</span>
  125. for the <span class=SpellE>AVStream</span> class of kernel streaming and to
  126. give hardware vendors assistance in writing their own BDA <span class=SpellE>minidrivers</span>.
  127. This sample does not have any associated hardware.<span
  128. style='mso-spacerun:yes'>� </span>The driver is designed to work the sample BDA
  129. Capture driver.<o:p></o:p></span></p>
  130. <h3><span style='font-family:Verdana'>BUILDING THE SAMPLE<o:p></o:p></span></h3>
  131. <p><span style='font-size:10.0pt;font-family:Verdana'>To build the sample, open
  132. a DDK command window, change to the BDA directory, and use the <b>build</b>
  133. command. The build command gets instructions on how to build from the <a
  134. href="#sources">Sources file</a>. <o:p></o:p></span></p>
  135. <p><span style='font-size:10.0pt;font-family:Verdana'>This sample can be built
  136. as either an ATSC sample or a DVB-S sample.<span style='mso-spacerun:yes'>
  137. </span>To select the flavor of sample simply uncomment the appropriate MACRO
  138. definition (ATSC_RECEIVER or DVBS_RECEIVER) in <span class=SpellE>BDATuner.h</span>.<span
  139. style='mso-spacerun:yes'>�� </span>Make sure only one of the receiver type <span
  140. class=SpellE>MACROs</span> is defined.<span style='mso-spacerun:yes'></span>Building
  141. this sample produces one file: <span class=SpellE>BDATuner.sys</span>. Both
  142. free and checked versions can be built.<o:p></o:p></span></p>
  143. <p><span style='font-size:10.0pt;font-family:Verdana'>The best way to use the
  144. sample BDA tuner driver is to build both <span class=SpellE>BDATuner.sys</span>
  145. and <span class=SpellE>BDACap.sys</span>.<span style='mso-spacerun:yes'>
  146. </span>Copy these to a directory along with the sample BDA tuner INF (<span
  147. class=SpellE>BDATuner.inf</span>), sample BDA capture <span class=GramE>INF(</span><span
  148. class=SpellE>BDACap.inf</span>), and software receiver INF (<span class=SpellE>BDASWRcv.inf</span>).<span
  149. style='mso-spacerun:yes'>� </span>Start the installation by right clicking <span
  150. class=SpellE>BDASWRcv.inf</span> and then left clicking Install.<span
  151. style='mso-spacerun:yes'>� </span>Follow the direction to complete installation
  152. of both the sample BDA tuner and sample BDA capture drivers.<o:p></o:p></span></p>
  153. <h3><span style='font-family:Verdana'>TOOLS<o:p></o:p></span></h3>
  154. <p><span class=SpellE><span style='font-size:10.0pt;font-family:Verdana'>GraphEdit</span></span><span
  155. style='font-size:10.0pt;font-family:Verdana'> uses the BDA sample generic tuner
  156. driver to configure a filter for the driver in a filter graph. This BDA sample
  157. generic tuner filter does not perform any specific functions. You can connect
  158. the BDA ATSC or DVB-S network provider filters to the input pin of the generic
  159. filter. You can connect the BDA capture filter to the output pin of the BDA
  160. tuner filter.<o:p></o:p></span></p>
  161. <p><span style='font-size:10.0pt;font-family:Verdana'>The sample BDA capture appears
  162. under &quot;BDA Receiver Components&quot; as &quot;Sample BDA Capture&quot;.<span
  163. style='mso-spacerun:yes'>� </span>The sample BDA tuner appears under �BDA
  164. Source Filters� as �Sample BDA Tuner Filter�.<span style='mso-spacerun:yes'>
  165. </span>The ATSC Network Provider appears under �BDA Network Providers� as �Microsoft
  166. ATSC Network Provider�.<span style='mso-spacerun:yes'></span>The DVB-S
  167. Network Provider appears under �BDA Network Providers� as �Microsoft DVBS
  168. Network Provider�.<o:p></o:p></span></p>
  169. <p><span style='font-size:10.0pt;font-family:Verdana'>Many properties can be set
  170. on your filter by right-clicking the Network Provider filter in <span
  171. class=SpellE>GraphEdt</span> and selecting Properties.<span
  172. style='mso-spacerun:yes'>� </span>The displayed property pages allow for the
  173. creation and submission of tune requests that ultimately result in properties
  174. being set on your driver.<span style='mso-spacerun:yes'></span>Note that, if
  175. you are testing a DVB-S driver, you should use the DVBS Network Provider
  176. property pages to create ad DVB-S tuning space called �MYDVB�. To access these
  177. properties you must first run Regsvr32 on PropPage.dll which is delivered in
  178. the Direct Show SDK. <span style='mso-spacerun:yes'></span>You can also create
  179. a <span class=SpellE>plugin</span> to directly access and configure the BDA
  180. sample generic tuner filter.<o:p></o:p></span></p>
  181. <h3><span style='font-family:Verdana'>RESOURCES<o:p></o:p></span></h3>
  182. <p><span style='font-size:10.0pt;font-family:Verdana'>To get a logo for your
  183. device, consult the <a href="http://www.microsoft.com/hwtest">WHQL Web site</a>
  184. for information and test suites.<o:p></o:p></span></p>
  185. <p><span style='font-size:10.0pt;font-family:Verdana'>Your device should
  186. support Plug and Play. Download Plug and Play specs from their <a
  187. href="http://www.microsoft.com/hwdev/respec/pnpspecs.htm">Web site</a>.<o:p></o:p></span></p>
  188. <h3><span style='font-family:Verdana'>CODE TOUR<o:p></o:p></span></h3>
  189. <h4><span style='font-family:Verdana'>File Manifest<o:p></o:p></span></h4>
  190. <pre><u>File<span style='mso-tab-count:2'>���������� </span><span style='mso-spacerun:yes'>���� </span>Description<o:p></o:p></u></pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  191. class=SpellE>Bdadebug.h</span><span style='mso-tab-count:1'>���� </span>Contains macros that the driver uses for debugging</pre><pre>BdaTuner.htm<span
  192. style='mso-tab-count:1'>�� </span>The documentation for this sample (this file)</pre><pre><span
  193. class=SpellE>Bdaguid.c</span><span style='mso-tab-count:1'>����� </span>Includes header files used for defining <span
  194. class=SpellE>GUIDs</span></pre><pre><span class=SpellE>BDATuner.h</span><span
  195. style='mso-tab-count:1'>���� </span>Defines classes for filter, device, and filter I/O pins.</pre><pre><span
  196. class=SpellE>BDATuner.inf</span><span style='mso-tab-count:1'>�� </span>Installation information for the sample</pre><pre><span
  197. class=SpellE>BDATuner.rc</span><span style='mso-tab-count:1'>��� </span>Version information resource</pre><pre><span
  198. class=SpellE>Common.h</span><span style='mso-tab-count:1'>������ </span>Includes necessary header files, like <span
  199. class=SpellE>Bdasup.h</span></pre><pre><span class=SpellE>Device.cpp</span><span
  200. style='mso-tab-count:1'>���� </span>Main code of BDA device, including driver-entry point</pre><pre><span
  201. class=SpellE>Filter.cpp</span><span style='mso-tab-count:1'>���� </span>Implements methods of the filter class </pre><pre><span
  202. class=SpellE>Inpin.cpp</span><span style='mso-tab-count:1'>����� </span>Implements the class for the input pin</pre><pre><span
  203. class=SpellE>Makefile</span><span style='mso-tab-count:1'>������ </span>The <span
  204. class=SpellE>makefile</span> for the project; do not edit.</pre><pre><span
  205. class=SpellE>ObjDesc.cpp</span><span style='mso-tab-count:1'>��� </span>Defines automation and dispatch tables and template structures</pre><pre><span
  206. class=SpellE>Outpin.cpp</span><span style='mso-tab-count:1'>���� </span>Implements the class for the output pin</pre><pre>Sources<span
  207. style='mso-tab-count:1'> </span><span style='mso-spacerun:yes'>������� </span>DDK build instructions</pre><pre><span
  208. class=SpellE>Splmedia.h</span><span style='mso-tab-count:1'>���� </span>Defines properties, methods, and events for </pre><pre><span style='mso-spacerun:yes'>���������������</span><span style='mso-spacerun:yes'>����</span><span
  209. class=GramE>the</span> sample's nodes</pre><pre><span class=SpellE>Wdmdebug.h</span><span
  210. style='mso-tab-count:1'>���� </span>Contains macros for WDM debugging</pre><pre><o:p>&nbsp;</o:p></pre>
  211. <h4><span style='font-family:Verdana'>Programming Tour<o:p></o:p></span></h4>
  212. <p><span style='font-size:10.0pt;font-family:Verdana'>The <span class=SpellE>ObjDesc.cpp</span>
  213. file contains definitions and templates that the network provider filter can use
  214. to determine topology, to configure and change a filter instance, and to
  215. manipulate the sample's nodes. The BDA sample software tuner driver registers
  216. these definitions and templates with the BDA support library so the library can
  217. handle most aspects of these operations. Other files of this sample define
  218. constants, structures, and classes and implement methods for those classes. <o:p></o:p></span></p>
  219. <h4><a name=sources><span style='font-family:Verdana'>Sources File</span></a><span
  220. style='font-family:Verdana'><o:p></o:p></span></h4>
  221. <p><span style='font-size:10.0pt;font-family:Verdana'>The <!--A HREF="sources"-->Sources<!--/a-->
  222. file contains instructions on how to build the BDA sample software tuner
  223. driver. The following code shows the macros used in the Sources file along with
  224. comments that explain what those macros do.<o:p></o:p></span></p>
  225. <pre><o:p>&nbsp;</o:p></pre><pre><span style='mso-tab-count:1'>������� </span>TARGETNAME=<span
  226. class=SpellE><span class=GramE>BDATuner</span></span><span class=GramE><span style='mso-spacerun:yes'></span>#</span> Set driver's name</pre><pre><span
  227. style='mso-tab-count:1'>������� </span>TARGETTYPE=DRIVER<span style='mso-spacerun:yes'>��� </span># Set type of file built, for example, program, DLL, or driver</pre><pre><span
  228. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>�������������������� </span># For BDA <span
  229. class=SpellE><span class=GramE>minidriver</span></span><span class=GramE>,</span> set to DRIVER.</pre><pre><span
  230. style='mso-tab-count:1'>������� </span>TARGETPATH=<span class=SpellE>obj</span>$(BUILD_ALT_DIR<span
  231. class=GramE>)<span style='mso-spacerun:yes'></span>#</span> Set destination directory for the built file</pre><pre><span
  232. style='mso-tab-count:1'>������� </span> # Depending on whether your build environment is &quot;free&quot; or &quot;checked&quot;,</pre><pre><span
  233. style='mso-tab-count:1'>������� </span> # the BUILD_ALT_DIR variable appends &quot;<span
  234. class=SpellE>fre</span>&quot; or &quot;<span class=SpellE>chk</span>&quot; to the \<span
  235. class=SpellE>obj</span> subdirectory.</pre><pre><span style='mso-tab-count:
  236. 1'>������� </span>DRIVERTYPE=<span class=GramE>WDM<span style='mso-spacerun:yes'></span>#</span> Set type of driver, can be set to either WDM or VXD.</pre><pre><span
  237. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>��������������� </span># For <span
  238. class=GramE>BDA,</span> set to WDM.</pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  239. style='mso-tab-count:1'>������� </span># Generate .SYM and .PDB (map) files.<span style='mso-spacerun:yes'></span>These files map names to addresses. </pre><pre><span
  240. style='mso-tab-count:1'>������� </span># <span class=GramE>Required</span> to debug on Win9x.</pre><pre><span
  241. style='mso-tab-count:1'>������� </span>USE_MAPSYM=1<span style='mso-spacerun:yes'></span></pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  242. style='mso-tab-count:1'>������� </span># Point to the header files that the sample source requires. </pre><pre><span
  243. style='mso-tab-count:1'>������� </span>INCLUDES=<span class=GramE>..</span>\..\..\..\inc; \</pre><pre><span
  244. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'></span>$(DDK_INC_PATH)\<span
  245. class=SpellE>wdm</span>; </pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  246. style='mso-tab-count:1'>������� </span># Point to the library files that the sample source requires. </pre><pre><span
  247. style='mso-tab-count:1'>������� </span>TARGETLIBS=<span class=GramE>..</span>\..\..\..\lib\<span
  248. class=SpellE>ks.lib</span> \</pre><pre><span style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>���� </span>..\..\..\..\lib\<span
  249. class=SpellE>ksguid.lib</span> \</pre><pre><span style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>����� </span>..\..\..\..\lib\<span
  250. class=SpellE>BdaSup.lib</span></pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  251. style='mso-tab-count:1'>������� </span># <span class=GramE>The</span> following macros are used with the Soft-ICE debugging tool.</pre><pre><span
  252. style='mso-tab-count:1'>������� </span>!<span class=SpellE>ifdef</span> BUILD_SOFTICE_SYMBOLS</pre><pre><span
  253. style='mso-tab-count:1'>������� </span>TARGETPATHEX=$(TARGETPATH)\$(TARGET_DIRECTORY)</pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  254. style='mso-tab-count:1'>������� </span>NTTARGETFILES=$(TARGETPATH)\$(TARGETNAME).<span
  255. class=SpellE>dbg</span></pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  256. style='mso-tab-count:1'>������� </span>NTTARGETFILES=$(TARGETPATHEX)\$(TARGETNAME).<span
  257. class=SpellE>nms</span> $(NTTARGETFILES)</pre><pre><span style='mso-tab-count:
  258. 1'>������� </span>!<span class=SpellE>endif</span></pre><pre><o:p>&nbsp;</o:p></pre><pre><span
  259. style='mso-tab-count:1'>������� </span><span class=GramE># Sample source files that must be compiled.</span></pre><pre><span
  260. style='mso-tab-count:1'>������� </span>SOURCES= \</pre><pre><span
  261. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>��� </span><span
  262. class=SpellE>ObjDesc.cpp</span><span style='mso-spacerun:yes'>���� </span>\</pre><pre><span
  263. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>��� </span><span
  264. class=SpellE>inpin.cpp</span><span style='mso-spacerun:yes'>���� </span>\</pre><pre><span
  265. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>��� </span><span
  266. class=SpellE>outpin.cpp</span><span style='mso-spacerun:yes'>��� </span>\</pre><pre><span
  267. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>��� </span><span
  268. class=SpellE>Filter.cpp</span><span style='mso-spacerun:yes'>����� </span>\</pre><pre><span
  269. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>��� </span><span
  270. class=SpellE>Device.cpp</span><span style='mso-spacerun:yes'>����� </span>\</pre><pre><span
  271. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>��� </span><span
  272. class=SpellE>bdaguid.c</span><span style='mso-spacerun:yes'>������ </span>\</pre><pre><span
  273. style='mso-tab-count:1'>������� </span><span style='mso-spacerun:yes'>��� </span><span
  274. class=SpellE>BDATuner.rc</span></pre>
  275. <p align=center style='text-align:center'><span style='font-size:10.0pt;
  276. font-family:Verdana'><a href="#top">Top of page</a> <o:p></o:p></span></p>
  277. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=624
  278. style='width:6.5in;mso-cellspacing:0in'>
  279. <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes;height:1.5pt'>
  280. <td style='background:aqua;padding:.75pt .75pt .75pt .75pt;height:1.5pt'>
  281. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  282. </td>
  283. </tr>
  284. </table>
  285. <p><span style='font-size:7.5pt;font-family:"MS Sans Serif"'>� 2000 Microsoft
  286. Corporation</span><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
  287. </div>
  288. </body>
  289. </html>