Share via


IWMSPlugin.Status (C#)

banner art

Previous Next

IWMSPlugin.Status (C#)

The Status property retrieves the status of the plug-in.

Syntax

  int = Plugin.Status;

Property Value

The bit field of the int returned by this property contains an enumeration value from the WMS_PLUGIN_STATUS enumeration type. This must be a logical OR of the following values.

Value Description
WMS_PLUGIN_NONE The plug-in is not loaded.
WMS_PLUGIN_ERROR An error has occurred in the plug-in.
WMS_PLUGIN_LOADED The plug-in has been loaded.
WMS_PLUGIN_ENABLED The plug-in has been enabled.
WMS_PLUGIN_LOADED_IN_PROC The plug-in was loaded into the client process.
WMS_PLUGIN_LOADED_OUT_OF_PROC The plug-in was loaded outside of the client process.
WMS_PLUGIN_REMOVE_ON_SERVICE_RESTART The plug-in will be removed when Windows Media Services is restarted.

Remarks

This property is read-only. When the server starts, plug-ins that are not enabled have a status of WMS_PLUGIN_NONE. When you both load and enable a plug-in, the plug-in status is WMS_PLUGIN_LOADED & WMS_PLUGIN_ENABLED. If the plug-in fails after it has been loaded, the plug-in status is WMS_PLUGIN_LOADED & WMS_PLUGIN_ERROR. When you set the IWMSPlugin.Enabled property to false, the plug-in status is WMS_PLUGIN_LOADED.

When a plug-in error occurs, the Status property on the IWMSServer object indicates that either a critical or non-critical error has occurred. For more information, see the IWMSServer.Status property.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer          Server;
IWMSPlugins        Plugins;
IWMSPlugin         Plugin;

int               iValue;
string             strText;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPlugins object.
    Plugins = Server.Authenticators;

    // Retrieve information about each plug-in.
    for (int i = 0; i < Plugins.Count; i++)
    {
        Plugin = Plugins[i];

        // Retrieve the current status of the plug-in.
        iValue = Plugin.Status;

        // Retrieve error information if the plug-in
        // is in error status.
        if (iValue == WMS_PLUGIN_STATUS.WMS_PLUGIN_ERROR)
        {
            iValue = Plugin.ErrorCode;
            strText = Plugin.ErrorText;
        }
    }
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

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

See Also

Previous Next