此部分中的命令由 microdriver 用于设备事件支持。
CMD_GET_INTERRUPT_EVENT
由 WIA 平面驱动程序在单独的线程中调用,以监视使用来自设备的中断的按钮事件的状态(即,对于通过中断管道报告事件的 USB 设备)。 如果设备仅支持轮询,则不需要实现此命令,并且应返回E_NOTIMPL。
两个事件句柄将传递给 microdriver。 The lVal member of the VAL structure holds an event handle that should be signaled by the microdriver using the SetEvent function when a button event occurs. The handle member of the VAL structure holds an event handle that will be signaled by the WIA Flatbed Driver when the driver is being unloaded or shut down.
The pGuid member of the VAL structure should be set to point to the GUID of the button that was pushed. 如果未按下任何按钮,则应将其设置为GUID_NULL。
CMD_STI_GETSTATUS
WIA 平面驱动程序调用以获取设备的联机状态,如果设备具有按下按钮,则获取按钮状态。
Set the lVal member of the passed VAL structure to 1 if your device is online, and functioning properly. If lVal is set to any value other than 1, the device is considered offline, and it will fail the device test in Control Panel.
If the device supports buttons that do not use interrupts from the device and a button was pressed, the pGuid member of the passed VAL structure should be set to the GUID of the button event. If no buttons were pressed, point pGuid to the value GUID_NULL. 这表示没有挂起的事件。
如果设备支持轮询事件或希望设备显示在线状态,则需要此命令。