This sample shows how to write a Windows Image Acquisition (WIA) user-mode minidriver for a camera. It simulates a camera by reading images from a directory on the hard disk. This sample driver can be used as a starting point for your development, but your driver should access the camera hardware through one of the kernel drivers provided with Windows.
This sample is implemented in 3 parts. This part is the main minidriver. The “Fakecam” sample implements a camera microdriver that this driver calls. The third part is the sample UI extension “Extend.”
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.
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\wdm\wia\wiacam.
3. Execute the "build" command. After the build completes, a driver named Wiacam.dll will be located in an object subdirectory.
4. Also build the microdriver in src\wdm\wia\fakecam and the user interface extension located in the src\wdm\wia\extend directory.
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.
2. The Namespace extension accessible by opening the camera in Explorer.
3. The Wiatest application provided in this DDK.
4. Microsoft Paint, a native WIA application.
5. Any TWAIN compliant application.
WIA information: http://www.microsoft.com/hwdev/tech/wia
DDK information: http://www.microsoft.com/ddk/
Files Description------------ -------------------------------------------------------CCamMicro.cpp Implements wrapper for microdriver DLLCcamMicro.h Header for microdriver DLL wrapperChild.cpp Implements functions for non-root itemsIStiUSD.cpp Implements STI interfacesIWiaMiniDrv.cpp Implements WIA interfacesMakefile Used for building the driver--do not modifypch.h Precompiled headerresource.h Header file for resourcesRoot.cpp Implements functions for root itemSources Controls building of driverwiacam.cpp Implements COM and DLL functionswiacam.def Linker command filewiacam.h Main header for driverwiacam.htm This readmewiacam.inf Installation filewiacam.rc Resource definitionswiacam.rcv Additional resource definitionsDeleting an item causes it to be hidden. Use “attrib –h <filename>” to unhide the image.
GDI+ required.
WCHAR vs. TCHAR.
Explain microdriver vs. fakecam vs. microcam wrapper vs. minidriver.
Explain where driver looks for images.
Explain
private context.