3.1.1.5.6.1.3 IRemUnknown::RemRelease (Opnum 5)

The RemRelease (Opnum 5) method requests that a specified number of reference counts be decremented on a specified number of interfaces on an object.

 HRESULT RemRelease(
   [in] unsigned short cInterfaceRefs,
   [in, size_is(cInterfaceRefs)] REMINTERFACEREF InterfaceRefs[]
 );

cInterfaceRefs:  This MUST specify the number of elements in the InterfaceRefs parameter.

InterfaceRefs:  This MUST specify an array of REMINTERFACEREF structures, each of which specifies the number of public and private references to be released on the interface identified by the IPID.

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

For each REMINTERFACEREF element in the InterfaceRefs array argument:

  • The object exporter MUST look up REMINTERFACEREF.ipid in the IPID table to find the IPID entry. If the entry is found, the object exporter MUST do the following:

    • It MUST decrement the public reference count in the IPID entry by REMINTERFACEREF.cPublicRefs. If REMINTERFACEREF.cPublicRefs is greater than the public reference count in the IPID entry, the object exporter MUST set the public reference count in the IPID entry to 0.

    • It MUST decrement the private reference count associated with the client in the IPID entry by REMINTERFACEREF.cPrivateRefs. If REMINTERFACEREF.cPrivateRefs is greater than the private reference count in the IPID entry, the object exporter MUST set the private reference count in the IPID entry to 0.<49>

  • If the public and private reference counts are zero, the object exporter MUST do the following:

    • It MUST remove the IPID entry from the IPID table.

    • It MUST remove the IPID from the list of IPIDs in the OID table.

    • It MUST remove the application-specific state of the object that implements the interface from the IPID entry.

    • It MUST instruct RPC to stop listening on the interface, as specified in [C706] section 3.1.20 (rpc_server_unregister_if).

    • If the list of IPIDs in the OID entry is empty, it MUST remove the OID entry from the OID table.

    • It MUST remove the application-specific state of the object from the OID entry.

    • It MUST contact the object resolver to release the OID.