Henri Verbeet : dxgi: Implement dxgi_surface_SetPrivateData().

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 17 10:14:40 CST 2015


Module: wine
Branch: master
Commit: 64b23f6ca7f3674cb55b4d468065f1b377206bbe
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=64b23f6ca7f3674cb55b4d468065f1b377206bbe

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Feb 17 10:15:37 2015 +0100

dxgi: Implement dxgi_surface_SetPrivateData().

---

 dlls/dxgi/dxgi_private.h |  1 +
 dlls/dxgi/surface.c      | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h
index 727a75f..206fce6 100644
--- a/dlls/dxgi/dxgi_private.h
+++ b/dlls/dxgi/dxgi_private.h
@@ -157,6 +157,7 @@ struct dxgi_surface
     IUnknown IUnknown_iface;
     IUnknown *outer_unknown;
     LONG refcount;
+    struct wined3d_private_store private_store;
     IDXGIDevice *device;
 
     DXGI_SURFACE_DESC desc;
diff --git a/dlls/dxgi/surface.c b/dlls/dxgi/surface.c
index 10daff7..1a6ee7e 100644
--- a/dlls/dxgi/surface.c
+++ b/dlls/dxgi/surface.c
@@ -71,7 +71,10 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_inner_Release(IUnknown *iface)
     TRACE("%p decreasing refcount to %u.\n", surface, refcount);
 
     if (!refcount)
+    {
+        wined3d_private_store_cleanup(&surface->private_store);
         HeapFree(GetProcessHeap(), 0, surface);
+    }
 
     return refcount;
 }
@@ -110,9 +113,11 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_Release(IDXGISurface *iface)
 static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateData(IDXGISurface *iface,
         REFGUID guid, UINT data_size, const void *data)
 {
-    FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
+    struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
 
-    return E_NOTIMPL;
+    TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
+
+    return dxgi_set_private_data(&surface->private_store, guid, data_size, data);
 }
 
 static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateDataInterface(IDXGISurface *iface,
@@ -210,6 +215,7 @@ HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device,
     surface->IDXGISurface_iface.lpVtbl = &dxgi_surface_vtbl;
     surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl;
     surface->refcount = 1;
+    wined3d_private_store_init(&surface->private_store);
     surface->outer_unknown = outer ? outer : &surface->IUnknown_iface;
     surface->device = device;
     surface->desc = *desc;




More information about the wine-cvs mailing list