次の方法で共有


3.1.1.5.6.1.1 IRemUnknown::RemQueryInterface (Opnum 3)

This RemQueryInterface (Opnum 3) method acquires standard object references (see section 2.2.18.1) to additional interfaces on the object.

 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
 );

ripid: This MUST specify an IPID that identifies the interface on the object to be queried for more interfaces.

cRefs: This MUST specify the number of public reference counts requested on the new interfaces.

cIids:  This MUST specify the number of IIDs supplied in the iids parameter and returned in the ppQIResults parameter.

iids:  This MUST specify an array of IIDs for which the client requests object references.

ppQIResults: This MUST contain an array of REMQIRESULT structures containing the results of the QueryInterface on the identified object.

When processing this ORPC call, the object exporter MUST do the following:

  • It MUST look up the IPID entry of the interface specified by the ripid parameter. If the IPID entry is not found, it MUST return RPC_E_INVALID_OBJECT as specified in [MS-ERREF] section 2.1.

  • It MUST look up the OID entry for the IPID.

  • It MUST set the last ORPC invocation time in the OID entry to the current time.

  • For each IID requested by the client in the iids array:

    • It MUST find the IPID of the IID in the IPID list in the OID entry.

    • If the entry is found, it MUST increment the public reference counts by cRefs, the number of references requested by the client.

    • 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 hResult field of the corresponding REMQIRESULT array.

      If the object implements the requested IID, the object exporter MUST create an IPID entry as follows:

      • It MUST allocate an IPID and set it in the IPID entry.

      • It MUST set the IID in the entry to the IID specified by the client.

      • It MUST set the OID in the IPID entry to the OID in the OID entry.

      • It MUST set the public reference count to cRefs, the number of references requested by the client.

      • It MUST set the private reference count to 0.

      • It MUST instruct RPC to listen on the interface designated by the IID, as specified in [C706] section 3.1.20 (rpc_server_register_if).

      • It MUST set the object pointer in the entry to the object pointer of the application's state that implements the interface specified by the IID.

      • It MUST add the IPID entry to the IPID list in the OID.

      • It MUST add the IPID entry to the IPID table.

    • The object exporter MUST return the STDOBJREF representing the object reference in the corresponding REMQIRESULT array element as follows:

      • It MUST set the flags field to 0.

      • It MUST set the cPublicRefs field to cRefs.

      • It MUST set the IPID and the OID from the IPID and OID entries.

      • It MUST set the OXID to the OXID of the object exporter.

    • The object exporter MUST set the corresponding HRESULT field to a success code of zero.