Share via


IWMSClassObject::AllocIWMSContext

banner art

Previous Next

IWMSClassObject::AllocIWMSContext

The AllocIWMSContext method allocates a context.

Syntax

  

Parameters

riid

[in] REFIID specifying the context GUID. This must be equal to IID_IWMSContext.

ContextType

[in] A WMS_CONTEXT_TYPE enumeration value specifying the context type. This must be one of the following values.

Value Description
WMS_UNKNOWN_CONTEXT_TYPE The type of the context is unknown.
WMS_SERVER_CONTEXT_TYPE The context contains information about the server.
WMS_USER_CONTEXT_TYPE The context contains information about the client.
WMS_PRESENTATION_CONTEXT_TYPE The context contains information about the presentation being streamed to clients. This includes the bit rate, duration, and so on.
WMS_CONTENT_DESCRIPTION_CONTEXT_TYPE The context contains information about the content being streamed to clients. This includes the name of the author, a description of the content, and so on.
WMS_COMMAND_REQUEST_CONTEXT_TYPE The context contains information about client requests.
WMS_COMMAND_RESPONSE_CONTEXT_TYPE The context contains information about server responses to client requests.
WMS_TRANSPORT_SPEC_CONTEXT_TYPE The context contains information about the transport protocol used to deliver the stream.
WMS_PACKETIZER_CONTEXT_TYPE The context contains information about data packets.
WMS_CACHE_CONTENT_INFORMATION_CONTEXT_TYPE The context contains information about a cache.
WMS_ARCHIVE_CONTEXT_TYPE The context contains information about an archive.

pRelatedContext

[in] Pointer to a related context. This can be NULL. However, it is recommended that you pass a pointer to the user context when you are creating a context that is associated with a particular user. This enables the server to use the same critical section for both the context being created and the user context, thereby minimizing the number of critical sections required and decreasing the risk of deadlocks.

ppunk

[out] Pointer to an IWMSContext interface.

Return Values

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

Return code Number Description
E_INVALIDARG 0x80070057 The ppunk parameter is NULL.
E_OUTOFMEMORY 0x8007000E There was not enough memory to create the context.

Remarks

The server sends your plug-in a pointer to the IWMSClassObject interface when it calls the IWMSBasicPlugin::InitializePlugin method.

Example Code

  if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary objects.

Requirements

Header: nsscore.h.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Previous Next