Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
Since event sinks are COM objects it is possible to wrap or package the event sink class in a COM+ Application (previously a MTS wrapper). A COM+ Application provides a user context in which the event will always run. This is advantageous in that the event may now access the store with the privileges of the package's security context without having to log on.
The disadvantage to this approach is that the registration is at a per object level. This means that the sink will always be run with a particular user context. Conversely this is an advantage for some sinks in which the security context is always the same (typically at an administration level). Another advantage is that all logon and security tasks can be managed outside of the sink code at the COM+ Application level.
Note COM+ Application wrapper can have only one security context per registered sink class. In cases where the same sink class requires different security contexts it will be necessary to wrap the sink class multiple times and register them as different sink classes.
One COM object that typically must be wrapped by a COM+ Application package is the Script Host Sink. See also Using Scripts as Sinks for related information.
It is also possible to create COM+ applications that run at startup. In some cases this can be useful for initialization purposes.
Sinks are run out of the store process. If you create a DLL COM object sink, it will need to be run by a surrogate host executable. The dllhost.exe is typically used, though some configurations to the registry are required. This configuration is explained in subjects concerning surrogate hosts. However, when you wrap your DLL in a COM+ Application the surrogate host registrations are performed automatically.
Individual event sinks may enforce additional security restrictions by employing role-based security at the component, interface or method level. See "Security in COM+" in the COM+ section of the Platform SDK in the MSDN™ Library.