CoRegisterSurrogate function (combaseapi.h)

Registers the surrogate process through its ISurrogate interface pointer.


HRESULT CoRegisterSurrogate(
  [in] LPSURROGATE pSurrogate


[in] pSurrogate

A pointer to the ISurrogate interface on the surrogate process to be registered.

Return value

This function returns S_OK to indicate that the surrogate process was registered successfully.


The CoRegisterSurrogate function sets a global interface pointer to the ISurrogate interface implemented on the surrogate process. This pointer is set in the ole32 DLL loaded in the surrogate process. COM uses this global pointer in ole32 to call the methods of ISurrogate. This function is usually called by the surrogate implementation when it is launched.

As of Windows Server 2003, if a COM object application is registered as a service, COM verifies the registration. COM makes sure the process ID of the service, in the service control manager (SCM), matches the process ID of the registering process. If not, COM fails the registration.


Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header combaseapi.h (include Objbase.h)
Library Ole32.lib
DLL Ole32.dll

See also


Writing a Custom Surrogate