Signed-off-by: Ziqing Hui zhui@codeweavers.com ---
v2: Write then seek.
dlls/d2d1/factory.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index 0bffae15ff6..31bad2cdb63 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -937,10 +937,28 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromString(ID2D1Facto REFCLSID effect_id, const WCHAR *property_xml, const D2D1_PROPERTY_BINDING *bindings, UINT32 binding_count, PD2D1_EFFECT_FACTORY effect_factory) { - FIXME("iface %p, effect_id %s, property_xml %s, bindings %p, binding_count %u, effect_factory %p stub!\n", - iface, debugstr_guid(effect_id), debugstr_w(property_xml), bindings, binding_count, effect_factory); + static const LARGE_INTEGER zero; + IStream *stream; + ULONG size; + HRESULT hr;
- return S_OK; + TRACE("iface %p, effect_id %s, property_xml %s, bindings %p, binding_count %u, effect_factory %p.\n", + iface, debugstr_guid(effect_id), debugstr_w(property_xml), bindings, binding_count, effect_factory); + + if (FAILED(hr = CreateStreamOnHGlobal(NULL, TRUE, &stream))) + return hr; + + size = sizeof(*property_xml) * (wcslen(property_xml) + 1); + if (FAILED(hr = IStream_Write(stream, property_xml, size, NULL))) + goto done; + if (FAILED(hr = IStream_Seek(stream, zero, SEEK_SET, NULL))) + goto done; + + hr = ID2D1Factory3_RegisterEffectFromStream(iface, effect_id, stream, bindings, binding_count, effect_factory); + +done: + IStream_Release(stream); + return hr; }
static HRESULT STDMETHODCALLTYPE d2d_factory_UnregisterEffect(ID2D1Factory3 *iface, REFCLSID effect_id)