Imaging devices

Overview of the Imaging devices technology.

To develop Imaging devices, you need these headers:

For the programming guide, see Imaging devices.

Functions

Title Description
MicroEntry function The MicroEntry function responds to commands sent by the WIA Flatbed driver.
Scan function The Scan function reads data from the device and returns the data to the WIA Flatbed driver.
SetPixelWindow function The SetPixelWindow function sets the image area to be scanned.
wiasCreateChildAppItem function The wiasCreateChildAppItem function creates a new application item and inserts it as a child of the specified (parent) item. Note that this item will not have any properties in its property sets until the driver or application actually fills them in.
wiasCreateDrvItem function The wiasCreateDrvItem function creates an IWiaDrvItem Interface object.
wiasCreateLogInstance function The wiasCreateLogInstance function creates an instance of a logging object.
wiasCreatePropContext function The wiasCreatePropContext function allocates a property context to indicate which of an item's properties are being changed by the application.
wiasDebugError function This function prints a debug error string in the Device Manager debug console. The output color is always red.
wiasDebugTrace function This function prints a debug trace string in the Device Manager debug console.
wiasDownSampleBuffer function The wiasDownSampleBuffer function takes in a buffer of DWORD-aligned pixel data and downsamples it (produces image data of lower resolution) to the specified size and resolution.
wiasFormatArgs function The wiasFormatArgs function formats an argument list into a packaged string for logging.
wiasFreePropContext function The wiasFreePropContext function releases the memory occupied by a WIA_PROPERTY_CONTEXT structure.
wiasGetChangedValueFloat function The wiasGetChangedValueFloat function determines whether a property with a floating-point value has been changed by an application.
wiasGetChangedValueGuid function The wiasGetChangedValueGuid function determines whether a property with a GUID value has been changed by an application.
wiasGetChangedValueLong function The wiasGetChangedValueLong function determines whether a property with a long integer value has been changed by an application.
wiasGetChangedValueStr function The wiasGetChangedValueStr function determines whether a property with a string value has been changed by an application.
wiasGetChildrenContexts function The wiasGetChildrenContexts function retrieves an array of item contexts belonging to the current item's children.
wiasGetContextFromName function The wiasGetContextFromName function retrieves the item context for an item name.
wiasGetDrvItem function The wiasGetDrvItem function retrieves a driver item.
wiasGetImageInformation function The wiasGetImageInformation function retrieves transfer context information from an item.
wiasGetItemType function The wiasGetItemType function indicates the item type.
wiasGetPropertyAttributes function The wiasGetPropertyAttributes function retrieves the access flags and valid values for a set of properties.
wiasGetRootItem function The wiasGetRootItem function retrieves the root item context of a specified WIA item.
wiasIsPropChanged function The wiasIsPropChanged function tests whether a specified property has been changed by an application.
wiasParseEndorserString function The wiasParseEndorserString function parses an endorser string, replacing WIA service-defined and vendor-defined tokens in the string with values associated with those tokens.
wiasPrintDebugHResult function The wiasPrintDebugHResult function is obsolete for Windows XP and later, and is no longer supported. Use the WIAS_LHRESULT macro instead.This function prints an HRESULT string on the Device Manager debug console.
wiasQueueEvent function The wiasQueueEvent function informs the service that the device generated an event.
wiasReadMultiple function The wiasReadMultiple function retrieves multiple property values from a WIA item.
wiasReadPropBin function The wiasReadPropBin function retrieves a binary-data property value from a WIA item.
wiasReadPropFloat function The wiasReadPropFloat function retrieves a floating-point property value from a WIA item.
wiasReadPropGuid function The wiasReadPropGuid function retrieves a GUID property value from a WIA item.
wiasReadPropLong function The wiasReadPropLong function retrieves a long integer property value from a WIA item.
wiasReadPropStr function The wiasReadPropStr function retrieves a string property value from a WIA item.
wiasSendEndOfPage function The wiasSendEndOfPage function calls the client callback routine during a data transfer, sending the current total page count.
wiasSetItemPropAttribs function The wiasSetItemPropAttribs function sets the access flags and valid values for an item's set of properties.
wiasSetItemPropNames function The wiasSetItemPropNames function writes property names to item properties.
wiasSetPropChanged function The wiasSetPropChanged function modifies a property context to indicate that a property is being changed.
wiasSetPropertyAttributes function The wiasSetPropertyAttributes function sets the access flags and valid values for a set of properties.
wiasSetValidFlag function The wiasSetValidFlag function sets the valid values for a WIA_PROP_FLAG property.
wiasSetValidListFloat function The wiasSetValidListFloat function sets valid values for a WIA_PROP_LIST property of type VT_R4.
wiasSetValidListGuid function The wiasSetValidListGuid function sets valid values for a WIA_PROP_LIST property of type VT_CLSID.
wiasSetValidListLong function The wiasSetValidListLong function sets the valid values for a WIA_PROP_LIST property of type VT_I4.
wiasSetValidListStr function The wiasSetValidListStr function sets the valid values for a WIA_PROP_LIST property of type VT_BSTR.
wiasSetValidRangeFloat function The wiasSetValidRangeFloat function specifies the range of valid values for a WIA_PROP_RANGE property of type VT_R4.
wiasSetValidRangeLong function The wiasSetValidRangeLong function specifies the range of valid values for a WIA_PROP_RANGE property of type VT_I4.
wiasUpdateScanRect function The wiasUpdateScanRect function updates the scanning area sizes of the scanning device.
wiasUpdateValidFormat function The wiasUpdateValidFormat function updates the valid format of the property context for the current minidriver.
wiasValidateItemProperties function The wiasValidateItemProperties function validates a list of simple item properties against their current valid values.
wiasWriteBufToFile function The wiasWriteBufToFile function writes from a specified buffer to an image file.
wiasWriteMultiple function The wiasWriteMultiple function writes multiple property values to a WIA item.
wiasWritePageBufToFile function The wiasWritePageBufToFile function writes the contents of a temporary page buffer to an image file.
wiasWritePageBufToStream function The wiasWritePageBufToStream function writes the contents of a temporary page buffer to the IStream interface provided by the application.
wiasWritePropBin function The wiasWritePropBin function writes a single binary-data property value to a WIA item.
wiasWritePropFloat function The wiasWritePropFloat function writes a single floating-point property value to a WIA item.
wiasWritePropGuid function The wiasWritePropGuid function writes a single GUID property value to a WIA item.
wiasWritePropLong function The wiasWritePropLong function writes a single long integer property value to a WIA item.
wiasWritePropStr function The wiasWritePropStr function writes a single string property value to a WIA item.
wiauDbgDump function The wiauDbgDump function logs a message containing one or more data values.
wiauDbgError function The wiauDbgError function logs an error message.
wiauDbgErrorHr function The wiauDbgErrorHr function logs a message containing an HRESULT and its error message string.
wiauDbgFlags function The wiauDbgFlags function determines whether a particular debugging flag is set.
wiauDbgHelper function The wiauDbgHelper function formats a message and writes it to a log file, or debugger, or both.
wiauDbgHelper2 function The wiauDbgHelper2 function writes a message to a log file, or debugger, or both.
wiauDbgInit function The wiauDbgInit function initializes WIA debugging.
wiauDbgLegacyError function The wiauDbgLegacyError function logs an error message.
wiauDbgLegacyError2 function The wiauDbgLegacyError2 function logs an error message.
wiauDbgLegacyHresult2 function The wiauDbgLegacyHresult2 function logs a default message containing an HRESULT.
wiauDbgLegacyTrace function The wiauDbgLegacyTrace function logs a trace message.
wiauDbgLegacyTrace2 function The wiauDbgLegacyTrace2 function logs a trace message.
wiauDbgLegacyWarning function The wiauDbgLegacyWarning function logs a warning message.
wiauDbgSetFlags function The wiauDbgSetFlags function sets debugging flags.
wiauDbgTrace function The wiauDbgTrace function logs a trace message.
wiauDbgWarning function The wiauDbgWarning function logs a warning message.
wiauGetDrvItemContext function The wiauGetDrvItemContext function gets the driver item context, and optionally, the driver item.
wiauGetResourceString function The wiauGetResourceString function gets a resource string, storing it as a BSTR.
wiauGetValidFormats function The wiauGetValidFormats function calls the IWiaMiniDrv
wiauPropInPropSpec function The wiauPropInPropSpec function determines whether a specified property specification ID is contained in an array of such values. The function optionally gets the index at which the property specification ID was found.
wiauPropsInPropSpec function The wiauPropsInPropSpec function determines whether any of a list of property specification IDs is contained within an array of such values.
wiauSetImageItemSize function The wiauSetImageItemSize function calculates the size and width, in bytes, for an image, based on the current WIA_IPA_FORMAT setting (described in the Microsoft Windows SDK documentation), and writes the new values to the appropriate properties.
wiauStrC2C function The wiauStrC2C function copies an ANSI character string to another ANSI character string.
wiauStrC2W function The wiauStrC2W function converts an ANSI character string to a Unicode string.
wiauStrW2C function The wiauStrW2C function converts a Unicode string to an ANSI character string.
wiauStrW2W function The wiauStrW2W function copies a Unicode string to another Unicode string.

