This sample shows how to write a Windows Image Acquisition (WIA) kernel mode USB class driver to support scan for composite USB devices on Windows 98, Windows 98 SE and Windows ME. This code should not be used for non-composite USB devices, nor should it be used in Windows 2000, Windows XP and beyond.
To build the sample, follow these steps:
1. In the Start menu, select "Windows Server 2003 Free Build Environment" or "Windows Server 2003 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\usbscn9x.
3. Execute the "build" command.
4. After the build completes, a driver named Usbscn9x.sys will be located in an object subdirectory.
Note: Use a unique filename for the binary. For example, "MyCoScn.sys", where "MyCo" was the first four letters of your company's name"
Building for Windows 98 and Windows 98 SE
o IoQueueWorkItem, IoAllocateWorkItem and IoFreeWorkItem.
Building for Me
1. Build from Windows Server 2003 DDK. This is because some identifiers in ioctl.c are only declared there, such as IOCTL_SET_TIMEOUT, USBSCAN_TIMEOUT and PUSBSCAN_TIMEOUT.
Files Description
------------ -----------------------------------------------------
debug.c Utility function for debug.
debug.h Header for debug utility.
ioctl.c Functions to handle DeviceIoControl.
Makefile Used for building the driver--do not modify.
ocrw.c Functions to handle Open, Close, Read and Write.
power.c Functions to handle power IRPs.
private.h Header for driver functions.
Sources Controls building of driver
usbd_api.h Macro to create certain type of URB.
usbscn9x.c Main implementation of usbscn9x.
usbscn9x.def Linker command file.
usbscn9x.htm This readme.
usbscn9x.rc Main resource file.
WIA information: http://www.microsoft.com/hwdev/wia
DDK information: http://www.microsoft.com/ddk/