Rediger

Del via


WIA driver services library

The WIA driver services library contains functions that a WIA minidriver can call for assistance in performing the following tasks:

A WIA minidriver calls most of these functions from its IWiaMiniDrv Interface methods as needed. Each WIA minidriver, however, must call the wiasCreateDrvItem function in the IWiaMiniDrv::drvInitializeWia method to create driver items. Each successful call to a wiasCreateDrvItem function creates an IWiaDrvItem item object, which is used in the minidriver's item tree. Several IWiaDrvItem Interface methods have a parameter of type IWiaDrvItem, including the IWiaDrvItem::AddItemToFolder, IWiaDrvItem::GetFirstChildItem, IWiaDrvItem::GetNextSiblingItem, and IWiaDrvItem::GetParentItem. Also, the wiasGetDrvItem function has a parameter of this type.

The driver services library provides the following functions.

Build and maintain an item tree

Function Description
wiasCreateChildAppItem Creates a new application item and inserts it as a child of the specified (parent) item.
wiasCreateDrvItem Creates an IWiaDrvItem object.
wiasGetChildrenContexts Retrieves an array of item contexts belonging to the current item's children.
wiasGetContextFromName Retrieves the item context for an item name.
wiasGetDrvItem Retrieves a driver item.
wiasGetRootItem Retrieves the root item context of a specified WIA item.

Log error and trace messages

Function Description
wiasCreateLogInstance Creates an instance of a logging object.
wiasDebugError Prints a debug error string in the Device Manager debug console. The output color is always red. This function is provided for compatibility only. It is recommended to use WIAS_ERROR instead.
wiasDebugTrace Prints a debug trace string in the Device Manager debug console. This function is provided for compatibility only. It is recommended to use WIA_TRACE instead.
wiasFormatArgs Formats an argument list into a packaged string for logging.
wiasPrintDebugHResult Prints an HRESULT string on the Device Manager debug console. This function is provided for compatibility only. It is obsolete and is no longer supported. Use WIAS_LHRESULT instead.

Read and store item properties

Function Description
wiasCreatePropContext Allocates a property context to indicate which of an item's properties are changing.
wiasFreePropContext Releases the memory occupied by a WIA_PROPERTY_CONTEXT structure.
wiasGetChangedValueFloat Determines whether a property with a floating-point value has been changed by an application.
wiasGetChangedValueGuid Determines whether a property with a GUID value has been changed by an application.
wiasGetChangedValueLong Determines whether a property with a long integer value has been changed by an application.
wiasGetChangedValueStr Determines whether a property with a string value has been changed by an application.
wiasGetItemType Indicates a root or child item.
wiasGetPropertyAttributes Retrieves the access flags and valid values for a set of properties.
wiasIsPropChanged Tests whether the specified property has been changed by an application.
wiasReadMultiple Reads multiple properties from a WIA item.
wiasReadPropBin Reads a single binary property from a WIA item.
wiasReadPropFloat Retrieves a floating-point property value from a WIA item.
wiasReadPropGuid Retrieves a GUID property value from a WIA item.
wiasReadPropLong Retrieves a long integer property value from a WIA item.
wiasReadPropStr Retrieves a string property value from a WIA item.
wiasSetItemPropAttribs Sets the access flags and valid values for an item's set of properties.
wiasSetItemPropNames Writes property names to item properties.
wiasSetPropChanged Modifies a property context to indicate that a property is being changed.
wiasSetPropertyAttributes Sets the access flags and property values of an item's properties.
wiasSetValidFlag Sets the valid values for a WIA_PROP_FLAG property.
wiasSetValidListFloat Sets the valid values for a WIA_PROP_LIST property of type sub-VT_R4.
wiasSetValidListGuid Sets the valid values for a WIA_PROP_LIST property of subtype VT_CLSID.
wiasSetValidListLong Sets the valid values for a WIA_PROP_LIST property of type sub-VT_I4.
wiasSetValidListStr Sets the valid values for a WIA_PROP_LIST property of type sub-VT_BSTR.
wiasSetValidRangeFloat Specifies the range of valid values for a WIA_PROP_RANGE property of subtype VT_R4.
wiasSetValidRangeLong Specifies the range of valid values for a WIA_PROP_RANGE property of subtype VT_I4.
wiasUpdateValidFormat Updates the valid format of the property context for the current minidriver.
wiasValidateItemProperties Validates a list of simple item properties against their current valid values.
wiasWriteMultiple Writes multiple property values to a WIA item (the properties may be of different types).
wiasWritePropBin Writes a single binary property value to a WIA item.
wiasWritePropFloat Writes a floating-point property value to a WIA item.
wiasWritePropGuid Writes a GUID property value to a WIA item.
wiasWritePropLong Writes a long integer property value to a WIA item.
wiasWritePropStr Writes a string property value to a WIA item.

Update and transfer data

Function Description
wiasDownSampleBuffer Takes in a buffer of pixel data and downsamples it to the specified size.
wiasGetImageInformation Retrieves transfer context information from an item.
wiasParseEndorserString Parses an endorser string, replacing WIA service-defined and vendor-defined tokens in the string with values associated with the tokens.
wiasSendEndOfPage Calls the client callback routine during a data transfer, sending the current total page count.
wiasUpdateScanRect Updates the scanning area sizes of the scanning device.
wiasWriteBufToFile Writes the contents of a temporary page buffer to an image file.
wiasWritePageBufToFile Writes the contents of a temporary page buffer to an image file. Use this function to write a page to a multi-page TIFF file.