Microsoft DirectX 9.0


The FindUpstreamInterface method searches the filter graph for a specified interface, upstream from a specified pin.


HRESULT FindUpstreamInterface(
  IPin *pPin,
  REFIID riid,
  void **ppvInterface,
  DWORD dwFlags



[in] Pointer to the IPin interface of a pin. The pin must belong to a filter in the filter graph.


[in] Reference to an interface identifier (IID) that specifies the interface to find.


[out] Address of a void pointer. If the method succeeds, this variable receives a pointer to the interface specified by riid.


[in] Combination of flags from the AM_INTF_SEARCH_FLAGS enumeration, specifying what to search (pins or filters).

Return Values

Returns one of the following HRESULT values.

Return code Description
E_NOINTERFACE Interface not found.
E_POINTER Invalid pointer.
S_OK Success.


If dwFlags is zero, this method searches for the interface in the following order:

  1. It queries the pin specified by pPin.
  2. If pPin is an input pin, it calls FindUpstreamInterface recursively on the output pin that is connected to pPin, if any.

    If pPin is an output pin, it queries the filter that owns pPin. Then it creates a list of input pins on the filter that have internal connections to pPin, and calls FindUpstreamInterface recursively on those input pins.

    To create a list of input pins with internal connections, the method does the following:

It stops at the first object it finds that supports the interface. You can limit the objects that are searched (filters, input pin, or output pins) by setting dwFlags to a non-zero value.

Note   The ICaptureGraphBuilder2::FindInterface method implements a more general approach to this problem, and in most situations is preferred.

See Also