Lightweight client-side handlers allow you to create general client-side handlers of any size, to help you do any kind of standard task. As handlers, these are usable by more than one client. They differ from OLE handlers in that they cannot be created before the server is launched, and their lifetime is tied to that of the proxy manager, preventing a possible race condition in which the handler could otherwise be prematurely released.
The proxy manager is the object the system creates that implements the IMarshal interface. If you, like most developers, use standard marshaling, the system creates it for you when you call CoGetStandardMarshal, (or the new function for creating an aggregated marshaler for light-weight handlers, CoGetStdMarshalEx) and also implements the IClientSecurity and IMultiQI interfaces on the object. On the server side, there is a corresponding system object that also implements IMarshal, and these objects handle marshaling for you transparently.
There are two general types of these handlers that you may want to implement:
Some potential uses of the extra data in the stream supplied by the server are as follows:
Down level clients may not have the capability to unmarshal interfaces which have custom handlers, for two reasons. First, they may not understand the CLSID used in the custom marshaled packet when the server handler is aggregated and the object wants a handler. Second, the handler code may not even run on the client side anyway since it requires new functionality from COM to create the aggregated standard marshaler, and to do remote QueryInterface calls.