# 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 (this is a different table than the running object table). When a server is registered in the class table, it allows the 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. There are several instance creation and activation functions described in Instance Creation Helper 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).