<div class="content" name="AddObjectToRefresher" uuid="cf79fb85-e0cb-4778-86de-03da6de4d5d8"><p>The IWbemRefreshingServices::AddObjectToRefresher method
MUST add a <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_a99173af-90bf-473d-9a81-ff0ce9a85838" data-linktype="relative-path">CIM</a> instance,
which is identified by its <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_775e4b82-5447-4125-b887-b404421e1269" data-linktype="relative-path">CIM
path</a>, to the list of <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_94e80069-5f2a-4281-a676-50ea656c4795" data-linktype="relative-path">CIM
instances</a> that can be refreshed.</p><dl>
<dd>
<div><pre> HRESULT AddObjectToRefresher(
   [in] _WBEM_REFRESHER_ID* pRefresherId,
   [in, string] LPCWSTR wszPath,
   [in] long lFlags,
   [in] IWbemContext* pContext,
   [in] DWORD dwClientRefrVersion,
   [out] _WBEM_REFRESH_INFO* pInfo,
   [out] DWORD* pdwSvrRefrVersion
 );
</pre></div>
</dd></dl><p><b>pRefresherId: </b>MUST be a pointer to the
_WBEM_REFRESHER_ID structure, as specified in section <a href="4785ade4-e762-4f7e-a87c-e00aa316a457" data-linktype="relative-path">2.2.21</a>, which identifies
the client that is requesting refreshing services. This parameter MUST NOT be
NULL.</p><p><b>wszPath: </b>MUST be a string that MUST contain
the CIM path of the CIM instance. This parameter MUST NOT be NULL.</p><p><b>lFlags: </b>This parameter is not used, and its
value SHOULD be 0x0.</p><p><b>pContext: </b>MUST be a pointer to an <a href="18c8f1a1-652f-43b7-9186-6098bc303a8d" data-linktype="relative-path">IWbemContext</a> interface
object, which MUST contain additional information for the server refresher. If
pContext is NULL, the parameter MUST be ignored.</p><p><b>dwClientRefrVersion: </b>MUST be the version of
the client refresher. This value SHOULD<a id="Appendix_A_Target_64"></a><a aria-label="Product behavior note 64" href="27182640-aa3f-43b6-941f-a77d25f798e8#Appendix_A_64" data-linktype="relative-path">&lt;64&gt;</a> be 0x2.
The server MUST allow all client versions.</p><p><b>pInfo: </b>MUST be an output parameter that MUST
return a <b>_WBEM_REFRESH_INFO</b> structure, as specified in section <a href="f3881702-6fc6-408c-82c9-72e36d928e06" data-linktype="relative-path">2.2.20</a>, which MUST contain
refresher information about the CIM instance in <i>wszPath</i>. It MUST NOT be
NULL.</p><p><b>pdwSvrRefrVersion: </b>MUST be an output parameter
that MUST be the version of the server refresher. The value of this parameter
SHOULD be 0x1.</p><p><b>Return Values: </b>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 <a href="a2899649-a5a3-4b13-9ffa-d8394dcdac63" data-linktype="relative-path">2.2.11</a>) to indicate the
successful completion of the method.</p><dl>
<dd>
<p><b>WBEM_S_NO_ERROR</b> (0x00)</p>
</dd></dl><p>The <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_f3ef2572-95cf-4c5c-b3c9-551fd648f409" data-linktype="relative-path">security
principal</a> that makes the call MUST have WBEM_REMOTE_ENABLE and WBEM_ENABLE
accesses to the namespace; otherwise, WBEM_E_ACCESS_DENIED MUST be returned.</p><p>In response to
IWbemRefreshingServices::AddObjectToRefresher, the server MUST evaluate the CIM
path to the CIM instance and MUST return information to the client to handle
the specific CIM instance as specified in this section.</p><p>A successful call to
IWbemRefreshingServices::AddObjectToRefresher MUST return WBEM_S_NO_ERROR and
MUST fill the output _WBEM_REFRESH_INFO structure as specified in section
2.2.20.</p><p>The server MUST locate the <b>InstanceProviderId</b> for the
instance in <i>wszPath</i> using the algorithm in section <a href="632666ed-b696-49db-bd11-e76b912da16f" data-linktype="relative-path">3.1.4</a>. If <b>InstanceProviderId</b>
is not empty and the provider&#39;s <b>SupportsRefresher</b> field is TRUE, the
server MUST return the <b>_WBEM_REFRESH_INFO</b> structure that has an <b>m_lType</b>
that is set to <b>_WBEM_REFRESH_INFO_REMOTE</b>, otherwise returning one with <b>m_lType</b>
set to <b>_WBEM_REFRESH_TYPE_NON_HIPERF</b>. </p><p>If the server sets <b>m_lType</b> to <b>_WBEM_REFRESH_INFO_REMOTE</b>,
the server MUST return an <a href="7e35e02b-092d-407f-a4bf-131f648b7691" data-linktype="relative-path">IWbemRemoteRefresher</a>
interface pointer in <b>_WBEM_REFRESH_INFO_REMOTE</b> that is part of <b>_WBEM_REFRESH_INFO</b>.</p><p>If the server sets <b>m_lType</b> to <b>_WBEM_REFRESH_TYPE_NON_HIPERF</b>,
the server MUST return a <b>_WBEM_REFRESH_INFO_NON_HIPERF</b> structure as part
of <b>_WBEM_REFRESH_INFO</b>.</p><p>In case of failure, the server MUST fill in the
_WBEM_REFRESH_INFO structure with 0x0, set its <b>m_lType</b> member to
WBEM_REFRESH_TYPE_INVALID, and return an HRESULT error in the format that is
specified in section 2.2.11.</p></div>