<div class="content" name="RemQueryInterface" uuid="11fd5e3a-f5ef-41cc-b943-45217efdb054"><p>This RemQueryInterface (Opnum 3) method acquires standard
object references (see section <a href="ad717638-f105-4256-b552-385b08ef8ebf" data-linktype="relative-path">2.2.18.1</a>) to additional
interfaces on the object.</p><dl>
<dd>
<div><pre> HRESULT RemQueryInterface(
   [in] REFIPID ripid,
   [in] unsigned long cRefs,
   [in] unsigned short cIids,
   [in, size_is(cIids)] IID* iids,
   [out, size_is(,cIids)] PREMQIRESULT* ppQIResults
 );
</pre></div>
</dd></dl><p><b>ripid: </b>This MUST specify an <a href="ba4c4d80-ef81-49b4-848f-9714d72b5c01#gt_74540339-daab-46ea-a8f9-fe8fca3b150c" data-linktype="relative-path">IPID</a> that identifies the
interface on the object to be queried for more interfaces.</p><p><b>cRefs: </b>This MUST specify the number of public <a href="ba4c4d80-ef81-49b4-848f-9714d72b5c01#gt_10ffa972-2b70-4e41-b025-6785babac521" data-linktype="relative-path">reference counts</a> requested
on the new interfaces.</p><p><b>cIids: </b> This MUST specify the number of <a href="ba4c4d80-ef81-49b4-848f-9714d72b5c01#gt_76ad3105-3f05-479d-a40c-c9c8fa2ebd83" data-linktype="relative-path">IIDs</a> supplied in the <i>iids</i>
parameter and returned in the <i>ppQIResults</i> parameter.</p><p><b>iids: </b> This MUST specify an array of IIDs for
which the client requests object references.</p><p><b>ppQIResults: </b>This MUST contain an array of <a href="1d6a8a54-b115-4148-815a-af0258931948" data-linktype="relative-path">REMQIRESULT</a> structures
containing the results of the QueryInterface on the identified object.</p><p>When processing this <a href="ba4c4d80-ef81-49b4-848f-9714d72b5c01#gt_d4ad46fe-cbab-43f2-a125-b2f125824f33" data-linktype="relative-path">ORPC</a> call, the <a href="ba4c4d80-ef81-49b4-848f-9714d72b5c01#gt_5b284f60-ee33-4d15-9a7b-0fb82d7c6b68" data-linktype="relative-path">object exporter</a> MUST do the
following:</p><ul><li><p><span><span> 
</span></span>It MUST look up the IPID entry of the interface specified by the <i>ripid</i>
parameter. If the IPID entry is not found, it MUST return RPC_E_INVALID_OBJECT
as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/0642cb2f-2075-4469-918c-4441e69c548a" data-linktype="relative-path">2.1</a>.</p>
</li><li><p><span><span> 
</span></span>It MUST look up the OID entry for the IPID.</p>
</li><li><p><span><span> 
</span></span>It MUST set the last ORPC invocation time in the OID entry to the
current time.</p>
</li><li><p><span><span> 
</span></span>For each IID requested by the client in the iids array:</p>
<ul><li><p><span><span>  </span></span>It
MUST find the IPID of the IID in the IPID list in the OID entry.</p>
</li><li><p><span><span>  </span></span>If
the entry is found, it MUST increment the public reference counts by cRefs, the
number of references requested by the client.</p>
</li><li><p><span><span>  </span></span>If
the entry is not found, it MUST use the application-defined state to determine,
in an implementation-specific manner, if the object supports the requested IID.
If it does not, it MUST set E_NOINTERFACE (as specified in [MS-ERREF] section
2.1) in the <b>hResult</b> field of the corresponding REMQIRESULT array.</p>
<p>If the object implements
the requested IID, the object exporter MUST create an IPID entry as follows:</p>
<ul><li><p><span><span> 
</span></span>It MUST allocate an IPID and set it in the IPID entry.</p>
</li><li><p><span><span> 
</span></span>It MUST set the IID in the entry to the IID specified by the client.</p>
</li><li><p><span><span> 
</span></span>It MUST set the OID in the IPID entry to the OID in the OID
entry.</p>
</li><li><p><span><span> 
</span></span>It MUST set the public reference count to cRefs, the number of
references requested by the client.</p>
</li><li><p><span><span> 
</span></span>It MUST set the private reference count to 0.</p>
</li><li><p><span><span> 
</span></span>It MUST instruct RPC to listen on the interface designated by the
IID, as specified in <a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a>
section 3.1.20 (rpc_server_register_if).</p>
</li><li><p><span><span> 
</span></span>It MUST set the object pointer in the entry to the object pointer
of the application&#39;s state that implements the interface specified by the IID.</p>
</li><li><p><span><span> 
</span></span>It MUST add the IPID entry to the IPID list in the OID.</p>
</li><li><p><span><span> 
</span></span>It MUST add the IPID entry to the IPID table.</p>
</li></ul></li><li><p><span><span>  </span></span>The
object exporter MUST return the STDOBJREF representing the object reference in
the corresponding REMQIRESULT array element as follows:</p>
<ul><li><p><span><span> 
</span></span>It MUST set the <b>flags</b> field to 0.</p>
</li><li><p><span><span> 
</span></span>It MUST set the <b>cPublicRefs</b> field to cRefs.</p>
</li><li><p><span><span> 
</span></span>It MUST set the IPID and the OID from the IPID and OID entries.</p>
</li><li><p><span><span> 
</span></span>It MUST set the OXID to the OXID of the object exporter.</p>
</li></ul></li><li><p><span><span>  </span></span>The
object exporter MUST set the corresponding HRESULT field to a success code of
zero.</p>
</li></ul></li></ul></div>