IRpcStubBuffer::IsIIDSupported

IRpcStubBuffer* IRpcStubBuffer::IsIIDSupported(iid)

Answer whether this stub is designed to handle the unmarshaling of the indicated interface.

If the stub buffer supports the specified IID, then it should return an appropriate IRpcStubBuffer* for that interface. Otherwise, the it should return NULL.

When presented with the need to remote a new IID on a given object, the RPC runtime typically calls this function on all the presently-connected interface stubs in an attempt to locate one that can handle the marshaling for the request before it goes to the trouble of creating a new stub.

As in IPSFactoryBuffer::CreateStub(), if this stub is presently connected to a server object, then not only must this function verify that the stub can handle the requested interface ID, but it must also verify (using QueryInterface()) that the connected server object in fact supports the indicated interface (depending on the IID and previous interface servicing requests, it may have already done so).

A common special case is the following: interface stubs which are designed to only support one interface ID (as most are designed to do) can simply check if iid designates the one interface that they handle. If not, return false. Otherwise, then if connected, check that the server object supports the interface. Otherwise return true.

Argument

Type

Description

iid

REFIID

The interface that the caller wishes to know if the stub can handle. iid is never to be IID_IUnknown.

return value

IRpcStubBuffer*

See above.