次の方法で共有


3.1.4.3.3 IWbemServices::QueryObjectSink (Opnum 5)

The QueryObjectSink method obtains a notification handler that allows the client to send events directly to the server.

 HRESULT QueryObjectSink(
   [in] long lFlags,
   [out] IWbemObjectSink** ppResponseHandler
 );

lFlags: This parameter is not used and its value MUST be 0x0.

ppResponseHandler: MUST be a pointer to a QueryObjectSink interface pointer to the notification handler that allows the client to send events directly to the server. This parameter MUST be set to NULL on error.

Return Values: This method MUST return an HRESULT value that MUST indicate the status of the method call. The server MUST return WBEM_S_NO_ERROR (specified in section 2.2.11) to indicate the successful completion of the method.

WBEM_S_NO_ERROR (0x00)

The security principal that makes the call MUST have WBEM_REMOTE_ENABLE, WBEM_ENABLE, and WBEM_FULL_WRITE accesses to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.

In response to the IWbemServices::QueryObjectSink method, the server MUST return an IWbemObjectSink interface pointer in ppResponseHandler. The server MUST return an error if the ppResponseHandler is NULL or if it is unable to create the requested interface pointer.

The successful method execution MUST fill the ppResponseHandler parameter and MUST return WBEM_S_NO_ERROR.

The failed method execution MUST set the output parameters to NULL and MUST return an error in the format as specified in section 2.2.11.

When extrinsic events are delivered to the server by using IWbemObjectSink::Indicate as specified in section 3.1.4.2.1, the server MUST send the event objects to all WMI clients whose notification query satisfies the event objects that are delivered through IWbemObjectSink::Indicate and whose security permissions match the security descriptor as specified in section 5.2. Refer to section 3.1.6.1 for information on how the result objects are delivered to the client.

The notification query is made by the client to the server by calling IWbemServices::ExecNotificationQuery or IWbemServices::ExecNotificationQueryAsync. Refer to sections 3.1.4.3.20 and 3.1.4.3.21 for information about how the server processes the client requests for notifications.