附录 B:用在 Windows Vista 中的供应商提供的 INF 文件的示例

附录 B:用在 Windows Vista 中的供应商提供的 INF 文件的示例

本附录包含有关如何实现引用 Bth.inf 的供应商提供的 INF 文件的示例。 实现此特定示例以安装与 Windows XP 或 Windows Vista 中蓝牙规范版本 2.0 及 EDR 兼容的无线电。 其他类型的蓝牙设备的 INF 文件类似。

此 INF 文件可用于在以下版本的 Windows 上安装设备:

  • 32 位版本的 Windows XP SP2 及更高版本的 Service Pack 的所有 SKU。
  • 64 位版本的 Windows XP 的所有 SKU
  • Windows Vista 的所有 SKU

注意

此 INF 文件不能与 Windows 2000、Windows Server 2003 或任何尚未升级到至少 SP2 的 Windows XP 版本一起使用。 此外,Windows 7 不需要供应商提供的 INF 文件,因为任何具有 USB\Class_E0&SubClass_01&Prot_01 硬件 ID 的 USB 设备都将作为 Windows 7 中的泛型蓝牙适配器进行安装。

有关突出显示的节和指令的说明,请参阅以下示例后面带编号的注释:

; XYZ Vendor INF File for Bluetooth Radio
;
; A sample INF for a stand-alone Bluetooth radio that does not
; have native Windows Vista support

; [1]
 [Version]
Signature            = "$Windows NT$"
Provider             = %ProviderName%
Class                = Bluetooth
CLASSGUID            = {e0cbf06c-cd8b-4647-bb8a-263b43f0f974};
DriverVer            = 10/28/2006,6.0.0.0                    ;
CatalogFile.NT     = BTHXYZ1.CAB

 [ControlFlags]
ExcludeFromSelect=*

[SourceDisksNames]
1=%SourceDisk%,,1

[Manufacturer]
%ManufacturerName% = XYZBth,NT.5.1,NTx86,NTamd64

; Match on a hardware ID generated by the device, for x86 and x64.

; [2]
[ZYXBth.NT.5.1]
%BthRadio1%        = Bt1.NT.5.1, USB\VID_xxxx&PID_yyyy
[ZYXBth.NTx86]
% BthRadio1%       = Bt1.NT.5.1, USB\VID_xxxx&PID_yyyy
[ZYXBth.NTamd64]
% BthRadio1%       = Bt1.NT.5.1, USB\VID_xxxx&PID_yyyy

; Windows XP specific sections -------------------------

; [3]
[Bt1.NT.5.1]
include         = bth.inf
needs           = BthUsb.NT

[Bt1.NT.5.1.HW]
include     = bth.inf
needs       = BthUsb.NT.HW
DelReg      = DeleteRegKeys

[Bt1.NT.5.1.Services]
include     = bth.inf
needs       = BthUsb.NT.Services

; [4]
[DeleteRegKeys]
; Delete support for the Microsoft FaxService
HKLM,"SYSTEM\CurrentControlSet\Services\Bthport\Parameters\UnsupportedServices","{00001111-0000-1000-8000-00805f9b34fb}"

[Strings]
; While strings are localizable, in this sample INF, we have
; not created any localized strings.
ProviderName     = "Vendor XYZ (c)"
ManufacturerName = "Vendor XYZ (c)"
BthRadio1        = "Bluetooth 2.0+EDR Model 3.2 from XYZ (c)"
SourceDisk       = "Windows Vista CD"

注意:

  1. Version 节应设置 CLASSGUIDDriverVer 指令,如下所示:

    • CLASSGUID:将 Microsoft 类 GUID 用于蓝牙设备 ({e0cbf06c cd8b-4647-bb8a-263b43f0f974}),而不是第三方 GUID。
    • DriverVer:如果要取代默认的内置驱动程序,则必须设置驱动程序日期和版本以提供比 Bth.inf 中排名更高的匹配项。 有关详细信息,请参阅 Windows 如何为驱动程序包排名
  2. 硬件 ID。 VID 和 PID 的组合对制造商和设备必须是唯一的。 这样可确保同一硬件 ID 不会与多个设备相对应。

  3. IncludeNeeds 指令。 这三个节中的 Include 指令引用 Bth.inf。 Needs 指令指示在设备安装过程中应处理 Bth.inf 中的哪些节。

  4. 引用 DeleteRegKeys 节的 DelReg 指令将删除会阻止 Windows 为设备创建 PDO 或 devnode 的注册表项或值。 例如,传真服务配置文件当前位于不受支持服务的 Windows Vista 列表中,因此它是 UnsupportedServices 注册表项的值。 此示例会从 UnsupportedServices 项中删除传真服务配置文件,以允许 Windows 为设备创建 devnode。

强烈建议在设备和 INF 文件上运行最新的 WHQL 测试,并在 Windows Update 上发布 INF 文件包。 这样可确保当客户将新的蓝牙无线电连接到计算机时,可以从 Internet 自动下载 INF 文件。