Signed-off-by: Ziqing Hui zhui@codeweavers.com ---
v2: Make factroy_iid array "static const GUID *const".
dlls/d2d1/tests/d2d1.c | 49 ++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 16 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index ca80a8e946b..bc879064814 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -9955,6 +9955,36 @@ static void test_mt_factory(BOOL d3d11) ID2D1Factory_Release(factory); }
+static void *create_factory(const GUID *iid, UINT32 *factory_version) +{ + IUnknown *factory, *tmp; + unsigned int i; + + static const GUID *const factory_iid[] = + { + &IID_ID2D1Factory, + &IID_ID2D1Factory1, + &IID_ID2D1Factory2, + &IID_ID2D1Factory3, + }; + + if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, iid, NULL, (void **)&factory))) + return NULL; + + if (factory_version) + { + for (i = 0; i < ARRAY_SIZE(factory_iid); ++i) + { + if (FAILED(IUnknown_QueryInterface(factory, factory_iid[i], (void **)&tmp))) + break; + IUnknown_Release(tmp); + } + *factory_version = i - 1; + } + + return factory; +} + static void test_effect(BOOL d3d11) { unsigned int i, j, min_inputs, max_inputs, str_size, input_count, factory_version; @@ -9963,9 +9993,7 @@ static void test_effect(BOOL d3d11) ID2D1Image *image_a, *image_b; struct d2d1_test_context ctx; ID2D1DeviceContext *context; - ID2D1Factory1 *factory1; - ID2D1Factory2 *factory2; - ID2D1Factory3 *factory3; + ID2D1Factory1 *factory; ID2D1Bitmap *bitmap; ID2D1Effect *effect; D2D1_SIZE_U size; @@ -9995,23 +10023,12 @@ static void test_effect(BOOL d3d11) if (!init_test_context(&ctx, d3d11)) return;
- if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory1))) + if (!(factory = create_factory(&IID_ID2D1Factory1, &factory_version))) { win_skip("ID2D1Factory1 is not supported.\n"); release_test_context(&ctx); return; } - factory_version = 1; - if (SUCCEEDED(ID2D1Factory1_QueryInterface(factory1, &IID_ID2D1Factory2, (void **)&factory2))) - { - ID2D1Factory2_Release(factory2); - factory_version = 2; - } - if (SUCCEEDED(ID2D1Factory1_QueryInterface(factory1, &IID_ID2D1Factory3, (void **)&factory3))) - { - ID2D1Factory3_Release(factory3); - factory_version = 3; - } if (factory_version < 3) win_skip("ID2D1Factory%u is not supported.\n", factory_version + 1);
@@ -10161,7 +10178,7 @@ static void test_effect(BOOL d3d11) }
ID2D1DeviceContext_Release(context); - ID2D1Factory1_Release(factory1); + ID2D1Factory1_Release(factory); release_test_context(&ctx); }
Signed-off-by: Ziqing Hui zhui@codeweavers.com ---
V2: Add more effect xml. Make propery binding tests in a loop. Remove some todo_wine.
dlls/d2d1/tests/d2d1.c | 295 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 295 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index bc879064814..26a82886fe5 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -25,10 +25,72 @@ #include "wincrypt.h" #include "wine/test.h" #include "initguid.h" +#include "d2d1effectauthor.h" #include "dwrite.h" #include "wincodec.h" #include "wine/heap.h"
+DEFINE_GUID(CLSID_TestEffect, 0xb9ee12e9,0x32d9,0xe659,0xac,0x61,0x2d,0x7c,0xea,0x69,0x28,0x78); + +#define EFFECT_XML(x) L###x + +static const WCHAR *effect_xml_a = EFFECT_XML +( + <?xml version='1.0'?> + <Effect> + <Property name='DisplayName' type='string' value='TestEffect'/> + <Property name='Author' type='string' value='The Wine Project'/> + <Property name='Category' type='string' value='Test'/> + <Property name='Description' type='string' value='Test effect.'/> + <Inputs> + <Input name='Source'/> + </Inputs> + <Property name='Integer' type='uint32'> + <Property name='DisplayName' type='string' value='Integer'/> + <Property name='Min' type='uint32' value='0'/> + <Property name='Max' type='uint32' value='100'/> + <Property name='Default' type='uint32' value='10'/> + </Property> + </Effect> +); + +static const WCHAR *effect_xml_b = EFFECT_XML +( + <?xml version='1.0'?> + <Effect> + <Property name='DisplayName' type='string' value='TestEffect'/> + <Property name='Author' type='string' value='The Wine Project'/> + <Property name='Category' type='string' value='Test'/> + <Property name='Description' type='string' value='Test effect.'/> + <Inputs> + <Input name='Source'/> + </Inputs> + <Property name='Context' type='iunknown'> + <Property name='DisplayName' type='string' value='Context'/> + </Property> + </Effect> +); + +static const WCHAR *effect_xml_c = EFFECT_XML +( + <?xml version='1.0'?> + <Effect> + <Property name='DisplayName' type='string' value='TestEffect'/> + <Property name='Author' type='string' value='The Wine Project'/> + <Property name='Category' type='string' value='Test'/> + <Property name='Description' type='string' value='Test effect.'/> + <Inputs> + <Input name='Source'/> + </Inputs> + <Property name='Context' type='iunknown'> + <Property name='DisplayName' type='string' value='Context'/> + </Property> + <Property name='Integer' type='uint32'> + <Property name='DisplayName' type='string' value='Integer'/> + </Property> + </Effect> +); + static HRESULT (WINAPI *pD2D1CreateDevice)(IDXGIDevice *dxgi_device, const D2D1_CREATION_PROPERTIES *properties, ID2D1Device **device); static void (WINAPI *pD2D1SinCos)(float angle, float *s, float *c); @@ -118,6 +180,14 @@ struct expected_geometry_figure const struct geometry_segment *segments; };
+struct effect_impl +{ + ID2D1EffectImpl ID2D1EffectImpl_iface; + LONG refcount; + UINT integer; + ID2D1EffectContext *effect_context; +}; + static void queue_d3d1x_test(void (*test)(BOOL d3d11), BOOL d3d11) { if (mt_test_count >= mt_tests_size) @@ -10182,6 +10252,230 @@ static void test_effect(BOOL d3d11) release_test_context(&ctx); }
+static inline struct effect_impl *impl_from_ID2D1EffectImpl(ID2D1EffectImpl *iface) +{ + return CONTAINING_RECORD(iface, struct effect_impl, ID2D1EffectImpl_iface); +} + +static HRESULT STDMETHODCALLTYPE effect_impl_QueryInterface(ID2D1EffectImpl *iface, REFIID iid, void **out) +{ + if (IsEqualGUID(iid, &IID_ID2D1EffectImpl) + || IsEqualGUID(iid, &IID_IUnknown)) + { + *out = iface; + return S_OK; + } + + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE effect_impl_AddRef(ID2D1EffectImpl *iface) +{ + struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl(iface); + ULONG refcount = InterlockedIncrement(&effect_impl->refcount); + return refcount; +} + +static ULONG STDMETHODCALLTYPE effect_impl_Release(ID2D1EffectImpl *iface) +{ + struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl(iface); + ULONG refcount = InterlockedDecrement(&effect_impl->refcount); + return refcount; +} + +static HRESULT STDMETHODCALLTYPE effect_impl_Initialize(ID2D1EffectImpl *iface, + ID2D1EffectContext *context,ID2D1TransformGraph *graph) +{ + struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl(iface); + effect_impl->effect_context = context; + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE effect_impl_PrepareForRender(ID2D1EffectImpl *iface, D2D1_CHANGE_TYPE type) +{ + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE effect_impl_SetGraph(ID2D1EffectImpl *iface, ID2D1TransformGraph *graph) +{ + return E_NOTIMPL; +} + +static const ID2D1EffectImplVtbl effect_impl_vtbl = +{ + effect_impl_QueryInterface, + effect_impl_AddRef, + effect_impl_Release, + effect_impl_Initialize, + effect_impl_PrepareForRender, + effect_impl_SetGraph, +}; + +static HRESULT STDMETHODCALLTYPE effect_impl_create(IUnknown **effect_impl) +{ + struct effect_impl *object; + + if (!(object = heap_alloc(sizeof(*object)))) + return E_OUTOFMEMORY; + + object->ID2D1EffectImpl_iface.lpVtbl = &effect_impl_vtbl; + object->refcount = 1; + + *effect_impl = (IUnknown *)&object->ID2D1EffectImpl_iface; + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE effect_impl_set_integer(IUnknown *iface, const BYTE *data, UINT32 data_size) +{ + struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl((ID2D1EffectImpl *)iface); + + if (!data || data_size != sizeof(effect_impl->integer)) + return E_INVALIDARG; + + effect_impl->integer = *((UINT *)data); + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE effect_impl_get_integer(const IUnknown *iface, + BYTE *data, UINT32 data_size, UINT32 *actual_size) +{ + struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl((ID2D1EffectImpl *)iface); + + if (!data || data_size != sizeof(effect_impl->integer)) + return E_INVALIDARG; + + *((UINT *)data) = effect_impl->integer; + if (actual_size) + *actual_size = sizeof(effect_impl->integer); + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE effect_impl_get_context(const IUnknown *iface, + BYTE *data, UINT32 data_size, UINT32 *actual_size) +{ + struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl((ID2D1EffectImpl *)iface); + + if (!data || data_size != sizeof(effect_impl->effect_context)) + return E_INVALIDARG; + + *((ID2D1EffectContext **)data) = effect_impl->effect_context; + if (actual_size) + *actual_size = sizeof(effect_impl->effect_context); + + return S_OK; +} + +static void test_effect_register(BOOL d3d11) +{ + struct d2d1_test_context ctx; + ID2D1Factory1 *factory; + unsigned int i; + HRESULT hr; + + const D2D1_PROPERTY_BINDING binding[] = + { + {L"Integer", effect_impl_set_integer, effect_impl_get_integer}, + {L"Context", NULL, effect_impl_get_context}, + {L"Integer", NULL, effect_impl_get_integer}, + {L"Integer", effect_impl_set_integer, NULL}, + {L"Integer", NULL, NULL}, + {L"DeadBeef", effect_impl_set_integer, effect_impl_get_integer}, + }; + + const struct binding_test + { + const D2D1_PROPERTY_BINDING *binding; + UINT32 binding_count; + const WCHAR *effect_xml; + HRESULT hr; + } + binding_tests[] = + { + {NULL, 0, effect_xml_a, S_OK}, + {NULL, 0, effect_xml_b, S_OK}, + {binding, 1, effect_xml_a, S_OK}, + {binding, 1, effect_xml_b, D2DERR_INVALID_PROPERTY}, + {binding + 1, 1, effect_xml_b, S_OK}, + {binding + 2, 1, effect_xml_a, S_OK}, + {binding + 3, 1, effect_xml_a, S_OK}, + {binding + 4, 1, effect_xml_a, S_OK}, + {binding + 5, 1, effect_xml_a, D2DERR_INVALID_PROPERTY}, + {binding, 2, effect_xml_a, D2DERR_INVALID_PROPERTY}, + {binding, 2, effect_xml_b, D2DERR_INVALID_PROPERTY}, + {binding, 2, effect_xml_c, S_OK}, + }; + + if (!init_test_context(&ctx, d3d11)) + return; + + if (!(factory = create_factory(&IID_ID2D1Factory1, NULL))) + { + win_skip("ID2D1Factory1 is not supported.\n"); + release_test_context(&ctx); + return; + } + + /* Register effect once */ + hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, + effect_xml_a, NULL, 0, effect_impl_create); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr); + + /* Register effect multiple times */ + hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, + effect_xml_a, NULL, 0, effect_impl_create); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, + effect_xml_a, NULL, 0, effect_impl_create); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr); + + /* Register effect multiple times with different xml */ + hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, + effect_xml_a, NULL, 0, effect_impl_create); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, + effect_xml_b, NULL, 0, effect_impl_create); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + /* Register effect with property binding */ + for (i = 0; i < ARRAY_SIZE(binding_tests); ++i) + { + const struct binding_test *test = &binding_tests[i]; + winetest_push_context("Test %u", i); + + hr = ID2D1Factory1_RegisterEffectFromString(factory, &CLSID_TestEffect, + test->effect_xml, test->binding, test->binding_count, effect_impl_create); + todo_wine_if(test->hr != S_OK) + ok(hr == test->hr, "Got unexpected hr %#lx, expected %#lx.\n", hr, test->hr); + ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); + + winetest_pop_context(); + } + + /* Unregister builtin effect */ + hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_D2D1Composite); + todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr); + + ID2D1Factory1_Release(factory); + release_test_context(&ctx); +} + static void test_effect_2d_affine(BOOL d3d11) { D2D1_MATRIX_3X2_F rotate, scale, skew; @@ -10973,6 +11267,7 @@ START_TEST(d2d1) queue_d3d10_test(test_colour_space); queue_test(test_geometry_group); queue_test(test_mt_factory); + queue_test(test_effect_register); queue_test(test_effect); queue_test(test_effect_2d_affine); queue_test(test_effect_crop);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=114884
Your paranoid android.
=== build (build log) ===
../wine/include/windef.h:130:30: error: unknown type name ‘do_not_use_this_in_wine’ /usr/share/mingw-w64/include/d2d1effectauthor.h:105:18: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token ../wine/include/windef.h:130:30: error: unknown type name ‘do_not_use_this_in_wine’ /usr/share/mingw-w64/include/d2d1effectauthor.h:124:16: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token ../wine/include/windef.h:130:30: error: unknown type name ‘do_not_use_this_in_wine’ /usr/share/mingw-w64/include/d2d1effectauthor.h:129:16: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:154:29: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:172:32: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:190:27: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:210:25: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:233:30: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:250:26: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:271:30: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:288:31: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:313:34: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:331:31: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:349:32: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:369:32: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:387:42: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:405:30: error: expected identifier or ‘(’ before ‘:’ token /usr/share/mingw-w64/include/d2d1effectauthor.h:445:27: error: expected identifier or ‘(’ before ‘:’ token ../wine/dlls/d2d1/tests/d2d1.c:185:5: error: unknown type name ‘ID2D1EffectImpl’ ../wine/dlls/d2d1/tests/d2d1.c:188:5: error: unknown type name ‘ID2D1EffectContext’ ../wine/dlls/d2d1/tests/d2d1.c:10369:61: error: unknown type name ‘ID2D1EffectImpl’ ../wine/dlls/d2d1/tests/d2d1.c:10374:61: error: unknown type name ‘ID2D1EffectImpl’ ../wine/dlls/d2d1/tests/d2d1.c:10387:51: error: unknown type name ‘ID2D1EffectImpl’ ../wine/dlls/d2d1/tests/d2d1.c:10394:52: error: unknown type name ‘ID2D1EffectImpl’ ../wine/dlls/d2d1/tests/d2d1.c:10401:57: error: unknown type name ‘ID2D1EffectImpl’ ../wine/dlls/d2d1/tests/d2d1.c:10402:9: error: unknown type name ‘ID2D1EffectContext’ ../wine/dlls/d2d1/tests/d2d1.c:10402:37: error: unknown type name ‘ID2D1TransformGraph’ ../wine/dlls/d2d1/tests/d2d1.c:10409:63: error: unknown type name ‘ID2D1EffectImpl’ ../wine/dlls/d2d1/tests/d2d1.c:10414:55: error: unknown type name ‘ID2D1EffectImpl’ ../wine/dlls/d2d1/tests/d2d1.c:10414:79: error: unknown type name ‘ID2D1TransformGraph’ ../wine/dlls/d2d1/tests/d2d1.c:10419:14: error: unknown type name ‘ID2D1EffectImplVtbl’ ../wine/dlls/d2d1/tests/d2d1.c:10421:5: error: ‘effect_impl_QueryInterface’ undeclared here (not in a function) ../wine/dlls/d2d1/tests/d2d1.c:10422:5: error: ‘effect_impl_AddRef’ undeclared here (not in a function) ../wine/dlls/d2d1/tests/d2d1.c:10423:5: error: ‘effect_impl_Release’ undeclared here (not in a function) ../wine/dlls/d2d1/tests/d2d1.c:10424:5: error: ‘effect_impl_Initialize’ undeclared here (not in a function) ../wine/dlls/d2d1/tests/d2d1.c:10425:5: error: ‘effect_impl_PrepareForRender’ undeclared here (not in a function) ../wine/dlls/d2d1/tests/d2d1.c:10426:5: error: ‘effect_impl_SetGraph’ undeclared here (not in a function) ../wine/dlls/d2d1/tests/d2d1.c:10436:34: error: request for member ‘lpVtbl’ in something not a structure or union ../wine/dlls/d2d1/tests/d2d1.c:10445:66: error: ‘ID2D1EffectImpl’ undeclared (first use in this function) ../wine/dlls/d2d1/tests/d2d1.c:10445:83: error: expected expression before ‘)’ token ../wine/dlls/d2d1/tests/d2d1.c:10458:66: error: ‘ID2D1EffectImpl’ undeclared (first use in this function) ../wine/dlls/d2d1/tests/d2d1.c:10458:83: error: expected expression before ‘)’ token ../wine/dlls/d2d1/tests/d2d1.c:10473:66: error: ‘ID2D1EffectImpl’ undeclared (first use in this function) ../wine/dlls/d2d1/tests/d2d1.c:10473:83: error: expected expression before ‘)’ token ../wine/dlls/d2d1/tests/d2d1.c:10478:8: error: ‘ID2D1EffectContext’ undeclared (first use in this function) ../wine/dlls/d2d1/tests/d2d1.c:10478:29: error: expected expression before ‘)’ token Makefile:16608: recipe for target 'dlls/d2d1/tests/d2d1.cross.o' failed Task: The exe32 Wine build failed
=== debian11 (64 bit WoW report) ===
d2d1: d2d1: Timeout
On 5/17/22 08:00, Ziqing Hui wrote:
@@ -25,10 +25,72 @@ #include "wincrypt.h" #include "wine/test.h" #include "initguid.h" +#include "d2d1effectauthor.h" #include "dwrite.h" #include "wincodec.h" #include "wine/heap.h"
d2d1effectauthor.h should go to uuid, so you don't need to initguid it here.
+#define EFFECT_XML(x) L###x
+static const WCHAR *effect_xml_a = EFFECT_XML +(
<?xml version='1.0'?>
<Effect>
<Property name='DisplayName' type='string' value='TestEffect'/>
<Property name='Author' type='string' value='The Wine Project'/>
<Property name='Category' type='string' value='Test'/>
<Property name='Description' type='string' value='Test effect.'/>
<Inputs>
<Input name='Source'/>
</Inputs>
<Property name='Integer' type='uint32'>
<Property name='DisplayName' type='string' value='Integer'/>
<Property name='Min' type='uint32' value='0'/>
<Property name='Max' type='uint32' value='100'/>
<Property name='Default' type='uint32' value='10'/>
</Property>
</Effect>
+);
I personally don't like macro tricks for this. It believe this should work with regular L"", and "" and the end of the lines.
+static HRESULT STDMETHODCALLTYPE effect_impl_QueryInterface(ID2D1EffectImpl *iface, REFIID iid, void **out) +{
- if (IsEqualGUID(iid, &IID_ID2D1EffectImpl)
|| IsEqualGUID(iid, &IID_IUnknown))
- {
*out = iface;
return S_OK;
- }
- *out = NULL;
- return E_NOINTERFACE;
+}
This is an allocated test effect, so it should addref here,
+static ULONG STDMETHODCALLTYPE effect_impl_Release(ID2D1EffectImpl *iface) +{
- struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl(iface);
- ULONG refcount = InterlockedDecrement(&effect_impl->refcount);
- return refcount;
+}
...release here...
+static HRESULT STDMETHODCALLTYPE effect_impl_Initialize(ID2D1EffectImpl *iface,
ID2D1EffectContext *context,ID2D1TransformGraph *graph)
+{
- struct effect_impl *effect_impl = impl_from_ID2D1EffectImpl(iface);
- effect_impl->effect_context = context;
- return S_OK;
+}
...addref here..
+static HRESULT STDMETHODCALLTYPE effect_impl_create(IUnknown **effect_impl) +{
- struct effect_impl *object;
- if (!(object = heap_alloc(sizeof(*object))))
return E_OUTOFMEMORY;
- object->ID2D1EffectImpl_iface.lpVtbl = &effect_impl_vtbl;
- object->refcount = 1;
- *effect_impl = (IUnknown *)&object->ID2D1EffectImpl_iface;
- return S_OK;
+}
and fully initialize here.