title: Can't find pin in DirectShow filter by name/ID despite it being the ID returned by QueryPinInfo
body: <p>I'm having a weird problem while developing my DirectShow application.  I am using Delphi 6 with the DSPACK DirectShow component library.  One of the IBaseFilter instances doesn't seem to recognize a pin that it owns when I try to find the pin in the filter using it's TPinInfo.achName property (_PinInfo).  (Note, in this case it is the IBaseFilter created by the TSampleGrabber component that is exhibiting this weird behavior).</p>
  
  <p>The sequence of events, encapsulated in the code sample below is this:</p>
  
  <ol>
  <li>Find the first available input pin in the IBaseFilter instance.  In the code below this is the pin passed to testPinInfo().</li>
  <li>Execute QueryPinInfo() on the returned pin to get that information.  The returned information shows the pin's achName as 'Input'.</li>
  <li>Try to find a pin named 'Input' in the very same IBaseFilter instance using IBaseFilter.findPin().</li>
  <li>Get NIL back indicating a pin could not be found with that name.  This in my opinion is a really strange condition (error).</li>
  </ol>
  
  <p>Does anyone know what kind of conditions could cause this scenario?  I don't think it's a memory corruption problem because the data structures involved look fine when I inspect them in the debugger.  Is it possible that some IBaseFilter implementations neglect to implement the FindPin() method properly?</p>
  
  <p>Here's the code below:</p>
  
  <pre><code>procedure testPinInfo(intfInputPin: IPin);
  var
      intfTestPin: IPin;
      pinInfo_input: TPinInfo;
  begin
      intfTestPin := nil;
  
      // Get the pin information.
      ZeroMemory(@pinInfo_input, SizeOf(pinInfo_input));
      intfInputPin.QueryPinInfo(pinInfo_input);
  
      // Now immediately turn around and try to find the pin in the filter that
      //  owns it, using the name found in pinInfo_input
      pinInfo_input.pFilter.FindPin(pinInfo_input.achName, intfTestPin);
  
     // &gt;&gt;&gt; intfTestPin is NIL (unassigned).  This is an error.
  end;
  </code></pre>