diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c index 6fec7842076..d2e3156e3d9 100644 --- a/dlls/d3d11/buffer.c +++ b/dlls/d3d11/buffer.c @@ -71,7 +71,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface) if (refcount == 1) { - ID3D10Device1_AddRef(buffer->device); + ID3D11Device_AddRef(buffer->device); wined3d_mutex_lock(); wined3d_buffer_incref(buffer->wined3d_buffer); wined3d_mutex_unlock(); @@ -89,14 +89,14 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface) if (!refcount) { - ID3D10Device1 *device = buffer->device; + ID3D11Device *device = buffer->device; wined3d_mutex_lock(); wined3d_buffer_decref(buffer->wined3d_buffer); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D10Device1_Release(device); + ID3D11Device_Release(device); } return refcount; @@ -104,7 +104,11 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface) static void STDMETHODCALLTYPE d3d11_buffer_GetDevice(ID3D11Buffer *iface, ID3D11Device **device) { - FIXME("iface %p, device %p stub!\n", iface, device); + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = buffer->device; } static HRESULT STDMETHODCALLTYPE d3d11_buffer_GetPrivateData(ID3D11Buffer *iface, @@ -225,8 +229,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10 TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)buffer->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(buffer->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface, @@ -389,8 +392,8 @@ HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device, } wined3d_mutex_unlock(); - buffer->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(buffer->device); + buffer->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(buffer->device); return S_OK; } diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 12e4df2217e..2f56a5a3436 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -142,7 +142,7 @@ struct d3d_buffer struct wined3d_private_store private_store; struct wined3d_buffer *wined3d_buffer; - ID3D10Device1 *device; + ID3D11Device *device; }; HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device,