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.
351 lines
19 KiB
351 lines
19 KiB
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
<html xmlns:v="urn:schemas-microsoft-com:vml"
|
|
xmlns:o="urn:schemas-microsoft-com:office:office"
|
|
xmlns:w="urn:schemas-microsoft-com:office:word"
|
|
xmlns="http://www.w3.org/TR/REC-html40">
|
|
|
|
<head>
|
|
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
|
|
<meta name=ProgId content=Word.Document>
|
|
<meta name=Generator content="Microsoft Word 9">
|
|
<meta name=Originator content="Microsoft Word 9">
|
|
<link rel=File-List href="./wiascroll_files/filelist.xml">
|
|
<title>Wiatscan</title>
|
|
<!--[if gte mso 9]><xml>
|
|
<o:DocumentProperties>
|
|
<o:Author>Dave Parsons</o:Author>
|
|
<o:LastAuthor>Cooper Partin</o:LastAuthor>
|
|
<o:Revision>2</o:Revision>
|
|
<o:TotalTime>333</o:TotalTime>
|
|
<o:Created>2000-09-21T16:10:00Z</o:Created>
|
|
<o:LastSaved>2000-09-21T16:10:00Z</o:LastSaved>
|
|
<o:Pages>2</o:Pages>
|
|
<o:Words>553</o:Words>
|
|
<o:Characters>3157</o:Characters>
|
|
<o:Company>Microsoft Corp.</o:Company>
|
|
<o:Lines>26</o:Lines>
|
|
<o:Paragraphs>6</o:Paragraphs>
|
|
<o:CharactersWithSpaces>3877</o:CharactersWithSpaces>
|
|
<o:Version>9.2720</o:Version>
|
|
</o:DocumentProperties>
|
|
</xml><![endif]--><!--[if gte mso 9]><xml>
|
|
<w:WordDocument>
|
|
<w:HideSpellingErrors/>
|
|
<w:HideGrammaticalErrors/>
|
|
</w:WordDocument>
|
|
</xml><![endif]-->
|
|
<style>
|
|
<!--
|
|
/* Style Definitions */
|
|
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
|
{mso-style-parent:"";
|
|
margin:0in;
|
|
margin-bottom:.0001pt;
|
|
mso-pagination:widow-orphan;
|
|
font-size:12.0pt;
|
|
font-family:"Times New Roman";
|
|
mso-fareast-font-family:"Times New Roman";
|
|
color:black;}
|
|
h1
|
|
{margin-right:0in;
|
|
mso-margin-top-alt:auto;
|
|
mso-margin-bottom-alt:auto;
|
|
margin-left:0in;
|
|
mso-pagination:widow-orphan;
|
|
mso-outline-level:1;
|
|
font-size:24.0pt;
|
|
font-family:"Times New Roman";
|
|
color:black;
|
|
mso-font-kerning:18.0pt;
|
|
font-weight:bold;}
|
|
h2
|
|
{margin-right:0in;
|
|
mso-margin-top-alt:auto;
|
|
mso-margin-bottom-alt:auto;
|
|
margin-left:0in;
|
|
mso-pagination:widow-orphan;
|
|
mso-outline-level:2;
|
|
font-size:18.0pt;
|
|
font-family:"Times New Roman";
|
|
color:black;
|
|
font-weight:bold;}
|
|
h3
|
|
{margin-right:0in;
|
|
mso-margin-top-alt:auto;
|
|
mso-margin-bottom-alt:auto;
|
|
margin-left:0in;
|
|
mso-pagination:widow-orphan;
|
|
mso-outline-level:3;
|
|
font-size:13.5pt;
|
|
font-family:"Times New Roman";
|
|
color:black;
|
|
font-weight:bold;}
|
|
a:link, span.MsoHyperlink
|
|
{color:blue;
|
|
text-decoration:underline;
|
|
text-underline:single;}
|
|
a:visited, span.MsoHyperlinkFollowed
|
|
{color:blue;
|
|
text-decoration:underline;
|
|
text-underline:single;}
|
|
p
|
|
{margin-right:0in;
|
|
mso-margin-top-alt:auto;
|
|
mso-margin-bottom-alt:auto;
|
|
margin-left:0in;
|
|
mso-pagination:widow-orphan;
|
|
font-size:12.0pt;
|
|
font-family:"Times New Roman";
|
|
mso-fareast-font-family:"Times New Roman";
|
|
color:black;}
|
|
pre
|
|
{margin:0in;
|
|
margin-bottom:.0001pt;
|
|
mso-pagination:widow-orphan;
|
|
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;
|
|
font-size:10.0pt;
|
|
font-family:"Courier New";
|
|
mso-fareast-font-family:"Courier New";
|
|
color:black;}
|
|
@page Section1
|
|
{size:8.5in 11.0in;
|
|
margin:1.0in 1.25in 1.0in 1.25in;
|
|
mso-header-margin:.5in;
|
|
mso-footer-margin:.5in;
|
|
mso-paper-source:0;}
|
|
div.Section1
|
|
{page:Section1;}
|
|
/* List Definitions */
|
|
@list l0
|
|
{mso-list-id:371000526;
|
|
mso-list-type:hybrid;
|
|
mso-list-template-ids:619977120 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
|
|
@list l1
|
|
{mso-list-id:566766583;
|
|
mso-list-type:hybrid;
|
|
mso-list-template-ids:1578417540 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
|
|
@list l1:level2
|
|
{mso-level-number-format:alpha-lower;
|
|
mso-level-tab-stop:1.0in;
|
|
mso-level-number-position:left;
|
|
text-indent:-.25in;}
|
|
@list l1:level3
|
|
{mso-level-number-format:roman-lower;
|
|
mso-level-tab-stop:1.5in;
|
|
mso-level-number-position:right;
|
|
text-indent:-9.0pt;}
|
|
@list l2
|
|
{mso-list-id:745304408;
|
|
mso-list-type:hybrid;
|
|
mso-list-template-ids:501628894 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
|
|
@list l3
|
|
{mso-list-id:1382750078;
|
|
mso-list-type:hybrid;
|
|
mso-list-template-ids:-98557440 -1634539084 1364493882 -555997176 1048594918 1907263124 1809221600 353402950 -1899568204 803906870;}
|
|
ol
|
|
{margin-bottom:0in;}
|
|
ul
|
|
{margin-bottom:0in;}
|
|
-->
|
|
</style>
|
|
<!--[if gte mso 9]><xml>
|
|
<o:shapedefaults v:ext="edit" spidmax="1027"/>
|
|
</xml><![endif]--><!--[if gte mso 9]><xml>
|
|
<o:shapelayout v:ext="edit">
|
|
<o:idmap v:ext="edit" data="1"/>
|
|
</o:shapelayout></xml><![endif]-->
|
|
</head>
|
|
|
|
<body bgcolor=white lang=EN-US link=blue vlink=blue style='tab-interval:.5in'
|
|
leftmargin=8>
|
|
|
|
<div class=Section1>
|
|
|
|
<h1><a name=MYSAMPLE>Sample WIA Scanner Driver</a> :</h1>
|
|
|
|
<h1>(scroll fed document feeders with an infinite page length)</h1>
|
|
|
|
<h1><span style='font-size:14.0pt;mso-bidi-font-size:24.0pt;color:red'>[This is
|
|
preliminary documentation and subject to change.]<o:p></o:p></span></h1>
|
|
|
|
<h2>SUMMARY</h2>
|
|
|
|
<p>This sample shows how to write a Windows Image Acquisition (WIA) user-mode minidriver
|
|
for a scanner. It simulates scanning by producing a test pattern image. This
|
|
sample driver is an excellent starting point for your development, but your
|
|
driver should access the scanner hardware through one of the kernel drivers
|
|
provided with Windows, Usbscan.sys or Scsiscan.sys, if possible.</p>
|
|
|
|
<p>At the time of this writing, WIA is only supported on Windows Me and
|
|
Windows XP. This sample will not work on Windows 98 or Windows 2000.</p>
|
|
|
|
<h3>SAMPLE FEATURES</h3>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo2;
|
|
tab-stops:list .5in'><![if !supportLists]>1.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Automatic document feeder capabilities</p>
|
|
|
|
<p style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo2;
|
|
tab-stops:list 1.0in'><![if !supportLists]>a.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Configure the feeder using the ADF.WIA config file.</p>
|
|
|
|
<p style='margin-left:1.5in;text-indent:-1.5in;mso-text-indent-alt:-9.0pt;
|
|
mso-list:l1 level3 lfo2;tab-stops:list 1.5in'><![if !supportLists]><span
|
|
style='font:7.0pt "Times New Roman"'>
|
|
</span>i.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Load the feeder with a specified number of pages</p>
|
|
|
|
<p style='margin-left:1.5in;text-indent:-1.5in;mso-text-indent-alt:-9.0pt;
|
|
mso-list:l1 level3 lfo2;tab-stops:list 1.5in'><![if !supportLists]><span
|
|
style='font:7.0pt "Times New Roman"'>
|
|
</span>ii.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Set errors on the feeder, to test error returns.</p>
|
|
|
|
<p style='margin-left:2.0in;text-indent:-.25in;mso-list:l1 level4 lfo2;
|
|
tab-stops:list 2.0in'><![if !supportLists]>1.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Paper Jams (keyword “jam”)</p>
|
|
|
|
<p style='margin-left:2.0in;text-indent:-.25in;mso-list:l1 level4 lfo2;
|
|
tab-stops:list 2.0in'><![if !supportLists]>2.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Paper Empty (keyword “empty”)</p>
|
|
|
|
<p style='margin-left:2.0in;text-indent:-.25in;mso-list:l1 level4 lfo2;
|
|
tab-stops:list 2.0in'><![if !supportLists]>3.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>General Errors (keyword “general”)</p>
|
|
|
|
<p style='margin-left:2.0in;text-indent:-.25in;mso-list:l1 level4 lfo2;
|
|
tab-stops:list 2.0in'><![if !supportLists]>4.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Device offline (keyword “offline”)</p>
|
|
|
|
<p style='margin-left:1.5in;text-indent:-1.5in;mso-text-indent-alt:-9.0pt;
|
|
mso-list:l1 level3 lfo2;tab-stops:list 1.5in'><![if !supportLists]><span
|
|
style='font:7.0pt "Times New Roman"'>
|
|
</span>iii.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Example: (Error=jam) This will produce an ADF paper JAM..</p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo2;
|
|
tab-stops:list .5in'><![if !supportLists]>2.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Scan, Copy, and Fax button support. (both interrupt events,
|
|
and polled events)</p>
|
|
|
|
<p style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo2;
|
|
tab-stops:list 1.0in'><![if !supportLists]>a.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Alter and save the .WIA button files to trigger events in the
|
|
driver</p>
|
|
|
|
<p style='margin-left:1.5in;text-indent:-1.5in;mso-text-indent-alt:-9.0pt;
|
|
mso-list:l1 level3 lfo2;tab-stops:list 1.5in'><![if !supportLists]><span
|
|
style='font:7.0pt "Times New Roman"'>
|
|
</span>i.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>SCANBUTTON.WIA, for Scan button presses</p>
|
|
|
|
<p style='margin-left:1.5in;text-indent:-1.5in;mso-text-indent-alt:-9.0pt;
|
|
mso-list:l1 level3 lfo2;tab-stops:list 1.5in'><![if !supportLists]><span
|
|
style='font:7.0pt "Times New Roman"'>
|
|
</span>ii.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>COPYBUTTON.WIA, for Copy button presses</p>
|
|
|
|
<p style='margin-left:1.5in;text-indent:-1.5in;mso-text-indent-alt:-9.0pt;
|
|
mso-list:l1 level3 lfo2;tab-stops:list 1.5in'><![if !supportLists]><span
|
|
style='font:7.0pt "Times New Roman"'>
|
|
</span>iii.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>FAXBUTTON.WIA, for Fax button presses</p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo2;
|
|
tab-stops:list .5in'><![if !supportLists]>3.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>This sample demonstrates how to handle a transfer of an unknown
|
|
size. </p>
|
|
|
|
<p style='margin-left:1.0in;text-indent:-.25in;mso-list:l1 level2 lfo2;
|
|
tab-stops:list 1.0in'><![if !supportLists]>a.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Random infinite page lengths will be sent from the fake
|
|
scanner device to simulate different page lengths that a user could insert into
|
|
the document feeder.</p>
|
|
|
|
<h3>BUILDING THE SAMPLE</h3>
|
|
|
|
<p>To build the sample follow these steps:</p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo4;
|
|
tab-stops:list .5in'><![if !supportLists]>1.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>In the Start menu, select<span style="mso-spacerun:
|
|
yes"> </span>"Free Build Environment" or "Checked Build
|
|
Environment" under "Windows DDK" to open a command window and
|
|
set basic environment variables needed to build drivers. </p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo4;
|
|
tab-stops:list .5in'><![if !supportLists]>2.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Change to the directory containing the sample driver source
|
|
code, src\preview\wdm\wia\wiascroll.</p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo4;
|
|
tab-stops:list .5in'><![if !supportLists]>3.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Execute the "build" command. After the build
|
|
completes, a driver named wiascroll.dll will be located in a subdirectory.</p>
|
|
|
|
<h3>USING THE SAMPLE<o:p></o:p></h3>
|
|
|
|
<p><! ---------------- Snip Snip ---------------- >To use the driver, first
|
|
install it following these steps: </p>
|
|
|
|
<ol start=1 type=1>
|
|
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
|
mso-list:l3 level1 lfo7;tab-stops:list .5in'>Copy wiascroll.dll from the appropriate
|
|
object subdirectory under wiascroll to a new, empty directory.</li>
|
|
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
|
mso-list:l3 level1 lfo7;tab-stops:list .5in'>Copy wiascroll.inf<span
|
|
style="mso-spacerun: yes"> </span>to the same directory.</li>
|
|
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
|
mso-list:l3 level1 lfo7;tab-stops:list .5in'>In Windows Me or Windows XP,
|
|
open the “New Device” icon located in the Scanners and Cameras control
|
|
panel.</li>
|
|
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
|
mso-list:l3 level1 lfo7;tab-stops:list .5in'>Click the “Have Disk” button
|
|
and enter the name of the folder created in step 1.</li>
|
|
<li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
|
|
mso-list:l3 level1 lfo7;tab-stops:list .5in'>Click OK, Next, or Finish
|
|
until the wizard is finished.</li>
|
|
</ol>
|
|
|
|
<p>Use one of these options to test this driver:</p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo9;
|
|
tab-stops:list .5in'><![if !supportLists]>1.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>The Scanners and Cameras Wizard accessible from the Start menu
|
|
or by double-clicking the scanner in Explorer.</p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo9;
|
|
tab-stops:list .5in'><![if !supportLists]>2.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>The Wiatest application provided in this DDK tools directory.</p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo9;
|
|
tab-stops:list .5in'><![if !supportLists]>3.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Microsoft Paint, a native WIA application.</p>
|
|
|
|
<p style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo9;
|
|
tab-stops:list .5in'><![if !supportLists]>4.<span style='font:7.0pt "Times New Roman"'>
|
|
</span><![endif]>Any TWAIN compliant application.</p>
|
|
|
|
<h3>RESOURCES</h3>
|
|
|
|
<p>WIA information: <a href="http://www.microsoft.com/hwdev/wia">http://www.microsoft.com/hwdev/wia</a></p>
|
|
|
|
<p>DDK information: <a href="http://www.microsoft.com/ddk/">http://www.microsoft.com/ddk/</a></p>
|
|
|
|
<h3>CODE TOUR</h3>
|
|
|
|
<h3>File Manifest</h3>
|
|
|
|
<pre>Files<span style="mso-spacerun: yes"> </span>Description</pre><pre>------------ -------------------------------------------------------</pre><pre>istiusd.cpp<span style="mso-spacerun: yes"> </span>Implements STI minidriver for backward compatibility</pre><pre>iwiaminidrv.cpp Implements COM WIA mini-driver functions</pre><pre>makefile<span style="mso-spacerun: yes"> </span>Used for building the driver--do not modify</pre><pre>pch.h<span style="mso-spacerun: yes"> </span>precompiled header</pre><pre>resource.h<span style="mso-spacerun: yes"> </span>Header file for resources</pre><pre>sources<span style="mso-spacerun: yes"> </span>Controls building of driver</pre><pre>validate.cpp<span style="mso-spacerun: yes"> </span>Implements property handling</pre><pre>wiaprop.h<span style="mso-spacerun: yes"> </span>Property header file</pre><pre>wiascroll.cpp<span style="mso-spacerun: yes"> </span>Implements COM DLL functionality</pre><pre>wiascroll.h<span style="mso-spacerun: yes"> </span>Main header file</pre><pre>wiascroll.rc<span style="mso-spacerun: yes"> </span>Resource definitions</pre><pre>wiascroll.rcv<span style="mso-spacerun: yes"> </span>Version resource definitions</pre><pre>wiascroll.def<span style="mso-spacerun: yes"> </span>Linker command file</pre><pre>wiascroll.htm<span style="mso-spacerun: yes"> </span>This readme file</pre><pre>wiascroll.inf<span style="mso-spacerun: yes"> </span>Installation file for this driver</pre>
|
|
|
|
<h3 style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'>Programming
|
|
Tour</h3>
|
|
|
|
<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'>Will
|
|
be added in a future revision.<span style='font-family:"Courier New"'><o:p></o:p></span></p>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|