Context Information

[This is preliminary documentation and subject to change.]

Context information is data shared between snap-ins. In MMC, information is shared based on hierarchy. The console itself acts like a snap-in, and root snap-ins thus get base context information. This data comes from basic information, command line parameters, and other sources. Snap-ins are responsible for providing data to their own nodes in that the console has no need to know or interfere with how a snap-in disseminates information to its own nodes.

The COM interface IDataObject is implemented by the snap-in, and data is shared in clipboard formats. This interface includes methods that enable data to be transferred and notifications to be generated when data changes. The console uses IDataObject::GetDataHere to get the information. This interface and method are documented in the Platform SDK.

Snap-ins are required to support four formats and the TYMED is always an HGLOBAL.

Calling AddRef (also documented in the Platform SDK) to increment the reference count on these data objects is generally not advantageous because it is possible that the snap-in could unload by the time it is needed. If the snap-in uses the function call that it was handed, the data object is guaranteed to be valid, unless an exception such as an access violation occurs.