Commit 6c4c3517 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Don't require wined3d object parents to be COM objects.

parent b84d1ce5
......@@ -227,8 +227,8 @@ HRESULT d3d10_input_layout_init(struct d3d10_input_layout *layout, struct d3d10_
return hr;
}
hr = IWineD3DDevice_CreateVertexDeclaration(device->wined3d_device, &layout->wined3d_decl,
(IUnknown *)layout, &d3d10_input_layout_wined3d_parent_ops, wined3d_elements, wined3d_element_count);
hr = IWineD3DDevice_CreateVertexDeclaration(device->wined3d_device, wined3d_elements, wined3d_element_count,
layout, &d3d10_input_layout_wined3d_parent_ops, &layout->wined3d_decl);
HeapFree(GetProcessHeap(), 0, wined3d_elements);
if (FAILED(hr))
{
......
......@@ -259,9 +259,8 @@ HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d1
return hr;
}
hr = IWineD3DDevice_CreateVertexShader(device->wined3d_device,
shader_info.shader_code, &shader->output_signature, &shader->wined3d_shader,
(IUnknown *)shader, &d3d10_vertex_shader_wined3d_parent_ops);
hr = IWineD3DDevice_CreateVertexShader(device->wined3d_device, shader_info.shader_code,
&shader->output_signature, shader, &d3d10_vertex_shader_wined3d_parent_ops, &shader->wined3d_shader);
if (FAILED(hr))
{
WARN("Failed to create wined3d vertex shader, hr %#x.\n", hr);
......@@ -394,9 +393,8 @@ HRESULT d3d10_geometry_shader_init(struct d3d10_geometry_shader *shader, struct
return hr;
}
hr = IWineD3DDevice_CreateGeometryShader(device->wined3d_device,
shader_info.shader_code, &shader->output_signature, &shader->wined3d_shader,
(IUnknown *)shader, &d3d10_geometry_shader_wined3d_parent_ops);
hr = IWineD3DDevice_CreateGeometryShader(device->wined3d_device, shader_info.shader_code,
&shader->output_signature, shader, &d3d10_geometry_shader_wined3d_parent_ops, &shader->wined3d_shader);
if (FAILED(hr))
{
WARN("Failed to create wined3d vertex shader, hr %#x.\n", hr);
......@@ -534,9 +532,8 @@ HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_
return hr;
}
hr = IWineD3DDevice_CreatePixelShader(device->wined3d_device,
shader_info.shader_code, &shader->output_signature, &shader->wined3d_shader,
(IUnknown *)shader, &d3d10_pixel_shader_wined3d_parent_ops);
hr = IWineD3DDevice_CreatePixelShader(device->wined3d_device, shader_info.shader_code,
&shader->output_signature, shader, &d3d10_pixel_shader_wined3d_parent_ops, &shader->wined3d_shader);
if (FAILED(hr))
{
WARN("Failed to create wined3d pixel shader, hr %#x.\n", hr);
......
......@@ -228,11 +228,10 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic
FIXME("Implement DXGI<->wined3d usage conversion\n");
hr = IWineD3DDevice_CreateSurface(device->wined3d_device, desc->Width, desc->Height,
wined3dformat_from_dxgi_format(desc->Format), FALSE, FALSE, 0,
&texture->wined3d_surface, desc->Usage, WINED3DPOOL_DEFAULT,
wined3dformat_from_dxgi_format(desc->Format), FALSE, FALSE, 0, desc->Usage, WINED3DPOOL_DEFAULT,
desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3DMULTISAMPLE_NONE,
desc->SampleDesc.Quality, SURFACE_OPENGL, (IUnknown *)texture,
&d3d10_texture2d_wined3d_parent_ops);
desc->SampleDesc.Quality, SURFACE_OPENGL, texture, &d3d10_texture2d_wined3d_parent_ops,
&texture->wined3d_surface);
if (FAILED(hr))
{
ERR("CreateSurface failed, returning %#x\n", hr);
......
......@@ -388,17 +388,9 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetResource(ID3D10RenderTa
return;
}
hr = IWineD3DResource_GetParent(wined3d_resource, &parent);
IWineD3DResource_Release(wined3d_resource);
if (FAILED(hr))
{
ERR("Failed to get wined3d resource parent, hr %#x\n", hr);
*resource = NULL;
return;
}
parent = IWineD3DResource_GetParent(wined3d_resource);
hr = IUnknown_QueryInterface(parent, &IID_ID3D10Resource, (void **)&resource);
IUnknown_Release(parent);
IWineD3DResource_Release(wined3d_resource);
if (FAILED(hr))
{
ERR("Resource parent isn't a d3d10 resource, hr %#x\n", hr);
......
......@@ -253,22 +253,27 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTU
return hr;
}
static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8 **ppCubeMapSurface) {
static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(IDirect3DCubeTexture8 *iface,
D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8 **ppCubeMapSurface)
{
IDirect3DCubeTexture8Impl *This = (IDirect3DCubeTexture8Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DSurface *mySurface = NULL;
HRESULT hr;
TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, FaceType, Level, ppCubeMapSurface);
wined3d_mutex_lock();
hrc = IWineD3DCubeTexture_GetCubeMapSurface(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level, &mySurface);
if (hrc == D3D_OK && NULL != ppCubeMapSurface) {
IWineD3DCubeTexture_GetParent(mySurface, (IUnknown **)ppCubeMapSurface);
hr = IWineD3DCubeTexture_GetCubeMapSurface(This->wineD3DCubeTexture,
(WINED3DCUBEMAP_FACES) FaceType, Level, &mySurface);
if (SUCCEEDED(hr) && ppCubeMapSurface)
{
*ppCubeMapSurface = IWineD3DCubeTexture_GetParent(mySurface);
IDirect3DSurface8_AddRef(*ppCubeMapSurface);
IWineD3DCubeTexture_Release(mySurface);
}
wined3d_mutex_unlock();
return hrc;
return hr;
}
static HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT *pRect, DWORD Flags) {
......@@ -357,9 +362,9 @@ HRESULT cubetexture_init(IDirect3DCubeTexture8Impl *texture, IDirect3DDevice8Imp
texture->ref = 1;
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length, levels, usage & WINED3DUSAGE_MASK,
wined3dformat_from_d3dformat(format), pool, &texture->wineD3DCubeTexture,
(IUnknown *)texture, &d3d8_cubetexture_wined3d_parent_ops);
hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length, levels,
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, texture,
&d3d8_cubetexture_wined3d_parent_ops, &texture->wineD3DCubeTexture);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -268,9 +268,8 @@ HRESULT indexbuffer_init(IDirect3DIndexBuffer8Impl *buffer, IDirect3DDevice8Impl
buffer->format = wined3dformat_from_d3dformat(format);
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateIndexBuffer(device->WineD3DDevice, size,
usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, &buffer->wineD3DIndexBuffer,
(IUnknown *)buffer, &d3d8_indexbuffer_wined3d_parent_ops);
hr = IWineD3DDevice_CreateIndexBuffer(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
(WINED3DPOOL)pool, buffer, &d3d8_indexbuffer_wined3d_parent_ops, &buffer->wineD3DIndexBuffer);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -100,9 +100,8 @@ HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl
shader->handle = shader_handle;
wined3d_mutex_lock();
hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code,
NULL, &shader->wineD3DPixelShader, (IUnknown *)shader,
&d3d8_pixelshader_wined3d_parent_ops);
hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code, NULL, shader,
&d3d8_pixelshader_wined3d_parent_ops, &shader->wineD3DPixelShader);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -306,9 +306,8 @@ HRESULT surface_init(IDirect3DSurface8Impl *surface, IDirect3DDevice8Impl *devic
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool,
multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface,
&d3d8_surface_wined3d_parent_ops);
lockable, discard, level, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, multisample_type,
multisample_quality, SURFACE_OPENGL, surface, &d3d8_surface_wined3d_parent_ops, &surface->wineD3DSurface);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -83,23 +83,28 @@ static HRESULT WINAPI IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface
return hr;
}
static HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer) {
static HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(IDirect3DSwapChain8 *iface,
UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8 **ppBackBuffer)
{
IDirect3DSwapChain8Impl *This = (IDirect3DSwapChain8Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DSurface *mySurface = NULL;
HRESULT hr;
TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
iface, iBackBuffer, Type, ppBackBuffer);
wined3d_mutex_lock();
hrc = IWineD3DSwapChain_GetBackBuffer(This->wineD3DSwapChain, iBackBuffer, (WINED3DBACKBUFFER_TYPE )Type, &mySurface);
if (hrc == D3D_OK && NULL != mySurface) {
IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppBackBuffer);
IWineD3DSurface_Release(mySurface);
hr = IWineD3DSwapChain_GetBackBuffer(This->wineD3DSwapChain, iBackBuffer,
(WINED3DBACKBUFFER_TYPE)Type, &mySurface);
if (SUCCEEDED(hr) && mySurface)
{
*ppBackBuffer = IWineD3DSurface_GetParent(mySurface);
IDirect3DSurface8_AddRef(*ppBackBuffer);
IWineD3DSurface_Release(mySurface);
}
wined3d_mutex_unlock();
return hrc;
return hr;
}
static const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl =
......@@ -138,7 +143,7 @@ HRESULT swapchain_init(IDirect3DSwapChain8Impl *swapchain, IDirect3DDevice8Impl
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateSwapChain(device->WineD3DDevice, &wined3d_parameters,
&swapchain->wineD3DSwapChain, (IUnknown *)swapchain, SURFACE_OPENGL);
SURFACE_OPENGL, swapchain, &swapchain->wineD3DSwapChain);
wined3d_mutex_unlock();
present_parameters->BackBufferWidth = wined3d_parameters.BackBufferWidth;
......
......@@ -251,22 +251,26 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 ifac
return hr;
}
static HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE8 iface, UINT Level, IDirect3DSurface8 **ppSurfaceLevel) {
static HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(IDirect3DTexture8 *iface,
UINT Level, IDirect3DSurface8 **ppSurfaceLevel)
{
IDirect3DTexture8Impl *This = (IDirect3DTexture8Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DSurface *mySurface = NULL;
HRESULT hr;
TRACE("iface %p, level %u, surface %p.\n", iface, Level, ppSurfaceLevel);
wined3d_mutex_lock();
hrc = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface);
if (hrc == D3D_OK && NULL != ppSurfaceLevel) {
IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppSurfaceLevel);
hr = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface);
if (SUCCEEDED(hr) && ppSurfaceLevel)
{
*ppSurfaceLevel = IWineD3DSurface_GetParent(mySurface);
IDirect3DSurface8_AddRef(*ppSurfaceLevel);
IWineD3DSurface_Release(mySurface);
}
wined3d_mutex_unlock();
return hrc;
return hr;
}
static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DLOCKED_RECT *pLockedRect, CONST RECT *pRect, DWORD Flags) {
......@@ -357,7 +361,7 @@ HRESULT texture_init(IDirect3DTexture8Impl *texture, IDirect3DDevice8Impl *devic
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels,
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
&texture->wineD3DTexture, (IUnknown *)texture, &d3d8_texture_wined3d_parent_ops);
texture, &d3d8_texture_wined3d_parent_ops, &texture->wineD3DTexture);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -271,9 +271,8 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
buffer->fvf = fvf;
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size,
usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, &buffer->wineD3DVertexBuffer,
(IUnknown *)buffer, &d3d8_vertexbuffer_wined3d_parent_ops);
hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
(WINED3DPOOL)pool, buffer, &d3d8_vertexbuffer_wined3d_parent_ops, &buffer->wineD3DVertexBuffer);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -399,9 +399,8 @@ HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration8Impl *declaration,
memcpy(declaration->elements, elements, declaration->elements_size);
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, &declaration->wined3d_vertex_declaration,
(IUnknown *)declaration, &d3d8_vertexdeclaration_wined3d_parent_ops,
wined3d_elements, wined3d_element_count);
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, wined3d_elements, wined3d_element_count,
declaration, &d3d8_vertexdeclaration_wined3d_parent_ops, &declaration->wined3d_vertex_declaration);
wined3d_mutex_unlock();
HeapFree(GetProcessHeap(), 0, wined3d_elements);
if (FAILED(hr))
......@@ -425,9 +424,8 @@ HRESULT vertexdeclaration_init_fvf(IDirect3DVertexDeclaration8Impl *declaration,
declaration->elements_size = 0;
declaration->shader_handle = fvf;
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(device->WineD3DDevice,
&declaration->wined3d_vertex_declaration, (IUnknown *)declaration,
&d3d8_vertexdeclaration_wined3d_parent_ops, fvf);
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(device->WineD3DDevice, fvf, declaration,
&d3d8_vertexdeclaration_wined3d_parent_ops, &declaration->wined3d_vertex_declaration);
if (FAILED(hr))
{
WARN("Failed to create wined3d vertex declaration, hr %#x.\n", hr);
......
......@@ -169,9 +169,8 @@ HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Im
if (usage) FIXME("Usage %#x not implemented.\n", usage);
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateVertexShader(device->WineD3DDevice, byte_code,
NULL /* output signature */, &shader->wineD3DVertexShader,
(IUnknown *)shader, &d3d8_vertexshader_wined3d_parent_ops);
hr = IWineD3DDevice_CreateVertexShader(device->WineD3DDevice, byte_code, NULL /* output signature */,
shader, &d3d8_vertexshader_wined3d_parent_ops, &shader->wineD3DVertexShader);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -264,7 +264,7 @@ HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device,
volume->ref = 1;
hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage,
format, pool, &volume->wineD3DVolume, (IUnknown *)volume, &d3d8_volume_wined3d_parent_ops);
format, pool, volume, &d3d8_volume_wined3d_parent_ops, &volume->wineD3DVolume);
if (FAILED(hr))
{
WARN("Failed to create wined3d volume, hr %#x.\n", hr);
......
......@@ -251,22 +251,26 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMET
return hr;
}
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, IDirect3DVolume8 **ppVolumeLevel) {
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(IDirect3DVolumeTexture8 *iface,
UINT Level, IDirect3DVolume8 **ppVolumeLevel)
{
IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DVolume *myVolume = NULL;
HRESULT hr;
TRACE("iface %p, level %u, volume %p.\n", iface, Level, ppVolumeLevel);
wined3d_mutex_lock();
hrc = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume);
if (hrc == D3D_OK && NULL != ppVolumeLevel) {
IWineD3DVolumeTexture_GetParent(myVolume, (IUnknown **)ppVolumeLevel);
IWineD3DVolumeTexture_Release(myVolume);
hr = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume);
if (SUCCEEDED(hr) && ppVolumeLevel)
{
*ppVolumeLevel = IWineD3DVolumeTexture_GetParent(myVolume);
IDirect3DVolume8_AddRef(*ppVolumeLevel);
IWineD3DVolumeTexture_Release(myVolume);
}
wined3d_mutex_unlock();
return hrc;
return hr;
}
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DLOCKED_BOX *pLockedVolume, CONST D3DBOX *pBox, DWORD Flags) {
......@@ -356,8 +360,8 @@ HRESULT volumetexture_init(IDirect3DVolumeTexture8Impl *texture, IDirect3DDevice
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateVolumeTexture(device->WineD3DDevice, width, height, depth, levels,
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
&texture->wineD3DVolumeTexture, (IUnknown *)texture, &d3d8_volumetexture_wined3d_parent_ops);
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, texture,
&d3d8_volumetexture_wined3d_parent_ops, &texture->wineD3DVolumeTexture);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -292,22 +292,27 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetLevelDesc(LPDIRECT3DCUBETEXTU
return hr;
}
static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9** ppCubeMapSurface) {
static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetCubeMapSurface(IDirect3DCubeTexture9 *iface,
D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9 **ppCubeMapSurface)
{
IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DSurface *mySurface = NULL;
HRESULT hr;
TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, FaceType, Level, ppCubeMapSurface);
wined3d_mutex_lock();
hrc = IWineD3DCubeTexture_GetCubeMapSurface(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level, &mySurface);
if (hrc == D3D_OK && NULL != ppCubeMapSurface) {
IWineD3DCubeTexture_GetParent(mySurface, (IUnknown **)ppCubeMapSurface);
IWineD3DCubeTexture_Release(mySurface);
hr = IWineD3DCubeTexture_GetCubeMapSurface(This->wineD3DCubeTexture,
(WINED3DCUBEMAP_FACES)FaceType, Level, &mySurface);
if (SUCCEEDED(hr) && ppCubeMapSurface)
{
*ppCubeMapSurface = IWineD3DCubeTexture_GetParent(mySurface);
IDirect3DSurface9_AddRef(*ppCubeMapSurface);
IWineD3DCubeTexture_Release(mySurface);
}
wined3d_mutex_unlock();
return hrc;
return hr;
}
static HRESULT WINAPI IDirect3DCubeTexture9Impl_LockRect(LPDIRECT3DCUBETEXTURE9 iface, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) {
......@@ -399,9 +404,9 @@ HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Imp
texture->ref = 1;
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length, levels, usage,
wined3dformat_from_d3dformat(format), pool, &texture->wineD3DCubeTexture,
(IUnknown *)texture, &d3d9_cubetexture_wined3d_parent_ops);
hr = IWineD3DDevice_CreateCubeTexture(device->WineD3DDevice, edge_length,
levels, usage, wined3dformat_from_d3dformat(format), pool, texture,
&d3d9_cubetexture_wined3d_parent_ops, &texture->wineD3DCubeTexture);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -270,9 +270,8 @@ HRESULT indexbuffer_init(IDirect3DIndexBuffer9Impl *buffer, IDirect3DDevice9Impl
buffer->format = wined3dformat_from_d3dformat(format);
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateIndexBuffer(device->WineD3DDevice, size,
usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, &buffer->wineD3DIndexBuffer,
(IUnknown *)buffer, &d3d9_indexbuffer_wined3d_parent_ops);
hr = IWineD3DDevice_CreateIndexBuffer(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
(WINED3DPOOL)pool, buffer, &d3d9_indexbuffer_wined3d_parent_ops, &buffer->wineD3DIndexBuffer);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -136,9 +136,8 @@ HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader, IDirect3DDevice9Impl
shader->lpVtbl = &Direct3DPixelShader9_Vtbl;
wined3d_mutex_lock();
hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code,
NULL, &shader->wineD3DPixelShader, (IUnknown *)shader,
&d3d9_pixelshader_wined3d_parent_ops);
hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code, NULL, shader,
&d3d9_pixelshader_wined3d_parent_ops, &shader->wineD3DPixelShader);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......@@ -165,10 +164,11 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(LPDIRECT3DDEVICE9EX iface, ID
return D3D_OK;
}
HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9EX iface, IDirect3DPixelShader9** ppShader) {
HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 **ppShader)
{
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
IWineD3DPixelShader *object;
HRESULT hrc;
HRESULT hr;
TRACE("iface %p, shader %p.\n", iface, ppShader);
......@@ -178,12 +178,13 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9EX iface, ID
}
wined3d_mutex_lock();
hrc = IWineD3DDevice_GetPixelShader(This->WineD3DDevice, &object);
if (SUCCEEDED(hrc))
hr = IWineD3DDevice_GetPixelShader(This->WineD3DDevice, &object);
if (SUCCEEDED(hr))
{
if (object)
{
hrc = IWineD3DPixelShader_GetParent(object, (IUnknown **)ppShader);
*ppShader = IWineD3DPixelShader_GetParent(object);
IDirect3DPixelShader9_AddRef(*ppShader);
IWineD3DPixelShader_Release(object);
}
else
......@@ -193,12 +194,12 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9EX iface, ID
}
else
{
WARN("(%p) : Call to IWineD3DDevice_GetPixelShader failed %u (device %p)\n", This, hrc, This->WineD3DDevice);
WARN("Failed to get pixel shader, hr %#x.\n", hr);
}
wined3d_mutex_unlock();
TRACE("(%p) : returning %p\n", This, *ppShader);
return hrc;
TRACE("Returning %p.\n", *ppShader);
return hr;
}
HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantF(LPDIRECT3DDEVICE9EX iface, UINT Register, CONST float* pConstantData, UINT Vector4fCount) {
......
......@@ -403,9 +403,8 @@ HRESULT surface_init(IDirect3DSurface9Impl *surface, IDirect3DDevice9Impl *devic
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
lockable, discard, level, &surface->wineD3DSurface, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool,
multisample_type, multisample_quality, SURFACE_OPENGL, (IUnknown *)surface,
&d3d9_surface_wined3d_parent_ops);
lockable, discard, level, usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, multisample_type,
multisample_quality, SURFACE_OPENGL, surface, &d3d9_surface_wined3d_parent_ops, &surface->wineD3DSurface);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -106,24 +106,29 @@ static HRESULT WINAPI IDirect3DSwapChain9Impl_GetFrontBufferData(LPDIRECT3DSWAPC
return hr;
}
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN9 iface, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(IDirect3DSwapChain9 *iface,
UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9 **ppBackBuffer)
{
IDirect3DSwapChain9Impl *This = (IDirect3DSwapChain9Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DSurface *mySurface = NULL;
HRESULT hr;
TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
iface, iBackBuffer, Type, ppBackBuffer);
wined3d_mutex_lock();
hrc = IWineD3DSwapChain_GetBackBuffer(This->wineD3DSwapChain, iBackBuffer, (WINED3DBACKBUFFER_TYPE) Type, &mySurface);
if (hrc == D3D_OK && NULL != mySurface) {
IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppBackBuffer);
hr = IWineD3DSwapChain_GetBackBuffer(This->wineD3DSwapChain, iBackBuffer,
(WINED3DBACKBUFFER_TYPE)Type, &mySurface);
if (SUCCEEDED(hr) && mySurface)
{
*ppBackBuffer = IWineD3DSurface_GetParent(mySurface);
IDirect3DSurface9_AddRef(*ppBackBuffer);
IWineD3DSurface_Release(mySurface);
}
wined3d_mutex_unlock();
/* Do not touch the **ppBackBuffer pointer otherwise! (see device test) */
return hrc;
return hr;
}
static HRESULT WINAPI IDirect3DSwapChain9Impl_GetRasterStatus(LPDIRECT3DSWAPCHAIN9 iface, D3DRASTER_STATUS* pRasterStatus) {
......@@ -239,7 +244,7 @@ HRESULT swapchain_init(IDirect3DSwapChain9Impl *swapchain, IDirect3DDevice9Impl
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateSwapChain(device->WineD3DDevice, &wined3d_parameters,
&swapchain->wineD3DSwapChain, (IUnknown *)swapchain, SURFACE_OPENGL);
SURFACE_OPENGL, swapchain, &swapchain->wineD3DSwapChain);
wined3d_mutex_unlock();
present_parameters->BackBufferWidth = wined3d_parameters.BackBufferWidth;
......@@ -269,25 +274,31 @@ HRESULT swapchain_init(IDirect3DSwapChain9Impl *swapchain, IDirect3DDevice9Impl
return D3D_OK;
}
HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9EX iface, UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) {
HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_GetSwapChain(IDirect3DDevice9Ex *iface,
UINT iSwapChain, IDirect3DSwapChain9 **pSwapChain)
{
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DSwapChain *swapchain = NULL;
HRESULT hr;
TRACE("iface %p, swapchain_idx %u, swapchain %p.\n",
iface, iSwapChain, pSwapChain);
wined3d_mutex_lock();
hrc = IWineD3DDevice_GetSwapChain(This->WineD3DDevice, iSwapChain, &swapchain);
if (hrc == D3D_OK && NULL != swapchain) {
IWineD3DSwapChain_GetParent(swapchain, (IUnknown **)pSwapChain);
hr = IWineD3DDevice_GetSwapChain(This->WineD3DDevice, iSwapChain, &swapchain);
if (SUCCEEDED(hr) && swapchain)
{
*pSwapChain = IWineD3DSwapChain_GetParent(swapchain);
IDirect3DSwapChain9_AddRef(*pSwapChain);
IWineD3DSwapChain_Release(swapchain);
} else {
}
else
{
*pSwapChain = NULL;
}
wined3d_mutex_unlock();
return hrc;
return hr;
}
UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(LPDIRECT3DDEVICE9EX iface) {
......
......@@ -289,22 +289,26 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetLevelDesc(LPDIRECT3DTEXTURE9 ifac
return hr;
}
static HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE9 iface, UINT Level, IDirect3DSurface9** ppSurfaceLevel) {
static HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(IDirect3DTexture9 *iface,
UINT Level, IDirect3DSurface9 **ppSurfaceLevel)
{
IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DSurface *mySurface = NULL;
HRESULT hr;
TRACE("iface %p, level %u, surface %p.\n", iface, Level, ppSurfaceLevel);
wined3d_mutex_lock();
hrc = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface);
if (hrc == D3D_OK && NULL != ppSurfaceLevel) {
IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppSurfaceLevel);
IWineD3DSurface_Release(mySurface);
hr = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface);
if (SUCCEEDED(hr) && ppSurfaceLevel)
{
*ppSurfaceLevel = IWineD3DSurface_GetParent(mySurface);
IDirect3DSurface9_AddRef(*ppSurfaceLevel);
IWineD3DSurface_Release(mySurface);
}
wined3d_mutex_unlock();
return hrc;
return hr;
}
static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) {
......@@ -398,7 +402,7 @@ HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *devic
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels,
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
&texture->wineD3DTexture, (IUnknown *)texture, &d3d9_texture_wined3d_parent_ops);
texture, &d3d9_texture_wined3d_parent_ops, &texture->wineD3DTexture);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -272,9 +272,8 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer9Impl *buffer, IDirect3DDevice9Im
buffer->fvf = fvf;
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size,
usage & WINED3DUSAGE_MASK, (WINED3DPOOL)pool, &buffer->wineD3DVertexBuffer,
(IUnknown *)buffer, &d3d9_vertexbuffer_wined3d_parent_ops);
hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size, usage & WINED3DUSAGE_MASK,
(WINED3DPOOL)pool, buffer, &d3d9_vertexbuffer_wined3d_parent_ops, &buffer->wineD3DVertexBuffer);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -395,9 +395,8 @@ HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration9Impl *declaration,
declaration->element_count = element_count;
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, &declaration->wineD3DVertexDeclaration,
(IUnknown *)declaration, &d3d9_vertexdeclaration_wined3d_parent_ops,
wined3d_elements, wined3d_element_count);
hr = IWineD3DDevice_CreateVertexDeclaration(device->WineD3DDevice, wined3d_elements, wined3d_element_count,
declaration, &d3d9_vertexdeclaration_wined3d_parent_ops, &declaration->wineD3DVertexDeclaration);
wined3d_mutex_unlock();
HeapFree(GetProcessHeap(), 0, wined3d_elements);
if (FAILED(hr))
......@@ -427,29 +426,31 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9EX i
return hr;
}
HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexDeclaration9** ppDecl) {
IDirect3DDevice9Impl* This = (IDirect3DDevice9Impl*) iface;
IWineD3DVertexDeclaration* pTest = NULL;
HRESULT hr = D3D_OK;
HRESULT WINAPI IDirect3DDevice9Impl_GetVertexDeclaration(IDirect3DDevice9Ex *iface,
IDirect3DVertexDeclaration9 **declaration)
{
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
IWineD3DVertexDeclaration *wined3d_declaration = NULL;
HRESULT hr;
TRACE("iface %p, declaration %p.\n", iface, ppDecl);
TRACE("iface %p, declaration %p.\n", iface, declaration);
if (NULL == ppDecl) {
return D3DERR_INVALIDCALL;
}
*ppDecl = NULL;
if (!declaration) return D3DERR_INVALIDCALL;
wined3d_mutex_lock();
hr = IWineD3DDevice_GetVertexDeclaration(This->WineD3DDevice, &pTest);
if (hr == D3D_OK && NULL != pTest) {
IWineD3DVertexDeclaration_GetParent(pTest, (IUnknown **)ppDecl);
IWineD3DVertexDeclaration_Release(pTest);
} else {
*ppDecl = NULL;
hr = IWineD3DDevice_GetVertexDeclaration(This->WineD3DDevice, &wined3d_declaration);
if (SUCCEEDED(hr) && wined3d_declaration)
{
*declaration = IWineD3DVertexDeclaration_GetParent(wined3d_declaration);
IDirect3DVertexDeclaration9_AddRef(*declaration);
IWineD3DVertexDeclaration_Release(wined3d_declaration);
}
else
{
*declaration = NULL;
}
wined3d_mutex_unlock();
TRACE("(%p) : returning %p\n", This, *ppDecl);
TRACE("Returning %p.\n", *declaration);
return hr;
}
......@@ -136,9 +136,8 @@ HRESULT vertexshader_init(IDirect3DVertexShader9Impl *shader, IDirect3DDevice9Im
shader->lpVtbl = &Direct3DVertexShader9_Vtbl;
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateVertexShader(device->WineD3DDevice, byte_code,
NULL /* output signature */, &shader->wineD3DVertexShader,
(IUnknown *)shader, &d3d9_vertexshader_wined3d_parent_ops);
hr = IWineD3DDevice_CreateVertexShader(device->WineD3DDevice, byte_code, NULL,
shader, &d3d9_vertexshader_wined3d_parent_ops, &shader->wineD3DVertexShader);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......@@ -166,20 +165,22 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShader(LPDIRECT3DDEVICE9EX iface, I
return hrc;
}
HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexShader9** ppShader) {
HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9EX iface, IDirect3DVertexShader9 **ppShader)
{
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
IWineD3DVertexShader *pShader;
HRESULT hrc = D3D_OK;
HRESULT hr;
TRACE("iface %p, shader %p.\n", iface, ppShader);
wined3d_mutex_lock();
hrc = IWineD3DDevice_GetVertexShader(This->WineD3DDevice, &pShader);
if (SUCCEEDED(hrc))
hr = IWineD3DDevice_GetVertexShader(This->WineD3DDevice, &pShader);
if (SUCCEEDED(hr))
{
if (pShader)
{
hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)ppShader);
*ppShader = IWineD3DVertexShader_GetParent(pShader);
IDirect3DVertexShader9_AddRef(*ppShader);
IWineD3DVertexShader_Release(pShader);
}
else
......@@ -189,12 +190,13 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9EX iface, I
}
else
{
WARN("(%p) : Call to IWineD3DDevice_GetVertexShader failed %u (device %p)\n", This, hrc, This->WineD3DDevice);
WARN("Failed to get vertex shader, hr %#x.\n", hr);
}
wined3d_mutex_unlock();
TRACE("(%p) : returning %p\n", This, *ppShader);
return hrc;
TRACE("Returning %p.\n", *ppShader);
return hr;
}
HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantF(LPDIRECT3DDEVICE9EX iface, UINT Register, CONST float* pConstantData, UINT Vector4fCount) {
......
......@@ -275,7 +275,7 @@ HRESULT volume_init(IDirect3DVolume9Impl *volume, IDirect3DDevice9Impl *device,
volume->ref = 1;
hr = IWineD3DDevice_CreateVolume(device->WineD3DDevice, width, height, depth, usage & WINED3DUSAGE_MASK,
format, pool, &volume->wineD3DVolume, (IUnknown *)volume, &d3d9_volume_wined3d_parent_ops);
format, pool, volume, &d3d9_volume_wined3d_parent_ops, &volume->wineD3DVolume);
if (FAILED(hr))
{
WARN("Failed to create wined3d volume, hr %#x.\n", hr);
......
......@@ -315,24 +315,28 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetLevelDesc(LPDIRECT3DVOLUMET
return hr;
}
static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, IDirect3DVolume9** ppVolumeLevel) {
static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetVolumeLevel(IDirect3DVolumeTexture9 *iface,
UINT Level, IDirect3DVolume9 **ppVolumeLevel)
{
IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface;
HRESULT hrc = D3D_OK;
IWineD3DVolume *myVolume = NULL;
HRESULT hr;
TRACE("iface %p, level %u, volume %p.\n", iface, Level, ppVolumeLevel);
wined3d_mutex_lock();
hrc = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume);
if (hrc == D3D_OK && NULL != ppVolumeLevel) {
IWineD3DVolumeTexture_GetParent(myVolume, (IUnknown **)ppVolumeLevel);
hr = IWineD3DVolumeTexture_GetVolumeLevel(This->wineD3DVolumeTexture, Level, &myVolume);
if (SUCCEEDED(hr) && ppVolumeLevel)
{
*ppVolumeLevel = IWineD3DVolumeTexture_GetParent(myVolume);
IDirect3DVolumeTexture9_AddRef(*ppVolumeLevel);
IWineD3DVolumeTexture_Release(myVolume);
}
wined3d_mutex_unlock();
return hrc;
return hr;
}
static HRESULT WINAPI IDirect3DVolumeTexture9Impl_LockBox(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) {
......@@ -433,8 +437,8 @@ HRESULT volumetexture_init(IDirect3DVolumeTexture9Impl *texture, IDirect3DDevice
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateVolumeTexture(device->WineD3DDevice, width, height, depth, levels,
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
&texture->wineD3DVolumeTexture, (IUnknown *)texture, &d3d9_volumetexture_wined3d_parent_ops);
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool, texture,
&d3d9_volumetexture_wined3d_parent_ops, &texture->wineD3DVolumeTexture);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -1836,13 +1836,9 @@ static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurfa
return DDERR_NOTFOUND;
}
/* GetBackBuffer AddRef()ed the surface, release it */
ddsurf = IWineD3DSurface_GetParent(Surf);
IWineD3DSurface_Release(Surf);
IWineD3DSurface_GetParent(Surf,
(IUnknown **) &ddsurf);
IDirectDrawSurface7_Release(ddsurf); /* For the GetParent */
/* Find the front buffer */
ddsCaps.dwCaps = DDSCAPS_FRONTBUFFER;
hr = IDirectDrawSurface7_GetAttachedSurface(ddsurf,
......@@ -2249,7 +2245,8 @@ static HRESULT WINAPI ddraw7_GetSurfaceFromDC(IDirectDraw7 *iface, HDC hdc, IDir
return DDERR_NOTFOUND;
}
IWineD3DSurface_GetParent(wined3d_surface, (IUnknown **)Surface);
*Surface = IWineD3DSurface_GetParent(wined3d_surface);
IDirectDrawSurface7_AddRef(*Surface);
TRACE("Returning surface %p.\n", Surface);
return DD_OK;
}
......@@ -2359,9 +2356,9 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
{
IDirectDrawSurfaceImpl *surfImpl = (IDirectDrawSurfaceImpl *)surf;
IDirectDrawImpl *This = surfImpl->ddraw;
IUnknown *Parent;
IWineD3DSurface *wineD3DSurface;
IWineD3DSwapChain *swapchain;
void *parent;
HRESULT hr;
IWineD3DClipper *clipper = NULL;
......@@ -2403,13 +2400,10 @@ HRESULT WINAPI ddraw_recreate_surfaces_cb(IDirectDrawSurface7 *surf, DDSURFACEDE
Width = Desc.width;
Height = Desc.height;
IWineD3DSurface_GetParent(wineD3DSurface, &Parent);
/* Create the new surface */
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, Width, Height, Format,
TRUE /* Lockable */, FALSE /* Discard */, surfImpl->mipmap_level, &surfImpl->WineD3DSurface, Usage, Pool,
MultiSampleType, MultiSampleQuality, This->ImplType, Parent, &ddraw_null_wined3d_parent_ops);
IUnknown_Release(Parent);
parent = IWineD3DSurface_GetParent(wineD3DSurface);
hr = IWineD3DDevice_CreateSurface(This->wineD3DDevice, Width, Height, Format, TRUE /* Lockable */,
FALSE /* Discard */, surfImpl->mipmap_level, Usage, Pool, MultiSampleType, MultiSampleQuality,
This->ImplType, parent, &ddraw_null_wined3d_parent_ops, &surfImpl->WineD3DSurface);
if (FAILED(hr))
{
surfImpl->WineD3DSurface = wineD3DSurface;
......@@ -2475,13 +2469,13 @@ static HRESULT ddraw_recreate_surfaces(IDirectDrawImpl *This)
return IDirectDraw7_EnumSurfaces((IDirectDraw7 *)This, 0, &desc, This, ddraw_recreate_surfaces_cb);
}
ULONG WINAPI D3D7CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain) {
IUnknown* swapChainParent;
ULONG WINAPI D3D7CB_DestroySwapChain(IWineD3DSwapChain *pSwapChain)
{
IUnknown *swapChainParent;
TRACE("swapchain %p.\n", pSwapChain);
IWineD3DSwapChain_GetParent(pSwapChain, &swapChainParent);
IUnknown_Release(swapChainParent);
swapChainParent = IWineD3DSwapChain_GetParent(pSwapChain);
return IUnknown_Release(swapChainParent);
}
......@@ -3295,15 +3289,15 @@ static HRESULT WINAPI ddraw7_CreateSurface(IDirectDraw7 *iface,
*/
if(desc2.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
{
hr = IWineD3DDevice_CreateCubeTexture(This->wineD3DDevice, DDSD->dwWidth /* Edgelength */,
levels, 0 /* usage */, Format, Pool, (IWineD3DCubeTexture **)&object->wineD3DTexture,
(IUnknown *)object, &ddraw_null_wined3d_parent_ops);
hr = IWineD3DDevice_CreateCubeTexture(This->wineD3DDevice, DDSD->dwWidth /* Edgelength */, levels,
0 /* usage */, Format, Pool, object, &ddraw_null_wined3d_parent_ops,
(IWineD3DCubeTexture **)&object->wineD3DTexture);
}
else
{
hr = IWineD3DDevice_CreateTexture(This->wineD3DDevice, DDSD->dwWidth, DDSD->dwHeight, levels,
0 /* usage */, Format, Pool, (IWineD3DTexture **)&object->wineD3DTexture,
(IUnknown *)object, &ddraw_null_wined3d_parent_ops);
0 /* usage */, Format, Pool, object, &ddraw_null_wined3d_parent_ops,
(IWineD3DTexture **)&object->wineD3DTexture);
}
This->tex_root = NULL;
}
......@@ -5375,8 +5369,8 @@ IWineD3DVertexDeclaration *ddraw_find_decl(IDirectDrawImpl *This, DWORD fvf)
}
TRACE("not found. Creating and inserting at position %d.\n", low);
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(This->wineD3DDevice, &pDecl,
(IUnknown *)This, &ddraw_null_wined3d_parent_ops, fvf);
hr = IWineD3DDevice_CreateVertexDeclarationFromFVF(This->wineD3DDevice,
fvf, This, &ddraw_null_wined3d_parent_ops, &pDecl);
if (hr != S_OK) return NULL;
if(This->declArraySize == This->numConvertedDecls) {
......@@ -5644,7 +5638,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
ddraw_parent_init(object);
hr = IWineD3DDevice_CreateSwapChain(This->wineD3DDevice, present_parameters,
swapchain, (IUnknown *)object, This->ImplType);
This->ImplType, object, swapchain);
if (FAILED(hr))
{
FIXME("(%p) CreateSwapChain failed, returning %#x\n", iface, hr);
......
......@@ -300,10 +300,8 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
EnterCriticalSection(&ddraw_cs);
/* Free the index buffer. */
IWineD3DDevice_SetIndexBuffer(This->wineD3DDevice, NULL, WINED3DFMT_UNKNOWN);
IWineD3DBuffer_GetParent(This->indexbuffer,
(IUnknown **) &IndexBufferParent);
IParent_Release(IndexBufferParent); /* Once for the getParent */
if( IParent_Release(IndexBufferParent) != 0) /* And now to destroy it */
IndexBufferParent = IWineD3DBuffer_GetParent(This->indexbuffer);
if (IParent_Release(IndexBufferParent))
{
ERR(" (%p) Something is still holding the index buffer parent %p\n", This, IndexBufferParent);
}
......@@ -2556,24 +2554,13 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
EnterCriticalSection(&ddraw_cs);
hr = IWineD3DDevice_GetTexture(This->wineD3DDevice,
0,
&tex);
if(hr == WINED3D_OK && tex)
hr = IWineD3DDevice_GetTexture(This->wineD3DDevice, 0, &tex);
if (SUCCEEDED(hr) && tex)
{
IDirectDrawSurface7 *parent = NULL;
hr = IWineD3DBaseTexture_GetParent(tex,
(IUnknown **) &parent);
if(parent)
{
/* The parent of the texture is the IDirectDrawSurface7 interface
* of the ddraw surface
*/
IDirectDrawSurfaceImpl *texImpl = (IDirectDrawSurfaceImpl *)parent;
*lpdwRenderState = texImpl->Handle;
IDirectDrawSurface7_Release(parent);
}
/* The parent of the texture is the IDirectDrawSurface7
* interface of the ddraw surface. */
IDirectDrawSurfaceImpl *parent = IWineD3DBaseTexture_GetParent(tex);
if (parent) *lpdwRenderState = parent->Handle;
IWineD3DBaseTexture_Release(tex);
}
......@@ -4353,18 +4340,16 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
{
UINT size = max(desc.Size * 2, IndexCount * sizeof(WORD));
IWineD3DBuffer *buffer;
IUnknown *parent;
IParentImpl *parent;
TRACE("Growing index buffer to %u bytes\n", size);
IWineD3DBuffer_GetParent(This->indexbuffer, &parent);
hr = IWineD3DDevice_CreateIndexBuffer(This->wineD3DDevice, size,
WINED3DUSAGE_DYNAMIC /* Usage */, WINED3DPOOL_DEFAULT, &buffer, parent,
&ddraw_null_wined3d_parent_ops);
if(hr != D3D_OK)
parent = IWineD3DBuffer_GetParent(This->indexbuffer);
hr = IWineD3DDevice_CreateIndexBuffer(This->wineD3DDevice, size, WINED3DUSAGE_DYNAMIC /* Usage */,
WINED3DPOOL_DEFAULT, parent, &ddraw_null_wined3d_parent_ops, &buffer);
if (FAILED(hr))
{
ERR("(%p) IWineD3DDevice::CreateIndexBuffer failed with hr = %08x\n", This, hr);
IParent_Release(parent);
LeaveCriticalSection(&ddraw_cs);
return hr;
}
......@@ -4372,8 +4357,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
IWineD3DBuffer_Release(This->indexbuffer);
This->indexbuffer = buffer;
((IParentImpl *)parent)->child = (IUnknown *)buffer;
IParent_Release(parent);
parent->child = (IUnknown *)buffer;
}
/* copy the index stream into the index buffer.
......@@ -4649,11 +4633,8 @@ IDirect3DDeviceImpl_7_GetTexture(IDirect3DDevice7 *iface,
return hr;
}
/* GetParent AddRef()s, which is perfectly OK.
* We have passed the IDirectDrawSurface7 interface to WineD3D, so that's OK too.
*/
hr = IWineD3DBaseTexture_GetParent(Surf,
(IUnknown **) Texture);
*Texture = IWineD3DBaseTexture_GetParent(Surf);
IDirectDrawSurface7_AddRef(*Texture);
LeaveCriticalSection(&ddraw_cs);
return hr;
}
......@@ -7014,8 +6995,8 @@ HRESULT d3d_device_init(IDirect3DDeviceImpl *device, IDirectDrawImpl *ddraw, IDi
ddraw_parent_init(index_buffer_parent);
hr = IWineD3DDevice_CreateIndexBuffer(ddraw->wineD3DDevice, 0x40000 /* Length. Don't know how long it should be */,
WINED3DUSAGE_DYNAMIC /* Usage */, WINED3DPOOL_DEFAULT, &device->indexbuffer,
(IUnknown *)index_buffer_parent, &ddraw_null_wined3d_parent_ops);
WINED3DUSAGE_DYNAMIC /* Usage */, WINED3DPOOL_DEFAULT, index_buffer_parent,
&ddraw_null_wined3d_parent_ops, &device->indexbuffer);
if (FAILED(hr))
{
ERR("Failed to create an index buffer, hr %#x.\n", hr);
......
......@@ -268,7 +268,7 @@ HRESULT ddraw_palette_init(IDirectDrawPaletteImpl *palette,
palette->ref = 1;
hr = IWineD3DDevice_CreatePalette(ddraw->wineD3DDevice, flags,
entries, &palette->wineD3DPalette, (IUnknown *)palette);
entries, palette, &palette->wineD3DPalette);
if (FAILED(hr))
{
WARN("Failed to create wined3d palette, hr %#x.\n", hr);
......
......@@ -2742,7 +2742,8 @@ static HRESULT WINAPI ddraw_surface7_GetPalette(IDirectDrawSurface7 *iface, IDir
if(wPal)
{
hr = IWineD3DPalette_GetParent(wPal, (IUnknown **) Pal);
*Pal = IWineD3DPalette_GetParent(wPal);
IDirectDrawPalette_AddRef(*Pal);
}
else
{
......@@ -3251,16 +3252,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
LeaveCriticalSection(&ddraw_cs);
return D3DERR_TEXTURE_LOAD_FAILED;
}
if (wined3d_dst_pal)
{
hr = IWineD3DPalette_GetParent(wined3d_dst_pal, (IUnknown **)&dst_pal);
if (FAILED(hr))
{
ERR("Failed to get destination palette parent, hr %#x.\n", hr);
LeaveCriticalSection(&ddraw_cs);
return D3DERR_TEXTURE_LOAD_FAILED;
}
}
if (wined3d_dst_pal) dst_pal = IWineD3DPalette_GetParent(wined3d_dst_pal);
hr = IWineD3DSurface_GetPalette(src_surface->WineD3DSurface, &wined3d_src_pal);
if (FAILED(hr))
......@@ -3269,17 +3261,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
LeaveCriticalSection(&ddraw_cs);
return D3DERR_TEXTURE_LOAD_FAILED;
}
if (wined3d_src_pal)
{
hr = IWineD3DPalette_GetParent(wined3d_src_pal, (IUnknown **)&src_pal);
if (FAILED(hr))
{
ERR("Failed to get source palette parent, hr %#x.\n", hr);
if (dst_pal) IDirectDrawPalette_Release(dst_pal);
LeaveCriticalSection(&ddraw_cs);
return D3DERR_TEXTURE_LOAD_FAILED;
}
}
if (wined3d_src_pal) src_pal = IWineD3DPalette_GetParent(wined3d_src_pal);
if (src_pal)
{
......@@ -3287,7 +3269,6 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
if (!dst_pal)
{
IDirectDrawPalette_Release(src_pal);
LeaveCriticalSection(&ddraw_cs);
return DDERR_NOPALETTEATTACHED;
}
......@@ -3295,9 +3276,6 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
IDirectDrawPalette_SetEntries(dst_pal, 0, 0, 256, palent);
}
if (dst_pal) IDirectDrawPalette_Release(dst_pal);
if (src_pal) IDirectDrawPalette_Release(src_pal);
/* Copy one surface on the other */
dst_desc = (DDSURFACEDESC *)&(dst_surface->surface_desc);
src_desc = (DDSURFACEDESC *)&(src_surface->surface_desc);
......@@ -3600,9 +3578,9 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
surface->ImplType = surface_type;
hr = IWineD3DDevice_CreateSurface(ddraw->wineD3DDevice, desc->dwWidth, desc->dwHeight, format,
TRUE /* Lockable */, FALSE /* Discard */, mip_level, &surface->WineD3DSurface,
usage, pool, WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, surface_type,
(IUnknown *)surface, &ddraw_null_wined3d_parent_ops);
TRUE /* Lockable */, FALSE /* Discard */, mip_level, usage, pool,
WINED3DMULTISAMPLE_NONE, 0 /* MultiSampleQuality */, surface_type, surface,
&ddraw_null_wined3d_parent_ops, &surface->WineD3DSurface);
if (FAILED(hr))
{
WARN("Failed to create wined3d surface, hr %#x.\n", hr);
......
......@@ -605,7 +605,7 @@ HRESULT d3d_vertex_buffer_init(IDirect3DVertexBufferImpl *buffer,
hr = IWineD3DDevice_CreateVertexBuffer(ddraw->wineD3DDevice,
get_flexible_vertex_size(desc->dwFVF) * desc->dwNumVertices,
usage, desc->dwCaps & D3DVBCAPS_SYSTEMMEMORY ? WINED3DPOOL_SYSTEMMEM : WINED3DPOOL_DEFAULT,
&buffer->wineD3DVertexBuffer, (IUnknown *)buffer, &ddraw_null_wined3d_parent_ops);
buffer, &ddraw_null_wined3d_parent_ops, &buffer->wineD3DVertexBuffer);
if (FAILED(hr))
{
WARN("Failed to create wined3d vertex buffer, hr %#x.\n", hr);
......
......@@ -190,16 +190,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
goto fail;
}
hr = IWineD3DSurface_GetParent(wined3d_surface, &parent);
IWineD3DSurface_Release(wined3d_surface);
if (FAILED(hr))
{
ERR("GetParent failed, returning %#x\n", hr);
goto fail;
}
parent = IWineD3DSurface_GetParent(wined3d_surface);
hr = IUnknown_QueryInterface(parent, &IID_IDXGISurface, (void **)&surface[i]);
IUnknown_Release(parent);
IWineD3DSurface_Release(wined3d_surface);
if (FAILED(hr))
{
ERR("Surface should implement IDXGISurface\n");
......
......@@ -235,17 +235,11 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IWineDXGIFactory *
return hr;
}
hr = IWineD3DSwapChain_GetParent(wined3d_swapchain, (IUnknown **)swapchain);
swapchain = IWineD3DSwapChain_GetParent(wined3d_swapchain);
IUnknown_Release(wined3d_swapchain);
if (FAILED(hr))
{
WARN("Failed to get swapchain, returning %#x\n", hr);
return hr;
}
/* FIXME? The swapchain is created with refcount 1 by the wined3d device,
* but the wined3d device can't hold a real reference. */
IUnknown_Release(*swapchain);
TRACE("Created IDXGISwapChain %p\n", *swapchain);
......
......@@ -174,16 +174,10 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
return hr;
}
hr = IWineD3DSurface_GetParent(backbuffer, &parent);
parent = IWineD3DSurface_GetParent(backbuffer);
hr = IUnknown_QueryInterface(parent, riid, surface);
IWineD3DSurface_Release(backbuffer);
LeaveCriticalSection(&dxgi_cs);
if (FAILED(hr))
{
return hr;
}
hr = IUnknown_QueryInterface(parent, riid, surface);
IUnknown_Release(parent);
return hr;
}
......@@ -284,7 +278,7 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device
swapchain->refcount = 1;
hr = IWineD3DDevice_CreateSwapChain(device->wined3d_device, present_parameters,
&swapchain->wined3d_swapchain, (IUnknown *)swapchain, SURFACE_OPENGL);
SURFACE_OPENGL, swapchain, &swapchain->wined3d_swapchain);
if (FAILED(hr))
{
WARN("Failed to create wined3d swapchain, hr %#x.\n", hr);
......
......@@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UINT level_count,
WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, UINT size, DWORD usage,
const struct wined3d_format *format, WINED3DPOOL pool, IUnknown *parent,
const struct wined3d_format *format, WINED3DPOOL pool, void *parent,
const struct wined3d_parent_ops *parent_ops)
{
HRESULT hr;
......
......@@ -744,10 +744,11 @@ static ULONG STDMETHODCALLTYPE buffer_Release(IWineD3DBuffer *iface)
}
/* IWineD3DBase methods */
static HRESULT STDMETHODCALLTYPE buffer_GetParent(IWineD3DBuffer *iface, IUnknown **parent)
static void * STDMETHODCALLTYPE buffer_GetParent(IWineD3DBuffer *iface)
{
return resource_get_parent((IWineD3DResource *)iface, parent);
TRACE("iface %p.\n", iface);
return ((struct wined3d_buffer *)iface)->resource.parent;
}
/* IWineD3DResource methods */
......@@ -1448,7 +1449,7 @@ static const struct IWineD3DBufferVtbl wined3d_buffer_vtbl =
HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
UINT size, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, GLenum bind_hint,
const char *data, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
const char *data, void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
......
......@@ -230,8 +230,11 @@ static WINED3DRESOURCETYPE WINAPI IWineD3DCubeTextureImpl_GetType(IWineD3DCubeTe
return resource_get_type((IWineD3DResource *)iface);
}
static HRESULT WINAPI IWineD3DCubeTextureImpl_GetParent(IWineD3DCubeTexture *iface, IUnknown **pParent) {
return resource_get_parent((IWineD3DResource *)iface, pParent);
static void * WINAPI IWineD3DCubeTextureImpl_GetParent(IWineD3DCubeTexture *iface)
{
TRACE("iface %p.\n", iface);
return ((IWineD3DCubeTextureImpl *)iface)->resource.parent;
}
/* ******************************************************
......@@ -452,7 +455,7 @@ static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UINT levels,
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
......
......@@ -4871,11 +4871,11 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT adapter_id
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DImpl_GetParent(IWineD3D *iface, IUnknown **pParent) {
IWineD3DImpl *This = (IWineD3DImpl *)iface;
IUnknown_AddRef(This->parent);
*pParent = This->parent;
return WINED3D_OK;
static void * WINAPI IWineD3DImpl_GetParent(IWineD3D *iface)
{
TRACE("iface %p.\n", iface);
return ((IWineD3DImpl *)iface)->parent;
}
static void WINE_GLAPI invalid_func(const void *data)
......@@ -5393,7 +5393,7 @@ const struct wined3d_parent_ops wined3d_null_parent_ops =
wined3d_null_wined3d_object_destroyed,
};
HRESULT wined3d_init(IWineD3DImpl *wined3d, UINT version, IUnknown *parent)
HRESULT wined3d_init(IWineD3DImpl *wined3d, UINT version, void *parent)
{
wined3d->lpVtbl = &IWineD3D_Vtbl;
wined3d->dxVersion = version;
......
......@@ -175,13 +175,11 @@ static HRESULT WINAPI IWineD3DPaletteImpl_GetCaps(IWineD3DPalette *iface, DWORD
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DPaletteImpl_GetParent(IWineD3DPalette *iface, IUnknown **Parent) {
IWineD3DPaletteImpl *This = (IWineD3DPaletteImpl *)iface;
TRACE("(%p)->(%p)\n", This, Parent);
static void * WINAPI IWineD3DPaletteImpl_GetParent(IWineD3DPalette *iface)
{
TRACE("iface %p.\n", iface);
*Parent = This->parent;
IUnknown_AddRef(This->parent);
return WINED3D_OK;
return ((IWineD3DPaletteImpl *)iface)->parent;
}
static const IWineD3DPaletteVtbl IWineD3DPalette_Vtbl =
......@@ -198,7 +196,7 @@ static const IWineD3DPaletteVtbl IWineD3DPalette_Vtbl =
};
HRESULT wined3d_palette_init(IWineD3DPaletteImpl *palette, IWineD3DDeviceImpl *device,
DWORD flags, const PALETTEENTRY *entries, IUnknown *parent)
DWORD flags, const PALETTEENTRY *entries, void *parent)
{
HRESULT hr;
......
......@@ -29,12 +29,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type,
IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format *format,
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops)
{
struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource;
resource->device = device;
resource->parent = parent;
resource->resourceType = resource_type;
resource->ref = 1;
resource->pool = pool;
......@@ -42,6 +41,7 @@ HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type
resource->usage = usage;
resource->size = size;
resource->priority = 0;
resource->parent = parent;
resource->parent_ops = parent_ops;
list_init(&resource->privateData);
......@@ -245,11 +245,3 @@ WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface)
TRACE("(%p) : returning %d\n", This, This->resource.resourceType);
return This->resource.resourceType;
}
HRESULT resource_get_parent(IWineD3DResource *iface, IUnknown **pParent)
{
IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface;
IUnknown_AddRef(This->resource.parent);
*pParent = This->resource.parent;
return WINED3D_OK;
}
......@@ -286,7 +286,7 @@ int shader_addline(struct wined3d_shader_buffer *buffer, const char *format, ...
}
static void shader_init(struct IWineD3DBaseShaderClass *shader, IWineD3DDeviceImpl *device,
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
void *parent, const struct wined3d_parent_ops *parent_ops)
{
shader->ref = 1;
shader->device = (IWineD3DDevice *)device;
......@@ -1534,13 +1534,6 @@ const shader_backend_t none_shader_backend = {
shader_none_color_fixup_supported,
};
static void shader_get_parent(IWineD3DBaseShaderImpl *shader, IUnknown **parent)
{
*parent = shader->baseShader.parent;
IUnknown_AddRef(*parent);
TRACE("shader %p, returning %p.\n", shader, *parent);
}
static HRESULT shader_get_function(IWineD3DBaseShaderImpl *shader, void *data, UINT *data_size)
{
if (!data)
......@@ -1654,13 +1647,11 @@ static ULONG STDMETHODCALLTYPE vertexshader_Release(IWineD3DVertexShader *iface)
return refcount;
}
static HRESULT STDMETHODCALLTYPE vertexshader_GetParent(IWineD3DVertexShader *iface, IUnknown **parent)
static void * STDMETHODCALLTYPE vertexshader_GetParent(IWineD3DVertexShader *iface)
{
TRACE("iface %p, parent %p.\n", iface, parent);
TRACE("iface %p.\n", iface);
shader_get_parent((IWineD3DBaseShaderImpl *)iface, parent);
return WINED3D_OK;
return ((IWineD3DBaseShaderImpl *)iface)->baseShader.parent;
}
static HRESULT STDMETHODCALLTYPE vertexshader_GetFunction(IWineD3DVertexShader *iface, void *data, UINT *data_size)
......@@ -1829,7 +1820,7 @@ static void vertexshader_set_limits(IWineD3DVertexShaderImpl *shader)
HRESULT vertexshader_init(IWineD3DVertexShaderImpl *shader, IWineD3DDeviceImpl *device,
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
......@@ -1951,13 +1942,11 @@ static ULONG STDMETHODCALLTYPE geometryshader_Release(IWineD3DGeometryShader *if
return refcount;
}
static HRESULT STDMETHODCALLTYPE geometryshader_GetParent(IWineD3DGeometryShader *iface, IUnknown **parent)
static void * STDMETHODCALLTYPE geometryshader_GetParent(IWineD3DGeometryShader *iface)
{
TRACE("iface %p, parent %p.\n", iface, parent);
TRACE("iface %p.\n", iface);
shader_get_parent((IWineD3DBaseShaderImpl *)iface, parent);
return WINED3D_OK;
return ((IWineD3DBaseShaderImpl *)iface)->baseShader.parent;
}
static HRESULT STDMETHODCALLTYPE geometryshader_GetFunction(IWineD3DGeometryShader *iface, void *data, UINT *data_size)
......@@ -1981,7 +1970,7 @@ static const IWineD3DGeometryShaderVtbl wined3d_geometryshader_vtbl =
HRESULT geometryshader_init(struct wined3d_geometryshader *shader, IWineD3DDeviceImpl *device,
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
void *parent, const struct wined3d_parent_ops *parent_ops)
{
HRESULT hr;
......@@ -2048,13 +2037,11 @@ static ULONG STDMETHODCALLTYPE pixelshader_Release(IWineD3DPixelShader *iface)
return refcount;
}
static HRESULT STDMETHODCALLTYPE pixelshader_GetParent(IWineD3DPixelShader *iface, IUnknown **parent)
static void * STDMETHODCALLTYPE pixelshader_GetParent(IWineD3DPixelShader *iface)
{
TRACE("iface %p, parent %p.\n", iface, parent);
TRACE("iface %p.\n", iface);
shader_get_parent((IWineD3DBaseShaderImpl *)iface, parent);
return WINED3D_OK;
return ((IWineD3DBaseShaderImpl *)iface)->baseShader.parent;
}
static HRESULT STDMETHODCALLTYPE pixelshader_GetFunction(IWineD3DPixelShader *iface, void *data, UINT *data_size)
......@@ -2253,7 +2240,7 @@ static void pixelshader_set_limits(IWineD3DPixelShaderImpl *shader)
HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *device,
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
unsigned int i, highest_reg_used = 0, num_regs_used = 0;
......
......@@ -347,7 +347,7 @@ void draw_textured_quad(IWineD3DSurfaceImpl *src_surface, const RECT *src_rect,
HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type, UINT alignment,
UINT width, UINT height, UINT level, BOOL lockable, BOOL discard, WINED3DMULTISAMPLE_TYPE multisample_type,
UINT multisample_quality, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
......
......@@ -139,9 +139,11 @@ WINED3DRESOURCETYPE WINAPI IWineD3DBaseSurfaceImpl_GetType(IWineD3DSurface *ifac
return resource_get_type((IWineD3DResource *)iface);
}
HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent) {
TRACE("(%p) : calling resourceimpl_GetParent\n", iface);
return resource_get_parent((IWineD3DResource *)iface, pParent);
void * WINAPI IWineD3DBaseSurfaceImpl_GetParent(IWineD3DSurface *iface)
{
TRACE("iface %p.\n", iface);
return ((IWineD3DSurfaceImpl *)iface)->resource.parent;
}
/* ******************************************************
......@@ -811,10 +813,10 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source,
}
IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.device, source->currentDesc.Width,
source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret,
source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */,
0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */,
0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source),
NULL /* parent */, &wined3d_null_parent_ops);
NULL /* parent */, &wined3d_null_parent_ops, &ret);
if(!ret) {
ERR("Failed to create a destination surface for conversion\n");
return NULL;
......
......@@ -622,7 +622,7 @@ void swapchain_restore_fullscreen_window(IWineD3DSwapChainImpl *swapchain)
HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface_type,
IWineD3DDeviceImpl *device, WINED3DPRESENT_PARAMETERS *present_parameters, IUnknown *parent)
IWineD3DDeviceImpl *device, WINED3DPRESENT_PARAMETERS *present_parameters, void *parent)
{
const struct wined3d_adapter *adapter = device->adapter;
const struct wined3d_format *format;
......
......@@ -64,12 +64,11 @@ ULONG WINAPI IWineD3DBaseSwapChainImpl_Release(IWineD3DSwapChain *iface) {
return refCount;
}
HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetParent(IWineD3DSwapChain *iface, IUnknown ** ppParent){
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
*ppParent = This->parent;
IUnknown_AddRef(*ppParent);
TRACE("(%p) returning %p\n", This , *ppParent);
return WINED3D_OK;
void * WINAPI IWineD3DBaseSwapChainImpl_GetParent(IWineD3DSwapChain *iface)
{
TRACE("iface %p.\n", iface);
return ((IWineD3DSwapChainImpl *)iface)->parent;
}
HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetFrontBufferData(IWineD3DSwapChain *iface, IWineD3DSurface *dst_surface)
......
......@@ -221,8 +221,11 @@ static WINED3DRESOURCETYPE WINAPI IWineD3DTextureImpl_GetType(IWineD3DTexture *i
return resource_get_type((IWineD3DResource *)iface);
}
static HRESULT WINAPI IWineD3DTextureImpl_GetParent(IWineD3DTexture *iface, IUnknown **pParent) {
return resource_get_parent((IWineD3DResource *)iface, pParent);
static void * WINAPI IWineD3DTextureImpl_GetParent(IWineD3DTexture *iface)
{
TRACE("iface %p.\n", iface);
return ((IWineD3DTextureImpl *)iface)->resource.parent;
}
/* ******************************************************
......@@ -463,7 +466,7 @@ static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT levels,
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
......
......@@ -79,13 +79,11 @@ static ULONG WINAPI IWineD3DVertexDeclarationImpl_Release(IWineD3DVertexDeclarat
IWineD3DVertexDeclaration parts follow
******************************************* */
static HRESULT WINAPI IWineD3DVertexDeclarationImpl_GetParent(IWineD3DVertexDeclaration *iface, IUnknown** parent){
IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
static void * WINAPI IWineD3DVertexDeclarationImpl_GetParent(IWineD3DVertexDeclaration *iface)
{
TRACE("iface %p.\n", iface);
*parent= This->parent;
IUnknown_AddRef(*parent);
TRACE("(%p) : returning %p\n", This, *parent);
return WINED3D_OK;
return ((IWineD3DVertexDeclarationImpl *)iface)->parent;
}
static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
......@@ -188,7 +186,7 @@ static const IWineD3DVertexDeclarationVtbl IWineD3DVertexDeclaration_Vtbl =
HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWineD3DDeviceImpl *device,
const WINED3DVERTEXELEMENT *elements, UINT element_count,
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
WORD preloaded = 0; /* MAX_STREAMS, 16 */
......
......@@ -74,14 +74,11 @@ static ULONG STDMETHODCALLTYPE rendertarget_view_Release(IWineD3DRendertargetVie
/* IWineD3DBase methods */
static HRESULT STDMETHODCALLTYPE rendertarget_view_GetParent(IWineD3DRendertargetView *iface, IUnknown **parent)
static void * STDMETHODCALLTYPE rendertarget_view_GetParent(IWineD3DRendertargetView *iface)
{
struct wined3d_rendertarget_view *This = (struct wined3d_rendertarget_view *)iface;
IUnknown_AddRef(This->parent);
*parent = This->parent;
TRACE("iface %p.\n", iface);
return WINED3D_OK;
return ((struct wined3d_rendertarget_view *)iface)->parent;
}
/* IWineD3DRendertargetView methods */
......@@ -110,7 +107,7 @@ static const struct IWineD3DRendertargetViewVtbl wined3d_rendertarget_view_vtbl
};
void wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view,
IWineD3DResource *resource, IUnknown *parent)
IWineD3DResource *resource, void *parent)
{
view->vtbl = &wined3d_rendertarget_view_vtbl;
view->refcount = 1;
......
......@@ -139,8 +139,11 @@ static ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) {
/* ****************************************************
IWineD3DVolume IWineD3DResource parts follow
**************************************************** */
static HRESULT WINAPI IWineD3DVolumeImpl_GetParent(IWineD3DVolume *iface, IUnknown **pParent) {
return resource_get_parent((IWineD3DResource *)iface, pParent);
static void * WINAPI IWineD3DVolumeImpl_GetParent(IWineD3DVolume *iface)
{
TRACE("iface %p.\n", iface);
return ((IWineD3DVolumeImpl *)iface)->resource.parent;
}
static HRESULT WINAPI IWineD3DVolumeImpl_SetPrivateData(IWineD3DVolume *iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
......@@ -325,7 +328,7 @@ static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT width,
UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
......
......@@ -186,8 +186,11 @@ static WINED3DRESOURCETYPE WINAPI IWineD3DVolumeTextureImpl_GetType(IWineD3DVolu
return resource_get_type((IWineD3DResource *)iface);
}
static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetParent(IWineD3DVolumeTexture *iface, IUnknown **pParent) {
return resource_get_parent((IWineD3DResource *)iface, pParent);
static void * WINAPI IWineD3DVolumeTextureImpl_GetParent(IWineD3DVolumeTexture *iface)
{
TRACE("iface %p\n", iface);
return ((IWineD3DVolumeTextureImpl *)iface)->resource.parent;
}
/* ******************************************************
......@@ -385,7 +388,7 @@ static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT height,
UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
......
......@@ -76,7 +76,7 @@ wined3d_settings_t wined3d_settings =
FALSE, /* No strict draw ordering. */
};
IWineD3D * WINAPI WineDirect3DCreate(UINT version, IUnknown *parent)
IWineD3D * WINAPI WineDirect3DCreate(UINT version, void *parent)
{
IWineD3DImpl *object;
HRESULT hr;
......
......@@ -2178,8 +2178,7 @@ typedef HRESULT (__stdcall *D3DCB_ENUMRESOURCES)(IWineD3DResource *resource, voi
]
interface IWineD3DBase : IUnknown
{
HRESULT GetParent(
[out] IUnknown **parent
void *GetParent(
);
}
......@@ -2797,7 +2796,7 @@ interface IWineD3DDevice : IUnknown
HRESULT CreateBuffer(
[in] struct wined3d_buffer_desc *desc,
[in] const void *data,
[in] IUnknown *parent,
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DBuffer **buffer
);
......@@ -2805,17 +2804,17 @@ interface IWineD3DDevice : IUnknown
[in] UINT length,
[in] DWORD usage,
[in] WINED3DPOOL pool,
[out] IWineD3DBuffer **vertex_buffer,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DBuffer **vertex_buffer
);
HRESULT CreateIndexBuffer(
[in] UINT length,
[in] DWORD usage,
[in] WINED3DPOOL pool,
[out] IWineD3DBuffer **index_buffer,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DBuffer **index_buffer
);
HRESULT CreateStateBlock(
[in] WINED3DSTATEBLOCKTYPE type,
......@@ -2828,18 +2827,18 @@ interface IWineD3DDevice : IUnknown
[in] BOOL lockable,
[in] BOOL discard,
[in] UINT level,
[out] IWineD3DSurface **surface,
[in] DWORD usage,
[in] WINED3DPOOL pool,
[in] WINED3DMULTISAMPLE_TYPE multisample_type,
[in] DWORD multisample_quality,
[in] WINED3DSURFTYPE surface_type,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DSurface **surface
);
HRESULT CreateRendertargetView(
[in] IWineD3DResource *resource,
[in] IUnknown *parent,
[in] void *parent,
[out] IWineD3DRendertargetView **rendertarget_view
);
HRESULT CreateTexture(
......@@ -2849,9 +2848,9 @@ interface IWineD3DDevice : IUnknown
[in] DWORD usage,
[in] enum wined3d_format_id format_id,
[in] WINED3DPOOL pool,
[out] IWineD3DTexture **texture,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DTexture **texture
);
HRESULT CreateVolumeTexture(
[in] UINT width,
......@@ -2861,9 +2860,9 @@ interface IWineD3DDevice : IUnknown
[in] DWORD usage,
[in] enum wined3d_format_id format_id,
[in] WINED3DPOOL pool,
[out] IWineD3DVolumeTexture **texture,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DVolumeTexture **texture
);
HRESULT CreateVolume(
[in] UINT width,
......@@ -2872,9 +2871,9 @@ interface IWineD3DDevice : IUnknown
[in] DWORD usage,
[in] enum wined3d_format_id format_id,
[in] WINED3DPOOL pool,
[out] IWineD3DVolume **volume,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DVolume **volume
);
HRESULT CreateCubeTexture(
[in] UINT edge_length,
......@@ -2882,9 +2881,9 @@ interface IWineD3DDevice : IUnknown
[in] DWORD usage,
[in] enum wined3d_format_id format_id,
[in] WINED3DPOOL pool,
[out] IWineD3DCubeTexture **texture,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DCubeTexture **texture
);
HRESULT CreateQuery(
[in] WINED3DQUERYTYPE type,
......@@ -2892,49 +2891,49 @@ interface IWineD3DDevice : IUnknown
);
HRESULT CreateSwapChain(
[in] WINED3DPRESENT_PARAMETERS *present_parameters,
[out] IWineD3DSwapChain **swapchain,
[in] IUnknown *parent,
[in] WINED3DSURFTYPE surface_type
[in] WINED3DSURFTYPE surface_type,
[in] void *parent,
[out] IWineD3DSwapChain **swapchain
);
HRESULT CreateVertexDeclaration(
[out] IWineD3DVertexDeclaration **declaration,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[in] const WINED3DVERTEXELEMENT *elements,
[in] UINT element_count
[in] UINT element_count,
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DVertexDeclaration **declaration
);
HRESULT CreateVertexDeclarationFromFVF(
[out] IWineD3DVertexDeclaration **declaration,
[in] IUnknown *parent,
[in] DWORD fvf,
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[in] DWORD fvf
[out] IWineD3DVertexDeclaration **declaration
);
HRESULT CreateVertexShader(
[in] const DWORD *function,
[in] const struct wined3d_shader_signature *output_signature,
[out] IWineD3DVertexShader **shader,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DVertexShader **shader
);
HRESULT CreateGeometryShader(
[in] const DWORD *byte_code,
[in] const struct wined3d_shader_signature *output_signature,
[out] IWineD3DGeometryShader **shader,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DGeometryShader **shader
);
HRESULT CreatePixelShader(
[in] const DWORD *function,
[in] const struct wined3d_shader_signature *output_signature,
[out] IWineD3DPixelShader **shader,
[in] IUnknown *parent,
[in] const struct wined3d_parent_ops *parent_ops
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DPixelShader **shader
);
HRESULT CreatePalette(
[in] DWORD flags,
[in] const PALETTEENTRY *palette_entry,
[out] IWineD3DPalette **palette,
[in] IUnknown *parent
[in] void *parent,
[out] IWineD3DPalette **palette
);
HRESULT Init3D(
[in] WINED3DPRESENT_PARAMETERS *present_parameters
......@@ -3388,7 +3387,7 @@ interface IWineD3DDevice : IUnknown
);
}
IWineD3D * __stdcall WineDirect3DCreate(UINT dxVersion, IUnknown *parent);
IWineD3D * __stdcall WineDirect3DCreate(UINT dxVersion, void *parent);
IWineD3DClipper * __stdcall WineDirect3DCreateClipper(void);
void __stdcall wined3d_mutex_lock(void);
void __stdcall wined3d_mutex_unlock(void);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment