Nikolay Sivov (@nsivov) commented about dlls/d2d1/d2d1_private.h:
const struct d2d_device_context_ops *ops; ID2D1Factory *factory;
- struct d2d_factory *factory_impl;
That's not what I meant. Keep a single 'struct d2d_factory *factory' field and use it for everything. Then have enter/leave inline helpers called unconditionally, and check some factory type flag in there. Once we have 'struct d2d_factory *' pointer we don't need to go through public API to get multithreaded interface, and so on.