IWbemEventProvider::ProvideEvents method

Windows Management calls the IWbemEventProvider::ProvideEvents method to signal an event provider to begin delivery of its events.

Syntax


HRESULT ProvideEvents(
  [in]  IWbemObjectSink *pSink,
  [in]  long lFlags
);

Parameters

pSink [in]

Pointer to the object sink to which the provider will deliver its events. In an event provider implementation, you should use the IWbemObjectSink::Indicate method to send events through pSink. This is in contrast to other providers that may use the SetStatus method: The ProvideEvents method should use only Indicate to update a sink.

lFlags [in]

Reserved. This parameter must be 0.

Return value

This method returns an HRESULT indicating the status of the method call. The following table lists the value contained within an HRESULT.

Return codeDescription
WBEM_E_FAILED

The provider failed internally, and it cannot accept future requests.

WBEM_S_NO_ERROR

The provider received the sink, and it will begin delivery of events.

 

Remarks

Windows Management calls this method to activate the provider. Windows Management gives an IWbemObjectSink pointer to the event provider. The provider must call the AddRef method using this pointer to increment the reference count, and then return from the call.

Typically, the provider will create an independent thread, and deliver the events as they occur to the provided sink interface.

The provider is not permitted to block this call for more than a few seconds, but it must return as quickly as possible to Windows Management.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wbemprov.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

Wbemsvc.dll

 

 

Show:
© 2014 Microsoft