The IWbemServices::QueryObjectSink method allows the caller to obtain a notification handler that is exported by Windows Management. This allows the caller to write notifications and events directly to Windows Management. The caller should only write extrinsic events to Windows Management. For more information, see Determining the Type of Event to Receive.
HRESULT QueryObjectSink( long lFlags, IWbemObjectSink **ppResponseHandler );
Reserved. This parameter must be 0.
Receives the interface pointer to the notification handler. This is set to point to NULL when there is an error. The returned pointer has a positive reference count, and the caller must call IWbemServices::Release on the pointer when it is no longer needed. A NULL value can be returned if no notification handler is available. This is not an error.
This method returns an HRESULT indicating the status of the method call. The following list lists the value contained withinan HRESULT.
COM-specific error codes also may be returned if network problems cause you to lose the remote connection to Windows Management.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|
|Header||wbemcli.h (include Wbemidl.h)|
|DLL||Fastprox.dll; Esscli.dll; FrameDyn.dll; FrameDynOS.dll; Ntevt.dll; Stdprov.dll; Viewprov.dll; Wbemcomn.dll; Wbemcore.dll; Wbemess.dll; Wbemsvc.dll; Wmipicmp.dll; Wmidcprv.dll; Wmipjobj.dll; Wmiprvsd.dll|