静止图像设备的 INF 文件

The default class installer for still image devices, sti_ci.dll, recognizes a special set of INF file entries. 在 INF 文件中,这些条目必须放置在设备的 INF DDInstall 节中。 下表描述了这些条目。

INF 文件条目 Value Comments
SubClass StillImage Required
DeviceType 1 用于扫描仪,2 用于相机,3 用于视频设备 Required
DeviceSubType Vendor-defined value Optional
Connection 对于连接到串行或并行端口的非 PnP 设备,它可以是串行或并行设备,以限制用户在安装期间选择的端口。 Optional.
如果未指定,用户可以选择任何串行或并行端口。
Capabilities 指定一个数字,该数字被转换为标识设备功能的比特标志。 These flags are stored in the registry and are available to Microsoft STI components with the STI_DEV_CAPS structure.

位 0 • 在 STI_DEV_CAPS 中设置/清除STI_GENCAP_NOTIFICATIONS
位 1 • 在 STI_DEV_CAPS 中设置/清除STI_GENCAP_POLLING_NEEDED
位 2 • 在 STI_DEV_CAPS 中设置/清除STI_GENCAP_GENERATE_ARRIVALEVENT
位 3 • 在 STI_DEV_CAPS 中设置/清除STI_GENCAP_AUTO_PORTSELECT
Optional
PropertyPages 标识为 静止图像设备创建自定义属性表页的 DLL 的名称和入口点。
The following example identifies the DLL, estp2cpl.dll, and the EnumStiPropPages entry point in this DLL. The entry point name is optional; if omitted, the entry point defaults to EnumStiPropPages.

PropertyPages = estp2cpl.dll, EnumStiPropPages

Optional
DeviceData Identifies a vendor-supplied data section containing information to be stored in the registry, under the DeviceData key. For TWAIN-supported devices, the data section must contain a TwainDS entry. 有关详细信息,请参阅 供应商可修改注册表值 Optional.
但是, 创建 Push-Model 感知应用程序需要此项。
Events 标识由供应商提供的数据部分,其中列出了静态图像设备事件。 本节中的每个条目必须采用以下格式:

EventName="String",{GUID},App

EventName is the event's internal name, String is the event's display string, GUID is the event's GUID, see Still Image Device Events, and App specifies the imaging application to be launched when the event occurs. To launch the currently registered application, use an asterisk (*) for App.
Optional.
但是, 创建 Push-Model 感知应用程序需要此项。
UninstallSection 指向通常包含 INF DelFiles 指令INF DelReg 指令的 INF 节。 本节中的条目采用以下格式:

UninstallSection=UninstallSectionName

UninstallSectionName is the name of the section containing Delfiles or DelReg directives. 即使使用 DelFiles 指令指定了某些文件,Windows 文件保护也可能禁止用户删除某些文件。
Optional.
此条目仅适用于 Windows 2000。

静止映像设备的默认类安装程序支持标准 INF CopyFiles 指令。 安装程序对组件文件使用内部引用计数器,因此卸载作期间不会过早删除由多个设备共享的文件。

The default INF file for still image devices, sti.inf, defines two installation sections for each device type, as follows:

  • 必须在供应商提供的 INF 文件的 DDInstall 节中引用的 INF DDInstall 节,如下表所示。

    USB devices SCSI devices Serial devices
    Include=sti.inf

    Needs=STI.USBSection
    Include=sti.inf

    Needs=STI.SCSISection
    Include=sti.inf

    Needs=STI.SerialSection
  • 必须在 DDInstall 中引用的 INF DDInstall.Services 节。供应商提供的 INF 文件的“服务”部分,如下表所示。

    USB devices SCSI devices Serial devices
    Include=sti.inf

    Needs=STI.USBSection.Services
    Include=sti.inf

    Needs=STI.SCSISection.Services
    Include=sti.inf

    Needs=STI.SerialSection.Services

如果还要 为映像获取 API 创建特定于设备的组件,通常会在 INF 文件中包括这些组件的文件名。

有关为静止映像设备创建 INF 文件的其他指南,可以查看随 Windows 一起提供的任何 INF 文件,其中包含条目“Subclass=StillImage”。

Remarks

为扫描程序开发 INF 文件时,可以使用 Microsoft OS 描述符 启用兼容性 ID 功能。 执行此作时,允许一个扫描程序驱动程序与多个扫描程序模型兼容。