INF DDInstall.HW 區段

DDInstallHW 區段通常用於安裝多功能裝置、安裝 PnP 篩選驅動程式,以及設定登錄中任何使用者可存取但與驅動程式無關的資訊,無論是使用明確的 AddReg 指示詞,還是包含 IncludeNeeds 專案。

[install-section-name.HW] |
[install-section-name.nt.HW] |
[install-section-name.ntx86.HW] |
[install-section-name.ntia64.HW] | (Windows XP and later versions of Windows)
[install-section-name.ntamd64.HW] | (Windows XP and later versions of Windows)
[install-section-name.ntarm.HW] | (Windows 8 and later versions of Windows)
[install-section-name.ntarm64.HW] (Windows 10 version 1709 and later versions of Windows)
 
[AddReg=add-registry-section[,add-registry-section]...] ...
[Include=filename.inf[,filename2.inf]...]
[Needs=inf-section-name[,inf-section-name]...]
[DelReg=del-registry-section[,del-registry-section]...] ...
[BitReg=bit-registry-section[,bit-registry-section] ...] 

項目

通用 INF 中不支援所有有效的專案。 下列列出哪些指示詞在通用 INF 中有效,以及哪些指示詞無效。

通用 INF 中支援

AddReg=add-registry-section[,add-registry-section]...
參考此 DDInstall 所涵蓋裝置的 INF 檔案中其他位置的一或多個 INF 寫入器定義 add-registry-sectionsHW 區段。 add-registry-section 通常會在登錄中安裝篩選和/或儲存每個裝置資訊。 這類 add-registry-section 中的 HKR 規格會指定裝置的硬體密鑰,這是包含裝置相關信息的裝置特定登錄子機碼。 硬體金鑰也稱為裝置金鑰。 如需詳細資訊,請參閱 裝置和驅動程式的登錄樹狀架構和機碼。 驅動程式套件可以在 DDInstall.HW 區段所參考的 add-registry-section 中使用 HKR 規格,透過 INF 新增設定。

如需詳細資訊,請參閱 INF AddReg 指示詞

Include=filenameinf[,filename2.inf]...
指定一或多個額外的系統提供的 INF 檔案,其中包含安裝此裝置所需的區段。 如果指定此專案,通常是 需要 專案。

Needs=inf-section-name[,inf-section-name]...
指定此裝置安裝期間必須處理的具名區段。 一般而言,這類具名區段是 DDInstall。系統提供 INF 檔案內的 HW 區段,該檔案列在 Include 專案中。 不過,它可以是這類 DDInstall 內參考的任何區段。內含 INF 的 HW 區段。

通用 INF 不支援

DelReg=del-registry-section[,del-registry-section]...
參考此 DDInstall 區段所涵蓋裝置驅動程式的 INF 檔案中其他位置的一或多個 INF 寫入器定義 delete-registry-section。 這類 delete-registry 區段會從目標電腦移除先前安裝之裝置/驅動程式的過時登錄資訊。 這類 delete-registry 區段中的 HKR 規格會指定與 AddReg 相同的子機碼。

這個指示詞很少使用,但 INF 檔案中升級先前在定義此 DDInstall 區段名稱的個別製造商每一型號區段中所列的相同裝置/型號安裝。 如需詳細資訊,請參閱 INF DelReg 指示詞

BitReg=bit-registry-section[,bit-registry-section] ...
在本節中有效,但幾乎從未使用過。 參考之位登錄區段中的 HKR 規格會指定與 AddReg 相同的子機碼。 如需詳細資訊,請參閱 INF BitReg 指示詞

備註

型式語法語句中所顯示 install-section-name 的不區分大小寫延伸模組可以插入這類 DDInstall 中。跨平臺 INF 檔案中的 HW 區段名稱。 如需如何使用系統定義 .nt.ntx86.ntia64、.ntamd64.ntarm.ntarm64 延伸模組的詳細資訊,請參閱建立多個平臺和操作系統的 INF 檔案

任何 DDInstallHW 區段必須具有下列其中一項:

  • AddReg 指示詞。
  • 指定另一個 INF 檔案的 Include 專案。 在此情況下, DDInstallHW 區段也必須包含對應的 Needs 專案,以指定其他 INF 檔案中的區段。 本節用來設定必要的登錄資訊。

DDInstall 中的每個指示詞。HW 區段可以參考多個 INF 寫入器定義的區段。 不過,每個額外的具名區段都必須以逗號分隔 (,) 。

每個這類區段名稱在 INF 檔案內必須是唯一的,而且必須遵循定義區段名稱的一般規則。 如需這些規則的詳細資訊,請參閱 INF 檔案的一般語法規則

如需如何安裝多功能裝置的詳細資訊,請參閱 支援多功能裝置

範例

此範例示範驅動程式套件如何使用 DDInstallHW 區段和 DDInstall 同時新增函式驅動程式和 PnP 上層篩選驅動程式的服務區段。

[Example_DDInstall]
CopyFiles=example_copyfiles

[Example_DDInstall.HW]
AddReg=filter_addreg

[filter_addreg]
HKR,,"UpperFilters",0x00010000,"ExampleUpperFilter" ; [REG_MULTI_SZ](https://learn.microsoft.com/windows/desktop/SysInfo/registry-value-types) value 

[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

另請參閱

AddReg

BitReg

DDInstall

DDInstall.Services

DelReg