Bewerken

Delen via


Transferring Data to a WIA Application

When an application initiates a data transfer, the WIA service calls the IWiaMiniDrv::drvAcquireItemData method to perform the transfer. This method is responsible for acquiring data from the device and sending that data back to the application using the IWiaMiniDrvCallBack::MiniDrvCallback method.

In Microsoft Windows Millennium Edition (Me) and Windows XP, the WIA minidriver should be able to handle two types of data transfers: file and memory. To determine which type of transfer the application initiated, the minidriver should read the WIA_IPA_TYMED property value or check the tymed member of the MINIDRV_TRANSFER_CONTEXT structure. The second option is valid only if the WIA minidriver called the wiasGetImageInformation service function first. The wiasGetImageInformation service function automatically reads the WIA_IPA_TYMED property and assigns the value to the tymed member of the MINIDRV_TRANSFER_CONTEXT structure.

The preferred way is for the WIA minidriver to read the WIA_IPA_TYMED property value. This guarantees that the minidriver is performing the proper type of acquisition.

Beginning with Windows Vista, a simplified stream-based transfer method is introduced. For more information on this data transfer method see IStream Data Transfers.

This section covers the following topics:

Understanding TYMED

Allocating Memory for Data

Canceling a Data Transfer

Canceling Pending I/O Operations

RAW Format Data Transfer

For basic information about data transfers using TYMED( in-memory and file transfers) and stream-based transfers see Data Transfers.