Author: akhaldi
Date: Sun Mar 1 22:38:27 2015
New Revision: 66531
URL:
http://svn.reactos.org/svn/reactos?rev=66531&view=rev
Log:
[DXGI] Sync with Wine Staging 1.7.37. CORE-9246
Modified:
trunk/reactos/dll/directx/wine/dxgi/adapter.c
trunk/reactos/dll/directx/wine/dxgi/device.c
trunk/reactos/dll/directx/wine/dxgi/dxgi_private.h
trunk/reactos/dll/directx/wine/dxgi/factory.c
trunk/reactos/dll/directx/wine/dxgi/output.c
trunk/reactos/dll/directx/wine/dxgi/surface.c
trunk/reactos/dll/directx/wine/dxgi/swapchain.c
trunk/reactos/dll/directx/wine/dxgi/utils.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/directx/wine/dxgi/adapter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/adap…
==============================================================================
--- trunk/reactos/dll/directx/wine/dxgi/adapter.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dxgi/adapter.c [iso-8859-1] Sun Mar 1 22:38:27 2015
@@ -66,6 +66,7 @@
if (!refcount)
{
IDXGIOutput_Release(adapter->output);
+ wined3d_private_store_cleanup(&adapter->private_store);
HeapFree(GetProcessHeap(), 0, adapter);
}
@@ -75,25 +76,31 @@
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter1 *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);
-
- return E_NOTIMPL;
+ struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
+
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_set_private_data(&adapter->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter1
*iface,
REFGUID guid, const IUnknown *object)
{
- FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid),
object);
-
- return E_NOTIMPL;
+ struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
+
+ TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid),
object);
+
+ return dxgi_set_private_data_interface(&adapter->private_store, guid,
object);
}
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IDXGIAdapter1 *iface,
REFGUID guid, UINT *data_size, void *data)
{
- FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface,
debugstr_guid(guid), data_size, data);
-
- return E_NOTIMPL;
+ struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface);
+
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_get_private_data(&adapter->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, REFIID iid,
void **parent)
@@ -225,11 +232,12 @@
adapter->IDXGIAdapter1_iface.lpVtbl = &dxgi_adapter_vtbl;
adapter->parent = parent;
adapter->refcount = 1;
+ wined3d_private_store_init(&adapter->private_store);
adapter->ordinal = ordinal;
- output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output));
- if (!output)
- {
+ if (!(output = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*output))))
+ {
+ wined3d_private_store_cleanup(&adapter->private_store);
return E_OUTOFMEMORY;
}
dxgi_output_init(output, adapter);
Modified: trunk/reactos/dll/directx/wine/dxgi/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/devi…
==============================================================================
--- trunk/reactos/dll/directx/wine/dxgi/device.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dxgi/device.c [iso-8859-1] Sun Mar 1 22:38:27 2015
@@ -79,6 +79,7 @@
wined3d_device_decref(This->wined3d_device);
LeaveCriticalSection(&dxgi_cs);
IDXGIFactory1_Release(This->factory);
+ wined3d_private_store_cleanup(&This->private_store);
HeapFree(GetProcessHeap(), 0, This);
}
@@ -90,25 +91,31 @@
static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateData(IWineDXGIDevice *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);
-
- return E_NOTIMPL;
+ struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
+
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_set_private_data(&device->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateDataInterface(IWineDXGIDevice
*iface,
REFGUID guid, const IUnknown *object)
{
- FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid),
object);
-
- return E_NOTIMPL;
+ struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
+
+ TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid),
object);
+
+ return dxgi_set_private_data_interface(&device->private_store, guid, object);
}
static HRESULT STDMETHODCALLTYPE dxgi_device_GetPrivateData(IWineDXGIDevice *iface,
REFGUID guid, UINT *data_size, void *data)
{
- FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface,
debugstr_guid(guid), data_size, data);
-
- return E_NOTIMPL;
+ struct dxgi_device *device = impl_from_IWineDXGIDevice(iface);
+
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_get_private_data(&device->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IWineDXGIDevice *iface, REFIID
riid, void **parent)
@@ -321,7 +328,7 @@
dxgi_device_QueryResourceResidency,
dxgi_device_SetGPUThreadPriority,
dxgi_device_GetGPUThreadPriority,
- /* IWineDXGIAdapter methods */
+ /* IWineDXGIDevice methods */
dxgi_device_create_surface,
dxgi_device_create_swapchain,
};
@@ -352,6 +359,7 @@
device->IWineDXGIDevice_iface.lpVtbl = &dxgi_device_vtbl;
device->refcount = 1;
+ wined3d_private_store_init(&device->private_store);
layer_base = device + 1;
@@ -359,6 +367,7 @@
device, &IID_IUnknown, (void **)&device->child_layer)))
{
WARN("Failed to create device, returning %#x.\n", hr);
+ wined3d_private_store_cleanup(&device->private_store);
return hr;
}
@@ -367,6 +376,7 @@
{
ERR("DXGI device should implement IWineD3DDeviceParent.\n");
IUnknown_Release(device->child_layer);
+ wined3d_private_store_cleanup(&device->private_store);
return hr;
}
wined3d_device_parent =
IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent);
@@ -381,6 +391,7 @@
if (SUCCEEDED(hr))
hr = E_FAIL;
IUnknown_Release(device->child_layer);
+ wined3d_private_store_cleanup(&device->private_store);
return hr;
}
@@ -392,6 +403,7 @@
{
WARN("Failed to create a wined3d device, returning %#x.\n", hr);
IUnknown_Release(device->child_layer);
+ wined3d_private_store_cleanup(&device->private_store);
return hr;
}
@@ -404,6 +416,7 @@
ERR("Failed to initialize 3D, hr %#x.\n", hr);
wined3d_device_decref(device->wined3d_device);
IUnknown_Release(device->child_layer);
+ wined3d_private_store_cleanup(&device->private_store);
return hr;
}
Modified: trunk/reactos/dll/directx/wine/dxgi/dxgi_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/dxgi…
==============================================================================
--- trunk/reactos/dll/directx/wine/dxgi/dxgi_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dxgi/dxgi_private.h [iso-8859-1] Sun Mar 1 22:38:27
2015
@@ -82,12 +82,19 @@
DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format)
DECLSPEC_HIDDEN;
enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format)
DECLSPEC_HIDDEN;
+HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
+ REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN;
+HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
+ REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN;
+HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
+ REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
/* IDXGIFactory */
struct dxgi_factory
{
IDXGIFactory1 IDXGIFactory1_iface;
LONG refcount;
+ struct wined3d_private_store private_store;
struct wined3d *wined3d;
UINT adapter_count;
IDXGIAdapter1 **adapters;
@@ -105,6 +112,7 @@
IWineDXGIDevice IWineDXGIDevice_iface;
IUnknown *child_layer;
LONG refcount;
+ struct wined3d_private_store private_store;
struct wined3d_device *wined3d_device;
IDXGIFactory1 *factory;
};
@@ -117,6 +125,7 @@
{
IDXGIOutput IDXGIOutput_iface;
LONG refcount;
+ struct wined3d_private_store private_store;
struct dxgi_adapter *adapter;
};
@@ -128,6 +137,7 @@
IDXGIAdapter1 IDXGIAdapter1_iface;
struct dxgi_factory *parent;
LONG refcount;
+ struct wined3d_private_store private_store;
UINT ordinal;
IDXGIOutput *output;
};
@@ -140,6 +150,7 @@
{
IDXGISwapChain IDXGISwapChain_iface;
LONG refcount;
+ struct wined3d_private_store private_store;
struct wined3d_swapchain *wined3d_swapchain;
};
@@ -153,6 +164,7 @@
IUnknown IUnknown_iface;
IUnknown *outer_unknown;
LONG refcount;
+ struct wined3d_private_store private_store;
IDXGIDevice *device;
DXGI_SURFACE_DESC desc;
Modified: trunk/reactos/dll/directx/wine/dxgi/factory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/fact…
==============================================================================
--- trunk/reactos/dll/directx/wine/dxgi/factory.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dxgi/factory.c [iso-8859-1] Sun Mar 1 22:38:27 2015
@@ -80,6 +80,7 @@
EnterCriticalSection(&dxgi_cs);
wined3d_decref(factory->wined3d);
LeaveCriticalSection(&dxgi_cs);
+ wined3d_private_store_cleanup(&factory->private_store);
HeapFree(GetProcessHeap(), 0, factory);
}
@@ -89,25 +90,31 @@
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory1 *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);
-
- return E_NOTIMPL;
+ struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
+
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_set_private_data(&factory->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory1
*iface,
REFGUID guid, const IUnknown *object)
{
- FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid),
object);
-
- return E_NOTIMPL;
+ struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
+
+ TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid),
object);
+
+ return dxgi_set_private_data_interface(&factory->private_store, guid,
object);
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory1 *iface,
REFGUID guid, UINT *data_size, void *data)
{
- FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface,
debugstr_guid(guid), data_size, data);
-
- return E_NOTIMPL;
+ struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface);
+
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_get_private_data(&factory->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory1 *iface, REFIID iid,
void **parent)
@@ -281,12 +288,14 @@
factory->IDXGIFactory1_iface.lpVtbl = &dxgi_factory_vtbl;
factory->refcount = 1;
+ wined3d_private_store_init(&factory->private_store);
EnterCriticalSection(&dxgi_cs);
factory->wined3d = wined3d_create(0);
if (!factory->wined3d)
{
LeaveCriticalSection(&dxgi_cs);
+ wined3d_private_store_cleanup(&factory->private_store);
return DXGI_ERROR_UNSUPPORTED;
}
@@ -343,6 +352,7 @@
EnterCriticalSection(&dxgi_cs);
wined3d_decref(factory->wined3d);
LeaveCriticalSection(&dxgi_cs);
+ wined3d_private_store_cleanup(&factory->private_store);
return hr;
}
@@ -378,6 +388,7 @@
if (!(factory->device_window = CreateWindowA("static", "DXGI
device window",
WS_DISABLED, 0, 0, 0, 0, NULL, NULL, NULL, NULL)))
{
+ LeaveCriticalSection(&dxgi_cs);
ERR("Failed to create a window.\n");
return NULL;
}
Modified: trunk/reactos/dll/directx/wine/dxgi/output.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/outp…
==============================================================================
--- trunk/reactos/dll/directx/wine/dxgi/output.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dxgi/output.c [iso-8859-1] Sun Mar 1 22:38:27 2015
@@ -63,6 +63,7 @@
if (!refcount)
{
+ wined3d_private_store_cleanup(&This->private_store);
HeapFree(GetProcessHeap(), 0, This);
}
@@ -74,25 +75,31 @@
static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateData(IDXGIOutput *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);
-
- return E_NOTIMPL;
+ struct dxgi_output *output = impl_from_IDXGIOutput(iface);
+
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_set_private_data(&output->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_output_SetPrivateDataInterface(IDXGIOutput *iface,
REFGUID guid, const IUnknown *object)
{
- FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid),
object);
-
- return E_NOTIMPL;
+ struct dxgi_output *output = impl_from_IDXGIOutput(iface);
+
+ TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid),
object);
+
+ return dxgi_set_private_data_interface(&output->private_store, guid, object);
}
static HRESULT STDMETHODCALLTYPE dxgi_output_GetPrivateData(IDXGIOutput *iface,
REFGUID guid, UINT *data_size, void *data)
{
- FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface,
debugstr_guid(guid), data_size, data);
-
- return E_NOTIMPL;
+ struct dxgi_output *output = impl_from_IDXGIOutput(iface);
+
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_get_private_data(&output->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_output_GetParent(IDXGIOutput *iface,
@@ -109,9 +116,34 @@
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput *iface, DXGI_OUTPUT_DESC
*desc)
{
- FIXME("iface %p, desc %p stub!\n", iface, desc);
-
- return E_NOTIMPL;
+ struct dxgi_output *This = impl_from_IDXGIOutput(iface);
+ struct wined3d *wined3d;
+ MONITORINFOEXW monitor_info;
+
+ FIXME("iface %p, desc %p semi-stub!\n", iface, desc);
+
+ if (!desc)
+ return DXGI_ERROR_INVALID_CALL;
+
+ wined3d = This->adapter->parent->wined3d;
+
+ EnterCriticalSection(&dxgi_cs);
+ desc->Monitor = wined3d_get_adapter_monitor(wined3d,
This->adapter->ordinal);
+ LeaveCriticalSection(&dxgi_cs);
+
+ if (!desc->Monitor)
+ return DXGI_ERROR_INVALID_CALL;
+
+ monitor_info.cbSize = sizeof(monitor_info);
+ if (!GetMonitorInfoW(desc->Monitor, (MONITORINFO *)&monitor_info))
+ return DXGI_ERROR_INVALID_CALL;
+
+ memcpy(&desc->DeviceName, &monitor_info.szDevice,
sizeof(desc->DeviceName));
+ memcpy(&desc->DesktopCoordinates, &monitor_info.rcMonitor, sizeof(RECT));
+ desc->AttachedToDesktop = TRUE;
+ desc->Rotation = DXGI_MODE_ROTATION_IDENTITY;
+
+ return S_OK;
}
static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *iface,
@@ -284,5 +316,6 @@
{
output->IDXGIOutput_iface.lpVtbl = &dxgi_output_vtbl;
output->refcount = 1;
+ wined3d_private_store_init(&output->private_store);
output->adapter = adapter;
}
Modified: trunk/reactos/dll/directx/wine/dxgi/surface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/surf…
==============================================================================
--- trunk/reactos/dll/directx/wine/dxgi/surface.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dxgi/surface.c [iso-8859-1] Sun Mar 1 22:38:27 2015
@@ -66,7 +66,10 @@
TRACE("%p decreasing refcount to %u.\n", surface, refcount);
if (!refcount)
+ {
+ wined3d_private_store_cleanup(&surface->private_store);
HeapFree(GetProcessHeap(), 0, surface);
+ }
return refcount;
}
@@ -105,25 +108,31 @@
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);
-
- return E_NOTIMPL;
+ struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
+
+ 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,
REFGUID guid, const IUnknown *object)
{
- FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid),
object);
-
- return E_NOTIMPL;
+ struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
+
+ TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid),
object);
+
+ return dxgi_set_private_data_interface(&surface->private_store, guid,
object);
}
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface *iface,
REFGUID guid, UINT *data_size, void *data)
{
- FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface,
debugstr_guid(guid), data_size, data);
-
- return E_NOTIMPL;
+ struct dxgi_surface *surface = impl_from_IDXGISurface(iface);
+
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_get_private_data(&surface->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface *iface, REFIID riid,
void **parent)
@@ -205,6 +214,7 @@
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;
Modified: trunk/reactos/dll/directx/wine/dxgi/swapchain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/swap…
==============================================================================
--- trunk/reactos/dll/directx/wine/dxgi/swapchain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dxgi/swapchain.c [iso-8859-1] Sun Mar 1 22:38:27 2015
@@ -77,25 +77,31 @@
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateData(IDXGISwapChain *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);
-
- return E_NOTIMPL;
+ struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
+
+ TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_set_private_data(&swapchain->private_store, guid, data_size,
data);
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetPrivateDataInterface(IDXGISwapChain
*iface,
REFGUID guid, const IUnknown *object)
{
- FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid),
object);
-
- return E_NOTIMPL;
+ struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
+
+ TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid),
object);
+
+ return dxgi_set_private_data_interface(&swapchain->private_store, guid,
object);
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetPrivateData(IDXGISwapChain *iface,
REFGUID guid, UINT *data_size, void *data)
{
- FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface,
debugstr_guid(guid), data_size, data);
-
- return E_NOTIMPL;
+ struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface);
+
+ TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface,
debugstr_guid(guid), data_size, data);
+
+ return dxgi_get_private_data(&swapchain->private_store, guid, data_size,
data);
}
static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetParent(IDXGISwapChain *iface, REFIID
riid, void **parent)
@@ -271,6 +277,9 @@
static void STDMETHODCALLTYPE dxgi_swapchain_wined3d_object_released(void *parent)
{
+ struct dxgi_swapchain *swapchain = parent;
+
+ wined3d_private_store_cleanup(&swapchain->private_store);
HeapFree(GetProcessHeap(), 0, parent);
}
@@ -286,11 +295,13 @@
swapchain->IDXGISwapChain_iface.lpVtbl = &dxgi_swapchain_vtbl;
swapchain->refcount = 1;
+ wined3d_private_store_init(&swapchain->private_store);
if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain,
&dxgi_swapchain_wined3d_parent_ops,
&swapchain->wined3d_swapchain)))
{
WARN("Failed to create wined3d swapchain, hr %#x.\n", hr);
+ wined3d_private_store_cleanup(&swapchain->private_store);
return hr;
}
Modified: trunk/reactos/dll/directx/wine/dxgi/utils.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/dxgi/util…
==============================================================================
--- trunk/reactos/dll/directx/wine/dxgi/utils.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/dxgi/utils.c [iso-8859-1] Sun Mar 1 22:38:27 2015
@@ -319,3 +319,89 @@
return WINED3DFMT_UNKNOWN;
}
}
+
+HRESULT dxgi_get_private_data(struct wined3d_private_store *store,
+ REFGUID guid, UINT *data_size, void *data)
+{
+ const struct wined3d_private_data *stored_data;
+ DWORD size_in;
+ HRESULT hr;
+
+ if (!data_size)
+ return E_INVALIDARG;
+
+ EnterCriticalSection(&dxgi_cs);
+ if (!(stored_data = wined3d_private_store_get_private_data(store, guid)))
+ {
+ hr = DXGI_ERROR_NOT_FOUND;
+ *data_size = 0;
+ goto done;
+ }
+
+ size_in = *data_size;
+ *data_size = stored_data->size;
+ if (!data)
+ {
+ hr = S_OK;
+ goto done;
+ }
+ if (size_in < stored_data->size)
+ {
+ hr = DXGI_ERROR_MORE_DATA;
+ goto done;
+ }
+
+ if (stored_data->flags & WINED3DSPD_IUNKNOWN)
+ IUnknown_AddRef(stored_data->content.object);
+ memcpy(data, stored_data->content.data, stored_data->size);
+ hr = S_OK;
+
+done:
+ LeaveCriticalSection(&dxgi_cs);
+
+ return hr;
+}
+
+HRESULT dxgi_set_private_data(struct wined3d_private_store *store,
+ REFGUID guid, UINT data_size, const void *data)
+{
+ struct wined3d_private_data *entry;
+ HRESULT hr;
+
+ if (!data)
+ {
+ EnterCriticalSection(&dxgi_cs);
+ if (!(entry = wined3d_private_store_get_private_data(store, guid)))
+ {
+ LeaveCriticalSection(&dxgi_cs);
+ return S_FALSE;
+ }
+
+ wined3d_private_store_free_private_data(store, entry);
+ LeaveCriticalSection(&dxgi_cs);
+
+ return S_OK;
+ }
+
+ EnterCriticalSection(&dxgi_cs);
+ hr = wined3d_private_store_set_private_data(store, guid, data, data_size, 0);
+ LeaveCriticalSection(&dxgi_cs);
+
+ return hr;
+}
+
+HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
+ REFGUID guid, const IUnknown *object)
+{
+ HRESULT hr;
+
+ if (!object)
+ return dxgi_set_private_data(store, guid, sizeof(object), &object);
+
+ EnterCriticalSection(&dxgi_cs);
+ hr = wined3d_private_store_set_private_data(store,
+ guid, object, sizeof(object), WINED3DSPD_IUNKNOWN);
+ LeaveCriticalSection(&dxgi_cs);
+
+ return hr;
+}
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Mar 1 22:38:27 2015
@@ -43,7 +43,7 @@
reactos/dll/directx/wine/dplayx # Synced to WineStaging-1.7.37
reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.27
-reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.27
+reactos/dll/directx/wine/dxgi # Synced to WineStaging-1.7.37
reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.27
reactos/dll/directx/wine/qedit # Synced to Wine-1.7.27
reactos/dll/directx/wine/quartz # Synced to Wine-1.7.27