ISurrogate::FreeSurrogate (Windows CE 5.0)

Send Feedback

This method terminates the surrogate process. COM calls this method when all of the DLL servers running in a surrogate process have terminated.

HRESULT FreeSurrogate();

Parameters

None.

Return Values

This method supports the standard return values including E_FAIL, and E_UNEXPECTED, and S_OK.

Remarks

COM calls ISurrogate::FreeSurrogate when there are no more DLL servers running in the surrogate process. When ISurrogate::FreeSurrogate is called, the method must properly revoke all of the class factories registered in the surrogate, and then cause the surrogate process to exit.

Surrogate processes must call the CoFreeUnusedLibraries function periodically to unload DLL servers that are no longer in use. The surrogate process assumes this responsibility, which would usually be the client's responsibility.

CoFreeUnusedLibraries calls the DllCanUnloadNow function on any loaded DLL servers.

Because CoFreeUnusedLibraries depends on the existence and proper implementation of the DllCanUnloadNow function in DLL servers, it is not guaranteed to unload all DLL servers that should be unloaded (not every server implements DllCanUnloadNow) and this function is unreliable for free-threaded DLLs.

Additionally, the surrogate has no way of being informed when all DLL servers are gone.

COM, however, can determine when all DLL servers have been unloaded, and will then call the FreeSurrogate method.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Objidl.idl, Objidl.idl.
Link Library: Ole32.lib, Uuid.lib.

See Also

CoFreeUnusedLibraries | DllCanUnloadNow | ISurrogate | ISurrogate::LoadDllServer

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.