[install-section-name.Services] |
[install-section-name.nt.Services] |
[install-section-name.ntx86.Services]
[install-section-name.ntia64.Services]
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]...]
Each per-Models DDInstall.Services section contains one or more INF AddService directives referencing additional INF-writer-defined sections in a Windows 2000 or later INF file.
Windows 2000 and later INF files commonly use the DDInstall.Services section with at least one AddService directive to control how and when the services of a particular driver are loaded, any dependencies on other services or on underlying (legacy) drivers it might have, and so forth. Optionally, they set up event-logging services by the device drivers as well.
DDInstall.Services sections should have the same platform and OS decorations as their related DDInstall sections. For example, a install-section-name.ntx86 section would have a corresponding install-section-name.ntx86.Services section.
This section is irrelevant to exclusively Windows 9x/Me installations.
Needs entries cannot be nested. (For further information on the Needs entry and restrictions on its use, see Specifying the Source and Target Locations for Device Files.)
The given DDInstall section must be referenced in a device/models-specific entry under the per-manufacturer Models section of the INF file. The case-insensitive extensions to the install-section-name shown in the formal syntax statement can be inserted into such a DDInstall.Services section name in dual-OS and/or cross-platform INF files. For information about how to use the system-defined .nt, .ntx86, and .ntia64 extensions, see Creating INF Files for Multiple Platforms and Operating Systems.
This example shows the DDInstall.Services section for the Ser_Inst section shown as an example for the INF DDInstall section.
[Ser_Inst.Services]
AddService=sermouse, 0x00000002, sermouse_Service_Inst,\
sermouse_EventLog_Inst
;
; flags value in preceding entry indicates function driver of device
;
AddService = mouclass,, mouclass_Service_Inst, mouclass_EventLog_Inst
; entries in the following xxx_Inst sections omitted here for brevity,
; but fully specified as the example for the AddService directive
;
[sermouse_Service_Inst]
; ...
[sermouse_EventLog_Inst]
; ...
[mouclass_Service_Inst]
; ...
[mouclass_EventLog_Inst]
; ...
This example shows the install-section-name.NT.Services section and its service-install-sections in the INF file for the system-supplied WDM audio device/driver shown as an example for the INF DDInstall section.
[WDMPNPB003_Device.NT.Services] AddService = wdmaud,0x00000000,wdmaud_Service_Inst AddService = swmidi,0x00000000,swmidi_Service_Inst AddService = sb16, 0x00000002,sndblst_Service_Inst [wdmaud_Service_Inst] DisplayName = %wdmaud.SvcDesc% ; friendly name (see Strings) ServiceType = 1 ; SERVICE_KERNEL_DRIVER StartType = 1 ; SERVICE_SYSTEM_START ErrorControl = 1 ; SERVICE_ERROR_NORMAL ServiceBinary = %10%\system32\drivers\wdmaud.sys [swmidi_Service_Inst] DisplayName = %swmidi.SvcDesc% ServiceType = 1 StartType = 1 ErrorControl = 1 ServiceBinary = %10%\system32\drivers\swmidi.sys [sndblst_Service_Inst] DisplayName = %sndblst.SvcDesc% ServiceType = 1 StartType = 1 ErrorControl = 1 ServiceBinary = %10%\system32\drivers\mssb16.sys [Strings] ; only immediately preceding %strkey% tokens shown here %wdmaud.SvcDesc%="Microsoft WDM Virtual Wave Driver (WDM)" %swmidi.SvcDesc%="Microsoft Software Synthesizer (WDM)" %sndblst.SvcDesc%="WDM Sample Driver for SB16"
The reference for the INF DDInstall.HW section has more examples of DDInstall.Services sections with some service-install-sections referenced by the AddService directive, including one for a PnP filter driver.