3.1.4.12.2 IWbemRefreshingServices::AddObjectToRefresherByTemplate (Opnum 4)

The IWbemRefreshingServices::AddObjectToRefresherByTemplate method MUST add a CIM instance, which is identified by its CIM object instance, to the list of CIM instances to be refreshed.

The AddObjectToRefresherByTemplate method opnum equals 4.

 HRESULT AddObjectToRefresherByTemplate(
   [in] _WBEM_REFRESHER_ID* pRefresherId,
   [in] IWbemClassObject* pTemplate,
   [in] long lFlags,
   [in] IWbemContext* pContext,
   [in] DWORD dwClientRefrVersion,
   [out] _WBEM_REFRESH_INFO* pInfo,
   [out] DWORD* pdwSvrRefrVersion
 );

pRefresherId: MUST be a pointer to the _WBEM_REFRESHER_ID structure, as specified in section 2.2.21, which identifies the client that is requesting refreshing services. This parameter MUST NOT be NULL.

pTemplate: MUST be a pointer to an IWbemClassObject interface CIM instance that MUST be a template for the CIM instances to be refreshed by the refresher. This parameter MUST NOT be NULL.

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

pContext: MUST be a pointer to an IWbemContext interface object, which MUST contain additional information for the server refresher. If pContext is NULL, the parameter MUST be ignored.

dwClientRefrVersion: MUST be the version of the client refresher. This value SHOULD<65> be 0x2. The server MUST allow all client versions.

pInfo: MUST be an output parameter that returns a _WBEM_REFRESH_INFO structure, as specified in section 2.2.20, which MUST contain refresher information about the CIM instance in wszPath. This parameter MUST NOT be NULL.

pdwSvrRefrVersion: MUST be an output parameter that MUST be the version of the server refresher. The value of this parameter SHOULD be 0x1.

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 and WBEM_ENABLE accesses to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.

In response to IWbemRefreshingServices::AddObjectToRefresherByTemplate, the server MUST evaluate the pTemplate parameter that defines the CIM instance, and it MUST return information to the client to handle the specific CIM instance as specified in this section.

A successful call to IWbemRefreshingServices::AddObjectToRefresherByTemplate MUST return WBEM_S_NO_ERROR and MUST fill the output _WBEM_REFRESH_INFO structure, as specified in this section.

The server MUST locate the InstanceProviderId for the instance in wszPath using the algorithm in section 3.1.4. If InstanceProviderId is not empty and the provider's SupportsRefresher field is TRUE, the server MUST return the _WBEM_REFRESH_INFO structure that has an m_lType set to _WBEM_REFRESH_INFO_REMOTE, otherwise returning one with m_lType set to __WBEM_REFRESH_TYPE_NON_HIPERF.

If the server sets m_lType to _WBEM_REFRESH_INFO_REMOTE, the server MUST return an IWbemRemoteRefresher interface pointer in _WBEM_REFRESH_INFO_REMOTE that is part of _WBEM_REFRESH_INFO.

If the server sets m_lType to _WBEM_REFRESH_TYPE_NON_HIPERF, the server MUST return the _WBEM_REFRESH_TYPE_NON_HIPERF structure as part of _WBEM_REFRESH_INFO.

In case of failure, the server MUST fill in the _WBEM_REFRESH_INFO parameter with 0x0, set its m_lType member to WBEM_REFRESH_TYPE_INVALID, and return an error in the format that is specified in section 2.2.11.