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.

265 lines
13 KiB

  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
  2. <html xmlns:v="urn:schemas-microsoft-com:vml"
  3. xmlns:o="urn:schemas-microsoft-com:office:office"
  4. xmlns:w="urn:schemas-microsoft-com:office:word"
  5. xmlns="http://www.w3.org/TR/REC-html40">
  6. <head>
  7. <meta http-equiv=Content-Type content="text/html; charset=us-ascii">
  8. <meta name=ProgId content=Word.Document>
  9. <meta name=Generator content="Microsoft Word 9">
  10. <meta name=Originator content="Microsoft Word 9">
  11. <link rel=File-List href="./wiacam_files/filelist.xml">
  12. <title>wiacam</title>
  13. <!--[if gte mso 9]><xml>
  14. <o:DocumentProperties>
  15. <o:LastAuthor>Dave Parsons</o:LastAuthor>
  16. <o:Revision>2</o:Revision>
  17. <o:TotalTime>3262</o:TotalTime>
  18. <o:Created>2001-01-12T19:57:00Z</o:Created>
  19. <o:LastSaved>2001-01-12T19:57:00Z</o:LastSaved>
  20. <o:Pages>2</o:Pages>
  21. <o:Words>502</o:Words>
  22. <o:Characters>2864</o:Characters>
  23. <o:Company>Microsoft Corp.</o:Company>
  24. <o:Lines>23</o:Lines>
  25. <o:Paragraphs>5</o:Paragraphs>
  26. <o:CharactersWithSpaces>3517</o:CharactersWithSpaces>
  27. <o:Version>9.3821</o:Version>
  28. </o:DocumentProperties>
  29. </xml><![endif]--><!--[if gte mso 9]><xml>
  30. <w:WordDocument>
  31. <w:HideSpellingErrors/>
  32. <w:HideGrammaticalErrors/>
  33. </w:WordDocument>
  34. </xml><![endif]-->
  35. <style>
  36. <!--
  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. color:black;}
  47. h1
  48. {margin-right:0in;
  49. mso-margin-top-alt:auto;
  50. mso-margin-bottom-alt:auto;
  51. margin-left:0in;
  52. mso-pagination:widow-orphan;
  53. mso-outline-level:1;
  54. font-size:24.0pt;
  55. font-family:"Times New Roman";
  56. color:black;
  57. mso-font-kerning:18.0pt;
  58. font-weight:bold;}
  59. h2
  60. {margin-right:0in;
  61. mso-margin-top-alt:auto;
  62. mso-margin-bottom-alt:auto;
  63. margin-left:0in;
  64. mso-pagination:widow-orphan;
  65. mso-outline-level:2;
  66. font-size:18.0pt;
  67. font-family:"Times New Roman";
  68. color:black;
  69. font-weight:bold;}
  70. h3
  71. {margin-right:0in;
  72. mso-margin-top-alt:auto;
  73. mso-margin-bottom-alt:auto;
  74. margin-left:0in;
  75. mso-pagination:widow-orphan;
  76. mso-outline-level:3;
  77. font-size:13.5pt;
  78. font-family:"Times New Roman";
  79. color:black;
  80. font-weight:bold;}
  81. a:link, span.MsoHyperlink
  82. {color:blue;
  83. text-decoration:underline;
  84. text-underline:single;}
  85. a:visited, span.MsoHyperlinkFollowed
  86. {color:blue;
  87. text-decoration:underline;
  88. text-underline:single;}
  89. p
  90. {margin-right:0in;
  91. mso-margin-top-alt:auto;
  92. mso-margin-bottom-alt:auto;
  93. margin-left:0in;
  94. mso-pagination:widow-orphan;
  95. font-size:12.0pt;
  96. font-family:"Times New Roman";
  97. mso-fareast-font-family:"Times New Roman";
  98. color:black;}
  99. pre
  100. {margin:0in;
  101. margin-bottom:.0001pt;
  102. mso-pagination:widow-orphan;
  103. 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;
  104. font-size:10.0pt;
  105. font-family:"Courier New";
  106. mso-fareast-font-family:"Courier New";
  107. color:black;}
  108. @page Section1
  109. {size:8.5in 11.0in;
  110. margin:1.0in 1.25in 1.0in 1.25in;
  111. mso-header-margin:.5in;
  112. mso-footer-margin:.5in;
  113. mso-paper-source:0;}
  114. div.Section1
  115. {page:Section1;}
  116. /* List Definitions */
  117. @list l0
  118. {mso-list-id:371000526;
  119. mso-list-type:hybrid;
  120. mso-list-template-ids:619977120 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
  121. @list l1
  122. {mso-list-id:745304408;
  123. mso-list-type:hybrid;
  124. mso-list-template-ids:501628894 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
  125. @list l2
  126. {mso-list-id:1382750078;
  127. mso-list-type:hybrid;
  128. mso-list-template-ids:-98557440 -1634539084 1364493882 -555997176 1048594918 1907263124 1809221600 353402950 -1899568204 803906870;}
  129. ol
  130. {margin-bottom:0in;}
  131. ul
  132. {margin-bottom:0in;}
  133. -->
  134. </style>
  135. <!--[if gte mso 9]><xml>
  136. <o:shapedefaults v:ext="edit" spidmax="1027"/>
  137. </xml><![endif]--><!--[if gte mso 9]><xml>
  138. <o:shapelayout v:ext="edit">
  139. <o:idmap v:ext="edit" data="1"/>
  140. </o:shapelayout></xml><![endif]-->
  141. </head>
  142. <body bgcolor=white lang=EN-US link=blue vlink=blue style='tab-interval:.5in'
  143. leftmargin=8>
  144. <div class=Section1>
  145. <h1><a name=MYSAMPLE>Sample WIA Camera Driver</a></h1>
  146. <h1><span style='font-size:14.0pt;mso-bidi-font-size:24.0pt;color:red'>[This is
  147. preliminary documentation and subject to change.]<o:p></o:p></span></h1>
  148. <h2>SUMMARY</h2>
  149. <p>This sample shows how to write a Windows Image Acquisition (WIA) user-mode
  150. minidriver for a camera. It simulates a camera by reading images from a directory
  151. on the hard disk. This sample driver can be used as a starting point for your
  152. development, but your driver should access the camera hardware through one of
  153. the kernel drivers provided with Windows.</p>
  154. <p>This sample is implemented in 3 parts. This part is the main minidriver.
  155. The &#8220;Fakecam&#8221; sample implements a camera microdriver that this driver calls.
  156. The third part is the sample UI extension &#8220;Extend.&#8221;</p>
  157. <p>This sample will not work on Windows 98 or Windows 2000.</p>
  158. <h3>BUILDING THE SAMPLE</h3>
  159. <p>To build the sample follow these steps:</p>
  160. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  161. tab-stops:list .5in'><![if !supportLists]>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  162. </span><![endif]>In the Start menu, select<span style="mso-spacerun:
  163. yes">&nbsp; </span>&quot;Free Build Environment&quot; or &quot;Checked Build
  164. Environment&quot; under &quot;Windows DDK&quot; to open a command window and
  165. set basic environment variables needed to build drivers. </p>
  166. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  167. tab-stops:list .5in'><![if !supportLists]>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  168. </span><![endif]>Change to the directory containing the sample driver source
  169. code, src\wdm\wia\wiacam.</p>
  170. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  171. tab-stops:list .5in'><![if !supportLists]>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  172. </span><![endif]>Execute the &quot;build&quot; command. After the build
  173. completes, a driver named Wiacam.dll will be located in an object subdirectory.</p>
  174. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
  175. tab-stops:list .5in'><![if !supportLists]>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  176. </span><![endif]>Also build the microdriver in src\wdm\wia\fakecam and the user
  177. interface extension located in the src\wdm\wia\extend directory.</p>
  178. <h3>USING THE SAMPLE<o:p></o:p></h3>
  179. <p><! ---------------- Snip Snip ---------------- >To use the driver, first
  180. install it following these steps: </p>
  181. <ol start=1 type=1>
  182. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  183. mso-list:l2 level1 lfo5;tab-stops:list .5in'>Copy Wiacam.dll from the
  184. appropriate object subdirectory under Wiacam to a new, empty directory.</li>
  185. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  186. mso-list:l2 level1 lfo5;tab-stops:list .5in'>Do the same with Extend.dll
  187. and Fakecam.dll.</li>
  188. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  189. mso-list:l2 level1 lfo5;tab-stops:list .5in'>Copy Wiacam.inf to the same
  190. directory.</li>
  191. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  192. mso-list:l2 level1 lfo5;tab-stops:list .5in'>In Windows Me or Windows XP,
  193. open the &#8220;New Device&#8221; icon in the Scanners and Cameras control panel.</li>
  194. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  195. mso-list:l2 level1 lfo5;tab-stops:list .5in'>Click the &#8220;Have Disk&#8221; button
  196. and enter the name of the folder created in step 1.</li>
  197. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  198. mso-list:l2 level1 lfo5;tab-stops:list .5in'>Click OK, Next, or Finish
  199. until the wizard is finished.</li>
  200. </ol>
  201. <p>Sample camera driver reads images from <i>"image"</i> directory of the profile folder of LOCAL SERVICE account. The default location of this directory
  202. is <i>"c:\Documents and Settings\LocalService\image"</i>, however it may be different on a particular Windows installation. You may need to enable viewing of hidden and protected
  203. OS files in order to browse this folder (to do so, open Windows Explorer, choose <i>Tools, Folder Options, View</i>, then check <i>"Show hidden files and folders"</i>, and uncheck
  204. <i>"Hide protected operating system files"</i>).</p>
  205. <p>Use one of these options to test this driver:</p>
  206. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo7;
  207. tab-stops:list .5in'><![if !supportLists]>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  208. </span><![endif]>The Scanners and Cameras Wizard accessible from the Start
  209. menu.</p>
  210. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo7;
  211. tab-stops:list .5in'><![if !supportLists]>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  212. </span><![endif]>The Namespace extension accessible by opening the camera in
  213. Explorer.</p>
  214. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo7;
  215. tab-stops:list .5in'><![if !supportLists]>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  216. </span><![endif]>The Wiatest application provided in this DDK.</p>
  217. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo7;
  218. tab-stops:list .5in'><![if !supportLists]>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  219. </span><![endif]>Microsoft Paint, a native WIA application.</p>
  220. <p style='margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo7;
  221. tab-stops:list .5in'><![if !supportLists]>5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  222. </span><![endif]>Any TWAIN compliant application.</p>
  223. <h3>RESOURCES</h3>
  224. <p>WIA information: <a href="http://www.microsoft.com/hwdev/tech/wia">http://www.microsoft.com/hwdev/tech/wia</a></p>
  225. <p>DDK information: <a href="http://www.microsoft.com/ddk/">http://www.microsoft.com/ddk/</a></p>
  226. <h3>CODE TOUR</h3>
  227. <h3>File Manifest</h3>
  228. <pre>Files<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Description</pre><pre>------------<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>-------------------------------------------------------</pre><pre>CCamMicro.cpp<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>Implements wrapper for microdriver DLL</pre><pre>CcamMicro.h<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Header for microdriver DLL wrapper</pre><pre>Child.cpp<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Implements functions for non-root items</pre><pre>IStiUSD.cpp<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Implements STI interfaces</pre><pre>IWiaMiniDrv.cpp<span style="mso-spacerun: yes">&nbsp; </span>Implements WIA interfaces</pre><pre>Makefile<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Used for building the driver--do not modify</pre><pre>pch.h<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Precompiled header</pre><pre>resource.h<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Header file for resources</pre><pre>Root.cpp<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Implements functions for root item</pre><pre>Sources<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Controls building of driver</pre><pre>wiacam.cpp<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Implements COM and DLL functions</pre><pre>wiacam.def<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Linker command file</pre><pre>wiacam.h<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Main header for driver</pre><pre>wiacam.htm<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>This readme</pre><pre>wiacam.inf<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Installation file</pre><pre>wiacam.rc<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Resource definitions</pre><pre>wiacam.rcv<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Additional resource definitions</pre><pre><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></pre>
  229. </div>
  230. </body>
  231. </html>