Bernhard Kölbl (@besentv) commented about dlls/windows.media.speech/synthesizer.c:
DEFINE_IINSPECTABLE(installed_voices_static, IInstalledVoicesStatic, struct synthesizer_statics, IActivationFactory_iface)
+static CRITICAL_SECTION allvoices_cs; +static CRITICAL_SECTION_DEBUG allvoices_critsect_debug = +{
- 0, 0, &allvoices_cs,
- { &allvoices_critsect_debug.ProcessLocksList, &allvoices_critsect_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": allvoices_cs") }
+}; +static CRITICAL_SECTION allvoices_cs = { &allvoices_critsect_debug, -1, 0, 0, 0, 0 };
About this cs, would something like this work out?
```c 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
```c 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) ... ```