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-writer-defined service-install-section ,而且可能參考 INF 檔案中其他位置的事件 記錄檔-install-section ,以取得此 DDInstall 區段所涵蓋裝置的驅動程式。 如需詳細資訊,請參閱 INF AddService 指示詞。
DelService=ServiceName[,[flags][,[EventLogType][,EventName]]]...
此指示詞會從目標計算機移除先前安裝的服務。 這個指示詞很少使用。 如需詳細資訊,請參閱 INF DelService 指示詞。
Include=filename。inf[,filename2.*inf_]...
此選擇性專案會指定一或多個額外的系統提供的 INF 檔案,其中包含安裝此裝置所需的區段。 如果指定此專案,通常是 需要 專案。
Needs=inf-section-name[,inf-section-name]...
這個選擇性專案會指定在安裝此裝置期間必須處理的區段。 一般而言,區段是 DDInstall。系統 提供 INF 檔案內的 Services 區段,該檔案列在 Include 專案中。 不過,它可以是 DDInstall 內參考的任何區段。服務 區段。
備註
DDInstall。服務 區段應該具有與其相關 DDInstall 區段相同的平臺和操作系統裝飾。 例如 ,install-section-name。ntx86 區段會有對應的 install-section-name。ntx86。服務 區段。
指定的 DDInstall 區段必須在 INF 檔案之每一製造商 型號 區段下的裝置/型號特定項目中參考。 型式語法語句中所顯示 install-section-name 的不區分大小寫延伸模組可以插入這類 DDInstall 中。跨平臺 INF 檔案中的服務 區段名稱。
如需如何使用系統定義 .nt、.ntx86、.ntia64、.ntamd64、.ntarm 和 .ntarm64 延伸模組的詳細資訊,請參閱建立多個平臺和操作系統的 INF 檔案。
範例
此範例顯示 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 篩選驅動程式的其中一個。
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應