https://git.reactos.org/?p=reactos.git;a=commitdiff;h=62f40620f15da1b9be56a…
commit 62f40620f15da1b9be56ac6d8289501a38a01e05
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Tue Jan 5 13:16:41 2021 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Thu Feb 4 16:37:07 2021 +0100
[WINESYNC] d3dx9_36: Improve stub for ID3DXEffectImpl_CloneEffect.
wine-staging patch by Sebastian Lackner <sebastian(a)fds-team.de>
---
dll/directx/wine/d3dx9_36/effect.c | 4 +-
modules/rostests/winetests/d3dx9_36/effect.c | 16 ++-----
...prove_stub_for_ID3DXEffectImpl_CloneEffect.diff | 54 ++++++++++++++++++++++
3 files changed, 62 insertions(+), 12 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c
index 54d44341a24..9af899ce3b3 100644
--- a/dll/directx/wine/d3dx9_36/effect.c
+++ b/dll/directx/wine/d3dx9_36/effect.c
@@ -4313,7 +4313,9 @@ static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface,
IDirect3DDevic
if (!device)
return D3DERR_INVALIDCALL;
- return E_NOTIMPL;
+ iface->lpVtbl->AddRef(iface);
+ *new_effect = iface;
+ return S_OK;
}
#if D3DX_SDK_VERSION >= 27
diff --git a/modules/rostests/winetests/d3dx9_36/effect.c
b/modules/rostests/winetests/d3dx9_36/effect.c
index d96f70351ec..2434bc76b30 100644
--- a/modules/rostests/winetests/d3dx9_36/effect.c
+++ b/modules/rostests/winetests/d3dx9_36/effect.c
@@ -7434,29 +7434,23 @@ static void test_effect_clone(void)
ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
-todo_wine
ok(hr == D3D_OK, "Got result %#x.\n", hr);
-if (hr == D3D_OK)
-{
- ok(cloned != effect, "Expected new effect instance.\n");
+
+ todo_wine ok(cloned != effect, "Expected new effect instance.\n");
cloned->lpVtbl->Release(cloned);
-}
/* Try with different device. */
device2 = create_device(&window2);
hr = effect->lpVtbl->CloneEffect(effect, device2, &cloned);
-todo_wine
ok(hr == D3D_OK, "Got result %#x.\n", hr);
-if (hr == D3D_OK)
-{
- ok(cloned != effect, "Expected new effect instance.\n");
+ todo_wine ok(cloned != effect, "Expected new effect instance.\n");
hr = cloned->lpVtbl->GetDevice(cloned, &device3);
ok(hr == S_OK, "Failed to get effect device.\n");
- ok(device3 == device2, "Unexpected device instance.\n");
+ todo_wine ok(device3 == device2, "Unexpected device instance, device3 %p,
device2 %p.\n", device3, device2);
IDirect3DDevice9_Release(device3);
cloned->lpVtbl->Release(cloned);
-}
+
IDirect3DDevice9_Release(device2);
DestroyWindow(window2);
effect->lpVtbl->Release(effect);
diff --git
a/sdk/tools/winesync/d3dx9_staging/0003-d3dx9_36__Improve_stub_for_ID3DXEffectImpl_CloneEffect.diff
b/sdk/tools/winesync/d3dx9_staging/0003-d3dx9_36__Improve_stub_for_ID3DXEffectImpl_CloneEffect.diff
new file mode 100644
index 00000000000..85971d79dc3
--- /dev/null
+++
b/sdk/tools/winesync/d3dx9_staging/0003-d3dx9_36__Improve_stub_for_ID3DXEffectImpl_CloneEffect.diff
@@ -0,0 +1,54 @@
+diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c
+index 710e999..d57b182 100644
+--- a/dll/directx/wine/d3dx9_36/effect.c
++++ b/dll/directx/wine/d3dx9_36/effect.c
+@@ -4309,7 +4309,9 @@ static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface,
IDirect3DDevic
+ if (!device)
+ return D3DERR_INVALIDCALL;
+
+- return E_NOTIMPL;
++ iface->lpVtbl->AddRef(iface);
++ *new_effect = iface;
++ return S_OK;
+ }
+
+ #if D3DX_SDK_VERSION >= 27
+diff --git a/modules/rostests/winetests/d3dx9_36/effect.c
b/modules/rostests/winetests/d3dx9_36/effect.c
+index ae6f65d..1b5c944 100644
+--- a/modules/rostests/winetests/d3dx9_36/effect.c
++++ b/modules/rostests/winetests/d3dx9_36/effect.c
+@@ -7419,29 +7419,23 @@ static void test_effect_clone(void)
+ ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);
+
+ hr = effect->lpVtbl->CloneEffect(effect, device, &cloned);
+-todo_wine
+ ok(hr == D3D_OK, "Got result %#x.\n", hr);
+-if (hr == D3D_OK)
+-{
+- ok(cloned != effect, "Expected new effect instance.\n");
++
++ todo_wine ok(cloned != effect, "Expected new effect instance.\n");
+ cloned->lpVtbl->Release(cloned);
+-}
+ /* Try with different device. */
+ device2 = create_device(&window2);
+ hr = effect->lpVtbl->CloneEffect(effect, device2, &cloned);
+-todo_wine
+ ok(hr == D3D_OK, "Got result %#x.\n", hr);
+-if (hr == D3D_OK)
+-{
+- ok(cloned != effect, "Expected new effect instance.\n");
++ todo_wine ok(cloned != effect, "Expected new effect instance.\n");
+
+ hr = cloned->lpVtbl->GetDevice(cloned, &device3);
+ ok(hr == S_OK, "Failed to get effect device.\n");
+- ok(device3 == device2, "Unexpected device instance.\n");
++ todo_wine ok(device3 == device2, "Unexpected device instance, device3 %p,
device2 %p.\n", device3, device2);
+ IDirect3DDevice9_Release(device3);
+
+ cloned->lpVtbl->Release(cloned);
+-}
++
+ IDirect3DDevice9_Release(device2);
+ DestroyWindow(window2);
+ effect->lpVtbl->Release(effect);