title: Double pointer function argument and CComPtr
body: <p>I'm not sure of this way of using CComPtr inside of a function which has an argument expressed as a double pointer:</p>
  
  <pre><code>HRESULT D3DPresentEngine::CreateD3DSample(
      IDirect3DSwapChain9 *pSwapChain, 
      IMFSample **ppVideoSample
      )
  {
      // Caller holds the object lock.
  
      D3DCOLOR clrBlack = D3DCOLOR_ARGB(0xFF, 0x00, 0x00, 0x00);
  
      CComPtr&lt; IDirect3DSurface9 &gt; pSurface;
      CComPtr&lt; IMFSample &gt; pSample;
  
      // Get the back buffer surface.
      ReturnIfFail( pSwapChain-&gt;GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &amp;pSurface ) );
  
      // Fill it with black.
      ReturnIfFail( m_pDevice-&gt;ColorFill(pSurface, NULL, clrBlack));
  
      // Create the sample.
      ReturnIfFail( MFCreateVideoSampleFromSurface(pSurface, &amp;pSample));
  
      // Return the pointer to the caller.
      *ppVideoSample = pSample;
      (*ppVideoSample)-&gt;AddRef();
  
      return S_OK;
  }
  </code></pre>
  
  <p>I have a doubt about the last assignation + AddRef call. </p>
  
  <p>Are they OK for you?</p>
  
  <p>Thanks in advance</p>