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.
This sample will not work on Windows 98 or Windows 2000.
1. Automatic document feeder capabilities
a. This sample also shows an example of a feeder that can not determine the page length. (formally called a scrollfed scanner)
2. Scan, Copy, and Fax button support. (interrupt events only)
a. Run the small application provided with the DDK called scanpanl.exe to simulate button presses.
To build the sample follow these steps:
1. In the Start menu, select "Free Build Environment" or "Checked Build Environment" under "Windows DDK" to open a command window and set basic environment variables needed to build drivers.
2. Change to the directory containing the sample driver source code.
3. Execute the "build" command. After the build completes, a driver named wiascanr.dll will be located in a subdirectory.
To build the sample follow these steps:
1. In the Start menu, select "Free Build Environment" or "Checked Build Environment" under "Windows DDK" to open a command window and set basic environment variables needed to build drivers.
2. Change to the directory containing the sample driver source code.
3. Edit the SOURCES file adding /DUNKNOWN_LENGTH_FEEDER_ONLY_SCANNER to the C_DEFINES section.
a. Example: C_DEFINES =$(C_DEFINES) /DUNKNOWN_LENGTH_FEEDER_ONLY_SCANNER
4. Execute the "build" command. After the build completes, a driver named wiascanr.dll will be located in a subdirectory.
a. Important note: This driver is the same .dll as the one built above. It only contains different functionality. A separate installation is not required or recommended.
To use the driver, first install it following these steps:
Use one of these options to test this driver:
1. The Scanners and Cameras Wizard accessible from the Start menu or by double-clicking the scanner in Explorer.
2. The wiatest application provided in this DDK tools directory.
3. Microsoft Paint, a native WIA application.
4. Any TWAIN compliant application.
WIA information: http://www.microsoft.com/hwdev/tech/wia
DDK information: http://www.microsoft.com/ddk/
Files Description
------------ -------------------------------------------------------
istiusd.cpp Implements STI minidriver for backward compatibility
iwiaminidrv.cpp Implements COM WIA mini-driver functions
makefile Used for building the driver--do not modify
pch.h Precompiled header
resource.h Header file for resources
sources Controls building of driver
validate.cpp Implements property validation helpers
wiaprop.h Property header file
wiascanr.cpp Implements COM DLL functionality
wiascanr.h Main DLL header file
wiascanr.rc Resource definitions
wiascanr.rcv Version resource definitions
wiascanr.def DLL exports file
dlihook.cpp delay load module
wiascanr.htm This readme file
wiascanr.inf Installation file for this driver