Share via


IWMSWMIBridgeAdmin::get_ExposedEventClasses

banner art

Previous Next

IWMSWMIBridgeAdmin::get_ExposedEventClasses

The get_ExposedEventClasses method retrieves an enumeration value containing the event classes exposed by Windows Management Instrumentation.

Syntax

  

Parameters

pExposedEventClasses

[out] Pointer to the WMS_EVENT_CLASS enumeration value containing the event classes. This must be an exclusive OR of the following values.

Value Description
WMS_WMI_CLASS_UNKNOWN Indicates an unknown event class.
WMS_WMI_CLASS_CLIENT Indicates Windows Management Instrumentation (WMI) events for the client.
WMS_WMI_CLASS_SERVER Indicates WMI events for the server.
WMS_WMI_CLASS_PUBLISHING_POINT Indicates WMI events for the publishing point.
WMS_WMI_CLASS_LIMIT_CHANGE Indicates WMI events for limit changes.
WMS_WMI_CLASS_LIMIT_HIT Indicates WMI events for limit hits.
WMS_WMI_CLASS_PLUGIN Indicates WMI events for plug-ins.
WMS_WMI_CLASS_CACHE Indicates WMI events for a cache.
WMS_WMI_CLASS_PLAYLIST Indicates WMI events for playlists.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Number Description
E_FAIL c The server cannot find the WMS WMI Event Handler plug-in.
E_INVALIDARG 0x80070057 The pExposedEventClasses parameter is NULL.
E_POINTER 0x80004003 The pExposedEventClasses parameter is NULL.

Example Code

#include <windows.h>
#include <atlbase.h>    // Includes CComVariant.

// To access system plug-in interfaces, the
// entire type library must be imported as shown.
#import "WMSServerTypeLib.dll" no_namespace named_guids \
                               raw_interfaces_only

// Declare variables and interfaces.
IWMSServer          *pServer;
IWMSPlugins         *pPlugins;
IWMSPlugin          *pPlugin;
IDispatch           *pDispatch;
IWMSWMIBridgeAdmin  *pWMIBridgeAdmin;

HRESULT         hr;
CComVariant     varIndex;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to an IWMSPlugins interface
// containing event handler plug-ins.
hr = pServer->get_EventHandlers(&pPlugins);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPlugin interface
// of the plug-in to be configured.
varIndex = "WMS WMI Event Handler";
hr = pPlugins->get_Item(varIndex, &pPlugin);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the custom interface
// of the plug-in.
hr = pPlugin->get_CustomInterface(&pDispatch);
if (FAILED(hr)) goto EXIT;

// Query the specific administration interface
// for the plug-in.
hr = pDispatch->QueryInterface(IID_IWMSWMIBridgeAdmin,
                              (void **)&pWMIBridgeAdmin);
if (FAILED(hr)) goto EXIT;

// Retrieve the event classes that are exposed by
// Windows Management Instrumentation.
WMS_EVENT_CLASS ecExposedEvents;
hr = pWMIBridgeAdmin->get_ExposedEventClasses(&ecExposedEvents);
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

Requirements

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next