Partager via


Prise en charge des commandes du pilote WIA

Une commande d’appareil WIA est une requête envoyée par le service WIA (pour le compte de l’application d’imagerie) au minidriver WIA, en lui demandant d’effectuer une action particulière.

Voici une liste des commandes d’appareil WIA qui peuvent être émises à un minidriver :

Command Meaning
WIA_CMD_CHANGE_DOCUMENT Passez au document suivant (émis uniquement pour les scanneurs multidocuments).
WIA_CMD_DELETE_ALL_ITEMS Supprimez l’arborescence d’éléments du pilote.
WIA_CMD_DIAGNOSTIC Réservé par Microsoft.
WIA_CMD_SYNCHRONIZE Régénérez l’arborescence d’éléments du pilote. Tous les minidrivers doivent prendre en charge cette commande.
WIA_CMD_TAKE_PICTURE Prenez une photo (émise uniquement aux caméras).
WIA_CMD_UNLOAD_DOCUMENT Déchargez le document actif (émis uniquement pour les scanneurs multidocuments).

Les commandes WIA_CMD_XXX sont décrites dans la documentation du Kit de développement logiciel (SDK) Microsoft Windows. Vous pouvez inclure votre propre liste personnalisée de commandes.

Ajout de la prise en charge des commandes d’appareil

To properly set up your WIA minidriver to report device commands, report an array of supported commands in the IWiaMiniDrv::drvGetCapabilities method. For an example implementation of the IWiaMiniDrv::drvGetCapabilities method, see Adding Interrupt Event Support.

Implémenter la méthode IWiaMiniDrv ::d rvDeviceCommand

The WIA service calls the IWiaMiniDrv::drvDeviceCommand method in response to the application's call to the IWiaItem::DeviceCommand method (described in the Microsoft Windows SDK documentation). The IWiaMiniDrv::drvDeviceCommand method should perform the following tasks:

  1. Déterminez si la commande envoyée est une commande prise en charge.

  2. Traitez la demande de commande.

The WIA driver should determine the WIA item that is to receive the device command by using the pWiasContext pointer. Le pilote WIA doit ensuite traiter la commande d’appareil reçue ciblant l’élément WIA entrant. Toute commande envoyée au pilote WIA qui n’est pas prise en charge doit être défaillante avec un code d’erreur E_INVALIDARG.

For an example implementation of the IWiaMiniDrv::drvDeviceCommand method, see Informing an Application of Item Tree Changes.