大网数据广告活动
Windows 系统接口

Registering a Running EXE Server

· 52CE 我爱测

Registering a Running EXE Server

When an executable (EXE) server is launched, it should call CoRegisterClassObject, which registers the CLSID for the server in what is called the class table (a different table than the running object table). When a server is registered in the class table, it allows the service control manager (SCM) to determine that it is not necessary to launch the class again, because the server is already running. Only if the server is not listed in the class table will the SCM check the registry for appropriate values and launch the server associated with the given CLSID.

You pass CoRegisterClassObject the CLSID for the class and a pointer to its IUnknown interface. Clients who subsequently call CoGetClassObject with this CLSID will retrieve a pointer to their requested interface, as long as security does not forbid it. (See Instance Creation Helper Functions for a description of several instance creation and activation functions.)

The server for a class object should call CoRevokeClassObject to revoke the class object (remove its registration) when all of the following are true:

  • There are no existing instances of the object definition.
  • There are no locks on the class object.
  • The application providing services to the class object is not under user control (not visible to the user on the display).

Related topics

Installing as a Service Application

Registering a Class at Installation

Registering Objects in the ROT

Self-Registration

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。