INF DDInstall.Services 部分

每个模型 DDInstall。Services 节包含一个或多个 INF AddService 指令 ,这些指令引用 INF 文件中其他 INF 编写器定义的节。

[install-section-name.Services] |
[install-section-name.nt.Services] |
[install-section-name.ntx86.Services] |
[install-section-name.ntia64.Services] | (Windows XP and later versions of Windows)
[install-section-name.ntamd64.Services] | (Windows XP and later versions of Windows)
[install-section-name.ntarm.Services] | (Windows 8 and later versions of Windows)
[install-section-name.ntarm64.Services] (Windows 10 version 1709 and later versions of Windows)
 
AddService=ServiceName,[flags],service-install-section
                     [,event-log-install-section[,[EventLogType][,EventName]]]...]
[DelService=ServiceName[,[flags][,[EventLogType][,EventName]]]]...
[Include=filename.inf[,filename2.inf]...]
[Needs=inf-section-name[,inf-section-name]...] 

可以提供 DDInstall。包含至少一个 AddService 指令的服务部分,用于控制如何以及何时加载特定驱动程序的服务、依赖于其他服务或驱动程序等。 (可选)还可以指定事件日志记录服务。

条目

AddService=ServiceName, [flags],service-install-section[,event-log-install-section[,[EventLogType][,EventName]]]...

此指令引用 INF 编写器定义的 service-install-section,并且可能引用此 DDInstall 节所涵盖设备的驱动程序的 INF 文件中其他位置的事件日志-install-section。 有关详细信息,请参阅 INF AddService 指令。

DelService=ServiceName [,[flags][,[EventLogType][,EventName]]]...

此指令从目标计算机中删除以前安装的服务。 此指令很少使用。 有关详细信息,请参阅 INF DelService 指令。

Include=filename.inf [,filename2.inf]...

此可选条目指定一个或多个其他系统提供的 INF 文件,其中包含安装此设备所需的部分。 如果指定了此项,则 为“需要 ”条目。

需求=inf-section-name [,inf-section-name]...

此可选条目指定在安装此设备期间必须处理的节。 通常,该部分是 DDInstall。系统提供的 INF 文件中的服务部分, 该文件列在 Include 条目中。 但是,它可以是 DDInstall 中引用的任何部分。服务 部分。

Remarks

DDInstall。服务 部分应具有与其相关的 DDInstall 部分相同的平台和操作系统修饰。 例如, install-section-name。ntx86 节将具有相应的 install-section-name。ntx86。服务 部分。

指定的 DDInstall 节必须在 INF 文件的“每制造商 型号” 部分下的特定于设备/型号的条目中引用。 可以将正式语法语句中显示的 install-section-name 的不区分大小写的扩展插入到此类 DDInstall 中。跨平台 INF 文件中的服务 节名称。

有关如何使用系统定义的 .nt、.ntx86、.ntia64、.ntamd64、.ntarm 和 .ntarm64 扩展的详细信息,请参阅为多个平台和操作系统创建 INF 文件。

Examples

此示例显示 install-section-name。NT。 INF 文件中的服务部分及其服务安装部分,用于将函数驱动程序和筛选器驱动程序添加到设备的示例驱动程序包。

[Example_DDInstall.Services]
AddService=ExampleFunctionDriver,0x00000002,function_ServiceInstallSection
AddService=ExampleUpperFilter,,filter_ServiceInstallSection

[function_ServiceInstallSection]
DisplayName    = %function_ServiceDesc%
ServiceType    = 1
StartType      = 3
ErrorControl   = 1
ServiceBinary  = %13%\ExampleFunctionDriver.sys

[filter_ServiceInstallSection]
DisplayName    = %filter_ServiceDesc%
ServiceType    = 1
StartType      = 3
ErrorControl   = 1
ServiceBinary  = %13%\ExampleUpperFilter.sys

[Strings] ; only immediately preceding %strkey% tokens shown here
%function_ServiceDesc%="Example function driver service"
%filter_ServiceDesc%="Example filter driver service"

有关 DDInstall 的更多示例,请参阅 INF DDInstall.HW 部分。包含 AddService 指令引用的某些 service-install-section的服务部分,包括一个用于 PnP 筛选器驱动程序的服务部分。

另请参阅