Sample WIA Microdriver

[This is preliminary documentation and subject to change.]

SUMMARY

This sample shows how to write a Windows Image Acquisition (WIA) Microdriver for a flatbed scanner. The Microdriver architecture is functionally reduced from the WIA Minidriver architecture, but supports the primary scanning functions. Documentation on WIA Microdrivers is provided in the “Windows DDK ”. This sample driver can be used as a starting point for your development, but your driver should access the scanner hardware through one of the kernel drivers provided with Windows.

This sample will not work on Windows 98 or Windows 2000.

BUILDING THE SAMPLE

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\microdrv.

3.      Execute the "build" command. After the build completes, a driver named Testmcro.dll will be located in a subdirectory.

USING THE SAMPLE

To use the driver, first install it following these steps:

  1. Copy Testmcro.dll from the subdirectory under Microdrv to a new, empty directory.
  2. Copy Testmcro.inf from the Microdrv directory to the same directory.
  3. In Millennium, open the “New Device” icon in the Scanners and Cameras control panel.
  4. Click the “Have Disk” button and enter the name of the folder created in step 1.
  5. Click OK, Next, or Finish until the wizard is finished.

To test this driver, open the Scanners and Cameras folder in Explorer or use the Wiatest application.

Use one of these options to test this driver:

1.      The Scanners and Cameras Wizard accessible from the Start menu.

2.      The Namespace extension accessible by opening the camera in Explorer.

3.      The Wiatest application is provided in this DDK.

4.      Microsoft Paint, a native WIA application.

5.      Any TWAIN compliant application.

RESOURCES

WIA information: http://www.microsoft.com/hwdev/tech/wia

DDK information: http://www.microsoft.com/ddk/

CODE TOUR

File Manifest

Files        Description
------------ -------------------------------------------------------
testmcro.cpp Implements the Microdriver
makefile     Used for building the driver--do not modify
resource.h   Header file for resources
sources      Controls building of driver
testmcro.def Linker command file
testmcro.htm This readme
testmcro.inf Installation file
testmcro.h   Main header file
testmcro.rc  Resource definitions
testmcro.rcv Resource definitions