This sample shows how to write a Windows Image Acquisition (WIA) user-mode minidriver for a scanner. It simulates scanning by reading image information from 3 specific bitmaps files which are automatically copied to your system directory when the driver is installed. 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.
At the time of this writing, WIA is only supported on Windows Me and Whistler. This sample will not work on Windows 98 or Windows 2000.
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, src\preview\wdm\wia\wiatscan.
3. Execute the "build" command. After the build completes, a driver named Wiatscan.dll will be located in a subdirectory.
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/wia
DDK information: http://www.microsoft.com/ddk/
Files Description------------ -------------------------------------------------------
defprop.h Property header filedevice.cpp Implements STI minidriver for backward compatibilitymakefile Used for building the driver--do not modifyminidrv.cpp Implements scanner functionsresource.h Header file for resourcessources Controls building of drivertest1bt.bmp 1 bit deep sample imagetest8bt.bmp 8 bit deep sample imagetest24bt.bmp 24 bit deep sample image
testusd.cpp Implements COM functionalitytestusd.h Main header filetestusd.rc Resource definitionstestusd.rcv Version resource definitionsvalidate.cpp Implements property handling
wiatscan.def Linker command file
wiatscan.htm This readme file
wiatscan.inf Installation file for this driver
Will
be added in a future revision.