Structures

Title Description
VAL structure The VAL structure is used by the microdriver and WIA Flatbed driver to pass information between each other.
_BMP_IMAGE_INFO structure The BMP_IMAGE_INFO structure contains information about a BMP image.
_CHANNEL_INFO structure The CHANNEL_INFO structure is used as a parameter to DeviceIoControl, when the specified I/O control code is IOCTL_GET_CHANNEL_ALIGN_RQST.
_DEVICE_DESCRIPTOR structure The DEVICE_DESCRIPTOR structure is used as a parameter to DeviceIoControl, when the specified I/O control code is IOCTL_GET_DEVICE_DESCRIPTOR.
_DRV_VERSION structure The DRV_VERSION structure is used as a parameter to DeviceIoControl, when the specified I/O control code is IOCTL_GET_VERSION.
_ERROR_INFOW structure The STI_ERROR_INFO structure is used as a parameter for the IStiDevice
_IO_BLOCK structure The IO_BLOCK structure is used as a parameter to DeviceIoControl, when the specified I/O control code is IOCTL_READ_REGISTERS or IOCTL_WRITE_REGISTERS.
_IO_BLOCK_EX structure The IO_BLOCK_EX structure is used as a parameter to DeviceIoControl, when the specified I/O control code is IOCTL_SEND_USB_REQUEST.
_MINIDRV_TRANSFER_CONTEXT structure The MINIDRV_TRANSFER_CONTEXT structure is used to store image and other information needed for a memory-callback data transfer or a file data transfer.
_PTP_VENDOR_DATA_IN structure The PTP_VENDOR_DATA_IN structure contains information about an arbitrary command that an application issues to the device.
_PTP_VENDOR_DATA_OUT structure The PTP_VENDOR_DATA_OUT structure contains information that the device sends to an application, in response to a command the application issued to the device.
_RANGEVALUE structure The RANGEVALUE structure is used by a microdriver to communicate to the WIA Flatbed driver the legal values for a microdriver function parameter.
_SCANINFO structure The SCANINFO structure is used to store and communicate information about a scan acquisition.
_SCANWINDOW structure The SCANWINDOW structure is used by the WIA Flatbed driver to tell the microdriver what image area to scan.
_SCSISCAN_CMD structure The SCSISCAN_CMD structure is used as a parameter to DeviceIoControl, when the specified I/O control code is IOCTL_SCSISCAN_CMD.
_SCSISCAN_INFO structure The SCSISCAN_INFO structure is used as a parameter to DeviceIoControl (described in the Microsoft Windows SDK documentation), when the specified I/O control code is IOCTL_SCSISCAN_GET_INFO.
_STINOTIFY structure The STINOTIFY structure is used as a parameter to the IStillImage
_STISUBSCRIBE structure The STISUBSCRIBE structure is used as a parameter for the IStiDevice
_STI_DEVICE_INFORMATIONW structure The STI_DEVICE_INFORMATION structure is used as an output parameter for the IStillImage
_STI_DEVICE_STATUS structure The STI_DEVICE_STATUS structure is used as a parameter to the IStiDevice
_STI_DEV_CAPS structure The STI_DEV_CAPS structure is used as a parameter to the IStiDevice
_STI_DIAG structure The STI_DIAG structure is used as a parameter to the IStiDevice
_STI_USD_CAPS structure The STI_USD_CAPS structure is used as a parameter for the IStiUSD
_STI_WIA_DEVICE_INFORMATIONW structure The STI_WIA_DEVICE_INFORMATION structure contains device information.
_TWAIN_CAPABILITY structure The TWAIN_CAPABILITY structure holds information used when a TWAIN-compatible application communicates with a WIA driver.
_USBSCAN_GET_DESCRIPTOR structure The USBSCAN_GET_DESCRIPTOR structure is used as a parameter to DeviceIoControl, when the specified I/O control code is IOCTL_GET_USB_DESCRIPTOR.
_USBSCAN_PIPE_CONFIGURATION structure The USBSCAN_PIPE_CONFIGURATION structure is used as a parameter to DeviceIoControl, when the specified I/O control code is IOCTL_GET_PIPE_CONFIGURATION.
_USBSCAN_PIPE_INFORMATION structure The USBSCAN_PIPE_INFORMATION structure is used to describe a USB transfer pipe for a still image device. An array of USBSCAN_PIPE_INFORMATION structures is supplied within a USBSCAN_PIPE_CONFIGURATION structure.
_USBSCAN_TIMEOUT structure The USBSCAN_TIMEOUT structure stores time-out values for USB bulk IN and bulk OUT operations, and interrupts.
_WIAS_CHANGED_VALUE_INFO structure The WIAS_CHANGED_VALUE_INFO structure is used to store the current and previous values of a property.
_WIAS_DOWN_SAMPLE_INFO structure The WIAS_DOWN_SAMPLE_INFO structure stores information used by the downsampling helper function, wiasDownSampleBuffer.
_WIAS_ENDORSER_INFO structure The WIAS_ENDORSER_INFO structure holds custom endorser token/value pairs.
_WIAS_ENDORSER_VALUE structure The WIAS_ENDORSER_VALUE structure stores token/value pairs for endorser strings.
_WIA_BARCODES structure The WIA_BARCODES structure stores header information for the barcode metadata report of one scan job (one call to IWiaMiniDrv
_WIA_BARCODE_INFO structure The WIA_BARCODE_INFO structure stores information for one decoded barcode.
_WIA_DEV_CAP_DRV structure The WIA_DEV_CAP_DRV structure is used to enumerate device capabilities. A device capability is defined by an event or command that the device supports.
_WIA_MICR structure The WIA_MICR structure stores header information for the MICR metadata report of one scan job (one call to IWiaMiniDrv
_WIA_MICR_INFO structure The WIA_MICR_INFO structure stores information for one decoded MICR code.
_WIA_PATCH_CODES structure The WIA_PATCH_CODES structure stores header information for the patch code metadata report of one scan job (one call to IWiaMiniDrv
_WIA_PATCH_CODE_INFO structure The WIA_PATCH_CODE_INFO structure stores information for one decoded patch code.
_WIA_PROPERTY_CONTEXT structure The WIA_PROPERTY_CONTEXT structure stores property identifiers and their context.
_WIA_PROPERTY_INFO structure The WIA_PROPERTY_INFO structure is used to store default access and valid value information for an item property of arbitrary type.
tagDEVICEDIALOGDATA structure The DEVICEDIALOGDATA structure contains all the data needed to implement a custom device dialog.
tagDEVICEDIALOGDATA2 structure The DEVICEDIALOGDATA2 structure contains all the data needed to implement a custom device dialog.

Enumerations

Title Description
PIPE_TYPE Enumeration The PIPE_TYPE data type is used as input to the DeviceIoControl function, if the I/O control code is IOCTL_CANCEL_IO or IOCTL_RESET_PIPE.
SKIP_AMOUNT Enumeration The SKIP_AMOUNT enumeration is used to indicate whether the file and informational headers of an image should be skipped over.
_RAW_PIPE_TYPE Enumeration The RAW_PIPE_TYPE data type is used to specify the type of a USB pipe.
_STI_DEVICE_MJ_TYPE Enumeration The STI_DEVICE_TYPE type identifies the device type of a still image device.The DWORD is divided into a HIWORD containing the major device type, and a LOWORD containing a vendor-defined subtype.

I/O control codes

Title Description
IOCTL_CANCEL_IO IOCTL Cancels activity on the specified USB transfer pipe that is associated with the specified device handle.
IOCTL_GET_CHANNEL_ALIGN_RQST IOCTL Returns a USB device's maximum packet size for the read, write, and interrupt transfer pipes associated with the specified device handle.
IOCTL_GET_DEVICE_DESCRIPTOR IOCTL Returns vendor and device identifiers.
IOCTL_GET_PIPE_CONFIGURATION IOCTL Returns a description of every transfer pipe supported for a device.
IOCTL_GET_USB_DESCRIPTOR IOCTL Returns a specified USB Descriptor.
IOCTL_GET_VERSION IOCTL Returns the version number of the driver.
IOCTL_READ_REGISTERS IOCTL Reads from USB device registers, using the control pipe.
IOCTL_RESET_PIPE IOCTL Resets the specified USB transfer pipe that is associated with the specified device handle.
IOCTL_SCSISCAN_CMD IOCTL Creates a customized SCSI control descriptor block (CDB) and sends it to the kernel-mode still image driver for SCSI buses.
IOCTL_SCSISCAN_GET_INFO IOCTL The IOCTL_SCSISCAN_GET_INFO I/O control code returns device information.
IOCTL_SCSISCAN_LOCKDEVICE IOCTL Reserved for use by Microsoft.
IOCTL_SCSISCAN_SET_TIMEOUT IOCTL The IOCTL_SCSISCAN_SET_TIMEOUT control code modifies the time-out value used by the kernel-mode still image driver for SCSI buses when it accesses a device.
IOCTL_SCSISCAN_UNLOCKDEVICE IOCTL Reserved for use by Microsoft.
IOCTL_SEND_USB_REQUEST IOCTL Sends a vendor-defined request to a USB device, using the control pipe, and optionally sends or receives additional data.
IOCTL_SET_TIMEOUT IOCTL Sets the time-out value for USB bulk IN, bulk OUT, or interrupt pipe access.
IOCTL_WAIT_ON_DEVICE_EVENT IOCTL Returns information about an event occurring on a USB interrupt pipe.
IOCTL_WRITE_REGISTERS IOCTL Writes to USB device registers, using the control pipe.

Interfaces

Title Description
IWiaDrvItem interface The IWiaDrvItem interface provides methods that a WIA minidriver can use to manage a tree of IWiaDrvItem items.
IWiaErrorHandler interface The IWiaErrorHandler interface provides the GetStatusDescription and ReportStatus methods, which enable minidrivers to give users information about status or errors during a data transfer and possibly give an opportunity to recover from errors.
IWiaImageFilter interface The IWiaImageFilter interface is an extension interface implemented by image processing filter developers and called by Microsoft Windows Image Acquisition (WIA).
IWiaLog interface The IWiaLog interface provides methods to enable minidrivers to log trace, error, and warning messages to the diagnostic log file Wiaservc.log.
IWiaMiniDrv interface The IWiaMiniDrv interface provides the methods that are the entry points for all communication between the minidriver and the WIA service. These methods allow the WIA service to control the device.
IWiaMiniDrvCallBack interface The IWiaMiniDrvCallBack interface provides the MiniDrvCallback method, which enables minidrivers to transfer image header data and image data from the imaging device to the WIA service.
IWiaMiniDrvTransferCallback interface This is a Callback interface that is called by the WIA mini-driver for stream-based transfers.
IWiaSegmentationFilter interface The IWiaSegmentationFilter interface provides the DetectRegions method, which enables minidrivers to detect image subregions on a flatbed scanner's platen. This interface is available in Windows Vista and later.
IWiaTransferCallback interface The IWiaTransferCallback interface is implemented by image processing filter developers and called by Microsoft Windows Image Acquisition (WIA).

Macros

Title Description
WIAS_ASSERT function The WIAS_ASSERT macro writes a diagnostic message to the Wiatrace.log file.
WIAS_ERROR function The WIAS_ERROR macro writes a diagnostic message to the Wiatrace.log file.
WIAS_HRESULT function The WIAS_HRESULT macro writes a diagnostic message to the Wiatrace.log file.
WIAS_LERROR function The WIAS_LERROR macro is obsolete for Windows Vista and later. It is recommended that the WIAS_ERROR macro be used instead.The WIAS_LERROR macro writes a diagnostic WIA_ERROR message to the log file.
WIAS_LHRESULT function The WIAS_LHRESULT macro is obsolete for Windows Vista and later. It is recommended that the WIAS_HRESULT macro be used instead. The WIAS_LHRESULT macro translates an HRESULT value into a string and writes the string to the diagnostic log file.
WIAS_LTRACE function The WIAS_LTRACE macro is obsolete for Windows Vista and later. It is recommended that the WIAS_TRACE macro be used instead.The WIAS_LTRACE macro writes a diagnostic WIA_TRACE message to the log file.
WIAS_LWARNING function The WIAS_LWARNING macro is obsolete for Windows Vista and later.The WIAS_LWARNING macro writes a diagnostic WIA_WARNING message to the log file.
WIAS_TRACE function The WIAS_TRACE macro writes a diagnostic message to the Wiatrace.log file.

Methods

Title Description
AddItemToFolder method The AddItemToFolder method adds an IWiaDrvItem item to a folder in a driver item tree.
DetectRegions method The IWiaSegmentationFilter
DumpItemData method The IWiaDrvItem
FilterPreviewImage method The IWiaImageFilter
FindChildItemByName method The IWiaDrvItem
FindItemByName method The IWiaDrvItem
GetDeviceSpecContext method The IWiaDrvItem
GetFirstChildItem method The IWiaDrvItem
GetFullItemName method The IWiaDrvItem
GetItemFlags method The IWiaDrvItem
GetItemName method The IWiaDrvItem
GetNextSiblingItem method The IWiaDrvItem
GetNextStream method The IWiaTransferCallback
GetNextStream method Called by the WIA mini-driver to obtain a stream for the current data transfer (download or upload).
GetParentItem method The IWiaDrvItem
GetStatusDescription method The system UI calls the GetStatusDescription method to provide the user with extra information about an error, if the user requests this information. This method is implemented by a driver's UI extension.
InitializeFilter method The IWiaImageFilter
InitializeLog method Note that the IWiaLog interface is obsolete for Microsoft Windows XP and later, and is no longer supported. Instead, use the Diagnostic Log Macros.The IWiaLog
Log method The IWiaLog interface is obsolete for Windows XP and later, and is no longer supported. Use the Diagnostic Log Macros instead.The IWiaLog
MiniDrvCallback method The MiniDrvCallback method provides a callback method for WIA minidrivers to use during a callback data transfer.
RemoveItemFromFolder method The IWiaDrvItem
ReportStatus method The ReportStatus method displays information about an error or status during a transfer. In some cases this method allows the user to recover from an error.
SendMessage method Periodically called by the WIA mini-driver during a data transfer, to update the WIA application client about the progress and status of the transfer.
TransferCallback method The IWiaTransferCallback
UnlinkItemTree method The IWiaDrvItem
drvAcquireItemData method The IWiaMiniDrv
drvAnalyzeItem method The IWiaMiniDrv
drvDeleteItem method The IWiaMiniDrv
drvDeviceCommand method The IWiaMiniDrv
drvFreeDrvItemContext method The IWiaMiniDrv
drvGetCapabilities method The IWiaMiniDrv
drvGetDeviceErrorStr method The IWiaMiniDrv
drvGetWiaFormatInfo method The IWiaMiniDrv
drvInitItemProperties method The IWiaMiniDrv
drvInitializeWia method The IWiaMiniDrv
drvLockWiaDevice method The IWiaMiniDrv
drvNotifyPnpEvent method The IWiaMiniDrv
drvReadItemProperties method The IWiaMiniDrv
drvUnInitializeWia method The IWiaMiniDrv
drvUnLockWiaDevice method The IWiaMiniDrv
drvValidateItemProperties method The IWiaMiniDrv
drvWriteItemProperties method The IWiaMiniDrv
hResult method Note that the IWiaLog interface is obsolete for Microsoft Windows XP and later, and is no longer supported.