com4:SurrogateServer

使用一个或多个类注册注册代理服务器。

元素层次结构

<包>

    <应用程序>

         <应用程序>

              <扩展>

                   <com4:SurrogateServer>

语法

<com4:SurrogateServer
  CustomSurrogateExecutable = 'A string with a value between 1 and 256 characters in length that must end with ".exe" and cannot contain these characters: <, >, :, ", |, ?, or *.'
  DisplayName = 'A string with a value between 1 and 256 characters in length. This string is localizable.'
  LaunchAndActivationPermission = 'An [SDDL string](/windows/win32/secauthz/security-descriptor-string-format) value.'
  AppId = 'A GUID in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.'
  SystemSurrogate = 'A string with the following optional value: "PreviewHost".' >

  <!-- Child elements -->
  Class
  InProcessServerClassReference
  ClassReference

</com4:SurrogateServer>

特性和元素

属性

属性 说明 数据类型 必须 默认值
CustomSurrogateExecutable AppId 密钥中 DllSurrogate 的路径。 此路径相对于包根目录,必须引用包中的文件。 这与 SystemSurrogate 是互斥的。 值长度介于 1 到 256 个字符之间的字符串,必须以 .exe 结尾,并且不能包含以下字符:<、、:>"|?、 或 *
DisplayName DisplayName 是对应于默认 AppID 密钥值的可本地化字符串。 值长度介于 1 到 256 个字符之间的字符串。
LaunchAndActivationPermission 与 AppID 密钥的 LaunchPermission 值相对应的 SDDL 字符串 SDDL 字符串值。
AppId 引用关联的 AppId 密钥的 AppId。 格式为 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 的 GUID。
SystemSurrogate 一个值,该值对应于 AppId 键的 DllSurrogate 值的已知值。 这在 CustomSurrogateExecutable 中是互斥的。 具有以下可选值的字符串:“PreviewHost”。

子元素

子元素 说明
定义代理项服务器类注册。
InProcessServerClassReference 指定与托管进程内服务器关联的类,并设置注册详细信息。
ClassReference 指定与注册的进程内服务器关联的类,并设置注册详细信息。

父元素

父元素 说明
扩展 定义应用的一个或多个扩展点。

注解

通过 COM 注册表布局中的 CLSID 密钥] (/windows/win32/com/clsid-key-hklm) ,可以注册 CLSID (CLSCTX_INPROC_SERVER) ,并在代理服务器 (CLSCTX_LOCAL_SERVER) 中注册 outofproc 激活:

  • InprocServer32 子项中的 Inproc 激活详细信息。
  • 通过 CLSID 键的 AppID 值对 AppID 密钥的引用,其中 AppID 键通过 DllSurrogate 值指定代理项。 请注意,对于代理服务器中的 outproc 激活,inproc 服务器注册详细信息(例如 dll 路径和 ThreadingModel)也用于 outofproc 激活。 InProcessServer 元素的 ClassReference 子元素允许一个包为 inproc 和 outofproc 激活注册 CLSID,将 inproc 服务器详细信息指定为 InProcessServer/ClassInProcessServer/ClassReference 元素一次,并从支持 CLSID 外proc 激活的 SurrogateServer 引用此元素。 与在 InProcessServer/ClassReference 和 SurrogateServer/ClassReference 元素中独立指定 dll 路径和 ThreadingModel 相比,inproc/outofproc 注册的此结构更能反映 COM 注册表布局。

将应用程序打包为代理服务器中注册的 CLSID 时,通常建议在清单中仅注册代理服务器。 例如,代理项注册通常用于支持基于 COM 的扩展点,这些扩展点在历史上启用了过程服务器实现,但现在建议将非proc 服务器注册作为隔离的最佳做法。 对于打包的应用程序,对于进程内服务器还有其他功能限制 (请参阅 In-ProcessServers 了解) 的详细信息,而具有 runFullTrust 受限功能 的任何包都可以成功注册代理服务器,并且对于大多数扩展点,注册代理服务器就足以启用扩展的功能。 但是,如果打包的应用程序需要支持其 CLID 的过程内激活,以便与请求过程内激活的其他应用程序 (CLSCTX_INPROC_SERVER) 兼容,并且满足注册 inproc 服务器的要求,则可以在代理项中注册 CLSID 进行proc 激活和 outofproc 激活。 在这种情况下,建议在 InProcessServer/Class 或 InProcessServer/ClassReference 元素中提供进程服务器详细信息,并从 SurrogateServer/InProcessServerClassReference 元素引用它们。

要求

Namespace http://schemas.microsoft.com/appx/manifest/com/windows10/4
Minimum OS Version Windows 10 (内部版本 20348)