On 6/12/22 08:31, Ziqing Hui wrote:
- 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; }
This is short enough, it doesn't have to use gotos.