共用方式為


INF DDInstall.COM 區段

每個模型 DDInstall.COM 區段都包含一或多個 INF AddComServer 指示詞,這些指示詞 會參考 INF 檔案中其他 INF 寫入器定義的區段。 Windows 11 版本 24H2 和更新版本支援本節。

[install-section-name.COM] |
[install-section-name.nt.COM] |
[install-section-name.ntamd64.COM] |
[install-section-name.ntarm64.COM]

AddComServer = com-server-name, [flags], com-server-install-section
[Include=filename.inf[,filename2.inf]...]
[Needs=inf-section-name[,inf-section-name]...]

At least one AddComServer directive is required to register COM servers.

Entries

AddComServer=com-server-name,flags,com-server-install-section

The AddComServer directive references an INF-writer-defined com-server-install-section elsewhere in the INF file. The AddComServer directive can be used one or more times to register multiple COM servers. 如需詳細資訊,請參閱 INF AddComServer 指示詞 ,而針對一般 COM 伺服器,請參閱 COM 用戶端和伺服器

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

此選擇性專案會指定一或多個其他系統提供的 INF 檔案,其中包含安裝此裝置所需的區段。 If this entry is specified, a Needs entry is also required.

Needs=inf-section-name[,inf-section-name]...

此選用項目指定安裝此裝置期間必須處理的區段。 一般而言,區段是系統提供的 INF 檔案內的 DDInstall.COM 區段,會列在 Include 專案中。 不過,它可以是 DDInstall.COM 區段內參考的任何區段。

Remarks

COM binaries are installed into place using the CopyFiles directive in the DDInstall section. 二進位檔應該安裝到相對於驅動程式套件驅動 程式存放區路徑 的位置 (例如 DIRID 13) 。 同樣地,裝置安裝會在裝置相對登錄位置下寫入 COM 註冊。

Clients must call CoRegisterDeviceCatalog on a worker thread before calling CoCreateInstance. Calling CoRegisterDeviceCatalog makes the COM server registrations available in the process for the COM runtime to use.

DDInstall.COM 區段應該具有與其相關 DDInstall 區段相同的平臺和作業系統裝飾。 例如,install-section-name.ntamd64 區段會有對應的 install-section-name.ntamd64.COM 區段。 指定的 DDInstall 區段必須參考 INF 檔案中每個製造商型號區段下的裝置/型號特定專案。 正式語法陳述式中顯示的 install-section-name 不區分大小寫延伸模組,可以插入跨平臺 INF 檔案中的這類 DDInstall.COM 區段名稱中。

For more information about how to use the system-defined .nt, .ntamd64, and .ntarm64 extensions see Creating INF Files for Multiple Platforms and Operating Systems.

Examples

[Device_Install.COM]
AddComServer   = VendorComServer,, VendorComServer_Inst

[VendorComServer_Inst]
ServerType     = 1 ; in-proc
ServerBinary   = %13%\Vendor_ComServer.dll
AddComClass    = {bb2b85ab-9473-42e5-8d1a-0f01d3879879},, Vendor_ComClass_Inst

[Vendor_ComClass_Inst]
Description    = %Vendor_ComClass_Desc%
ThreadingModel = Neutral

[Strings]
%Vendor_ComClass_Desc%="Vendor Com Server"

See also