   AllocateSurfaceHelper fails
  Hello I want to render a Video to Direct3D-Surface:Here is what I do:class VideoAllocatorPresenter: public IVMRSurfaceAllocator9,  public IVMRImagePresenter9{public:    STDMETHODIMP QueryInterface(REFIID riid, void **ppv) { dbglog() << "QueryInterface " << std::endl;*ppv = this;return S_OK; //GetOwner()->QueryInterface(riid,ppv);  ppv = NULL;return E_NOINTERFACE;    };  STDMETHODIMP_(ULONG) AddRef() {   dbglog() << "AddRef" << std::endl;   return 1 ;//GetOwner()->AddRef();  };  STDMETHODIMP_(ULONG) Release() { dbglog() << "Release" << std::endl;   return 1;//GetOwner()->Release(); };VideoAllocatorPresenter() {};virtual ~VideoAllocatorPresenter() {}; /*virtual HRESULT */STDMETHODIMP AdviseNotify( IVMRSurfaceAllocatorNotify9*  lpIVMRSurfAllocNotify ) {dbglog() << "AdviseNotify" << std::endl;allocNotify_ = lpIVMRSurfAllocNotify;return S_OK;};/*virtual HRESULT */STDMETHODIMP GetSurface( DWORD_PTR  dwUserID, DWORD  SurfaceIndex, DWORD  SurfaceFlags,IDirect3DSurface9**  lplpSurface ){dbglog() << "GetSurface  " << SurfaceIndex << std::endl;*lplpSurface = &surfaces_[SurfaceIndex];dbglog() << "GetSurface  done" << std::endl;return S_OK;};/*virtual HRESULT */STDMETHODIMP InitializeDevice( DWORD_PTR  dwUserID, VMR9AllocationInfo*  lpAllocInfo,DWORD*  lpNumBuffers ){dbglog() << "InitializeDevice" << std::endl;surfaces_ = (IDirect3DSurface9*) malloc(sizeof( IDirect3DSurface9) * (*lpNumBuffers) );  if( FAILED( allocNotify_->AllocateSurfaceHelper( lpAllocInfo, lpNumBuffers, &surfaces_ ) ) ) {dbglog() << "failure" << std::endl;}dbglog() << "  number buffers: " << (*lpNumBuffers) << std::endl;return S_OK;};/*virtual HRESULT */STDMETHODIMP TerminateDevice( DWORD_PTR  dwID ){dbglog() << "TerminateDevice" << std::endl;return S_OK;};/*virtual HRESULT */STDMETHODIMP PresentImage( DWORD_PTR  dwUserID, VMR9PresentationInfo*  lpPresInfo ){dbglog() << "PresentImage" << std::endl;return S_OK;};/*virtual HRESULT */STDMETHODIMP StartPresenting( DWORD_PTR  dwUserID ){  dbglog() << "StartPresenting" << std::endl;return S_OK;};/*virtual HRESULT */STDMETHODIMP StopPresenting( DWORD_PTR  dwUserID ){dbglog() << "StopPresenting" << std::endl;return S_OK;};private:IVMRSurfaceAllocatorNotify9* allocNotify_;IDirect3DSurface9* surfaces_;};IMediaControl *m_pMediaControl;CoInitializeEx( NULL, 0 );static VideoAllocatorPresenter allocPresent;//create graph managerIGraphBuilder *m_pGraph;HRESULT hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**)&m_pGraph);if FAILED( hr )dbglog() << "failure 1" << std::endl;// BUILD the VMR9IBaseFilter*m_pVMRBaseFilter;hr = CoCreateInstance(CLSID_VideoMixingRenderer9, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**) &m_pVMRBaseFilter);if FAILED( hr )dbglog() << "failure 2" << std::endl;// ADD the VMR9 to the graphhr = m_pGraph->AddFilter(m_pVMRBaseFilter, L"VMR9");if FAILED( hr )dbglog() << "failure 3" << std::endl;IVMRFilterConfig9*m_pVMRFilterConfig;hr = m_pVMRBaseFilter->QueryInterface(IID_IVMRFilterConfig9, (void**) &m_pVMRFilterConfig);  if FAILED( hr )dbglog() << "failure 4" << std::endl;//m_pVMRFilterConfig->SetNumberOfStreams(2);hr = m_pVMRFilterConfig->SetRenderingMode(VMR9Mode_Renderless);if FAILED( hr )dbglog() << "failure 5" << std::endl;IVMRSurfaceAllocatorNotify9 *surfaceNotify;hr = m_pVMRBaseFilter->QueryInterface(IID_IVMRSurfaceAllocatorNotify9, (void**) &surfaceNotify);  if FAILED( hr )dbglog() << "failure 6" << std::endl;D3DDEVICE_CREATION_PARAMETERS params;    DXUTGetD3DDevice()->GetCreationParameters(&params); // Get parameters of D3D IDirect3D9* iD3D9;DXUTGetD3DDevice()->GetDirect3D( &iD3D9 );HMONITOR hMonitor = iD3D9->GetAdapterMonitor( params.AdapterOrdinal );//hr = surfaceNotify->SetD3DDevice( DXUTGetD3DDevice(), hMonitor );if FAILED( hr )dbglog() << "failure 7" << std::endl;hr = surfaceNotify->AdviseSurfaceAllocator( 42,static_cast<IVMRSurfaceAllocator9*>(&allocPresent) );if FAILED( hr )dbglog() << "failure 8 " << hr << "    " << S_OK << std::endl;hr = allocPresent.AdviseNotify( surfaceNotify );if FAILED( hr )dbglog() << "failure 9" << std::endl;hr = m_pGraph->RenderFile(L"video/intro.avi",L"");if FAILED( hr )dbglog() << "failure 10" << std::endl;hr = m_pGraph->QueryInterface(IID_IMediaControl, (void**)&m_pMediaControl);if FAILED( hr )dbglog() << "failure 11" << std::endl;IMediaEvent *m_pMediaEvent;hr = m_pGraph->QueryInterface(IID_IMediaEvent, (void**)&m_pMediaEvent);if FAILED( hr )dbglog() << "failure 12" << std::endl;hr =m_pMediaControl->Run();if FAILED( hr )dbglog() << "failure 13" << std::endl;//long evCode;//m_pMediaEvent->WaitForCompletion(INFINITE,  &evCode );And here is the produced logging output11.11.2005-11:50:44AddRefQueryInterface QueryInterface QueryInterface AdviseNotifyInitializeDevicefailure  number buffers: 1GetSurface  0GetSurface  doneSo can anybody tell me why my call to AllocateSurfaceHelper fails?allocNotify_->AllocateSurfaceHelper( lpAllocInfo, lpNumBuffers, &surfaces_ ) )Thanks a lot.   