On Wed Jun 21 12:48:58 2023 +0000, Bernhard Kölbl wrote:
About this cs, would something like this work out?
static struct synthesizer_statics synthesizer_statics = { .IActivationFactory_iface = {&factory_vtbl}, .IInstalledVoicesStatic_iface = {&installed_voices_static_vtbl}, .ref = 1, .allvoices_critsect_debug = { 0, 0, &synthesizer_statics.allvoices_cs, { &synthesizer_statics.allvoices_critsect_debug.ProcessLocksList, &synthesizer_statics.allvoices_critsect_debug.ProcessLocksList }, 0, 0, { (DWORD_PTR)(__FILE__ ": synthesizer_statics_cs") } }, .allvoices_cs = { &synthesizer_statics.allvoices_critsect_debug, -1, 0, 0, 0, 0 } };
then just
static HRESULT WINAPI installed_voices_static_get_AllVoices( IInstalledVoicesStatic *iface, IVectorView_VoiceInformation **value ) { struct synthesizer_statics *impl = impl_from_IInstalledVoicesStatic(iface); HRESULT hr; TRACE("iface %p, value %p.\n", iface, value); EnterCriticalSection(&impl->allvoices_cs); if (all_voices.provider.num_voices == 0) ...
You probably could then also just rename `allvoices_cs` -> `cs` and `allvoices_critsect_debug` -> `cs_debug`