On 8/30/2013 12:19, Michael Müller wrote:
This patch implements the IDirect3DSwapChain9Ex interface as an
extension of IDirect3DSwapChain9 and thus fixes bug 34252 - "Silverlight
accelerated graphics cause a D3D critical section lockup" since
Silverlight does no longer try to create a Direct3D context in an
endless loop. The functions d3d9_swapchain_GetLastPresentCount and
d3d9_swapchain_GetPresentStatistics are just stubs so far.


---
  dlls/d3d9/swapchain.c |   71
++++++++++++++++++++++++++++++++++++++++++++++++-
  include/d3d9.h        |   14 +++++++++-
  include/d3d9types.h   |    8 ++++++
  3 files changed, 91 insertions(+), 2 deletions(-)

@@ -34,7 +34,7 @@ static HRESULT WINAPI 
d3d9_swapchain_QueryInterface(IDirect3DSwapChain9 *iface,
  {
      TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
- if (IsEqualGUID(riid, &IID_IDirect3DSwapChain9)
+    if (IsEqualGUID(riid, &IID_IDirect3DSwapChain9) || IsEqualGUID(riid, 
&IID_IDirect3DSwapChain9Ex)
              || IsEqualGUID(riid, &IID_IUnknown))
      {
          IDirect3DSwapChain9_AddRef(iface);
@@ -221,12 +221,76 @@ static HRESULT WINAPI 
d3d9_swapchain_GetPresentParameters(IDirect3DSwapChain9 *i
      return D3D_OK;
  }

I don't know if d3d9 is special in this regard, but this is a wrong way to implement derived interface.
You need you make everything IDirect3DSwapChain9Ex, for example this one:

  /*****************************************************************************
- * IDirect3DSwapChain9 interface
+ * IDirect3DSwapChain9(Ex) interface
   */
  #define INTERFACE IDirect3DSwapChain9
  DECLARE_INTERFACE_(IDirect3DSwapChain9,IUnknown)
@@ -405,6 +405,10 @@ DECLARE_INTERFACE_(IDirect3DSwapChain9,IUnknown)
      STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE;
      STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
      STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* 
pPresentationParameters) PURE;
+    /*** IDirect3DSwapChain9Ex methods ***/
+    STDMETHOD(GetLastPresentCount)(THIS_ UINT* pLastPresentCount) PURE;
+    STDMETHOD(GetPresentStats)(THIS_ D3DPRESENTSTATS* pPresentationStatistics) 
PURE;
+    STDMETHOD(GetDisplayModeEx)(THIS_ D3DDISPLAYMODEEX* 
pMode,D3DDISPLAYROTATION* pRotation) PURE;
  };
  #undef INTERFACE
is no longer just IDirect3DSwapChain9. This will fix vtbl type too.


Reply via email to