From: Stian Low <wineryyyyy@gmail.com> --- dlls/d3d11/device.c | 14 ++++++++++++-- dlls/dxgi/resource.c | 18 +++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index e1a846698e6..d4a42471be6 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -4594,8 +4594,18 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device5 *iface, HANDLE resource, REFIID iid, void **out) { - FIXME("iface %p, resource %p, iid %s, out %p stub!\n", iface, resource, debugstr_guid(iid), out); - + TRACE("iface %p, resource %p, iid %s, out %p stub!\n", iface, resource, debugstr_guid(iid), out); +#if 000 + if (IsEqualGUID(iid, &IID_ID3D11Texture2D)) + { + return ID3D11Texture2D_QueryInterface(resource, iid, out); + } + else if (IsEqualGUID(iid, &IID_IDXGIResource)) + { + return ID3D11ShaderResourceView_QueryInterface(resource, iid, out); + } +#endif + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); return E_NOTIMPL; } diff --git a/dlls/dxgi/resource.c b/dlls/dxgi/resource.c index 67921de005b..884ea237cb5 100644 --- a/dlls/dxgi/resource.c +++ b/dlls/dxgi/resource.c @@ -385,9 +385,14 @@ static HRESULT STDMETHODCALLTYPE dxgi_resource_GetDevice(IDXGIResource1 *iface, /* IDXGIResource methods */ static HRESULT STDMETHODCALLTYPE dxgi_resource_GetSharedHandle(IDXGIResource1 *iface, HANDLE *shared_handle) { +#if 0001 FIXME("iface %p, shared_handle %p stub!\n", iface, shared_handle); - return E_NOTIMPL; +#elif 001 + DWORD access_rights = DXGI_SHARED_RESOURCE_READ | DXGI_SHARED_RESOURCE_WRITE; + TRACE("iface %p, shared_handle %p stub!\n", iface, shared_handle); + return IDXGIResource1_CreateSharedHandle(iface, NULL, access_rights, NULL, shared_handle); +#endif } static HRESULT STDMETHODCALLTYPE dxgi_resource_GetUsage(IDXGIResource1 *iface, DXGI_USAGE *usage) @@ -478,10 +483,17 @@ static HRESULT STDMETHODCALLTYPE dxgi_resource_CreateSubresourceSurface(IDXGIRes static HRESULT STDMETHODCALLTYPE dxgi_resource_CreateSharedHandle(IDXGIResource1 *iface, const SECURITY_ATTRIBUTES *attributes, DWORD access, const WCHAR *name, HANDLE *handle) { +#if 001 FIXME("iface %p, attributes %p, access %#lx, name %s, handle %p stub!\n", iface, attributes, - access, wine_dbgstr_w(name), handle); - + access, wine_dbgstr_w(name), handle); return E_NOTIMPL; +#elif 001 + struct dxgi_resource *resource = impl_from_IDXGIResource1(iface); + FIXME("iface %p, attributes %p, access %#lx, name %s, handle %p stub!\n", iface, attributes, + access, wine_dbgstr_w(name), handle); + *handle = resource->outer_unknown; + return S_OK; +#endif } static const struct IDXGIResource1Vtbl dxgi_resource_vtbl = -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11404