R��mi Bernon (@rbernon) commented about dlls/windows.media.speech/recognizer.c:
- struct session *impl = impl_from_ISpeechContinuousRecognitionSession(iface);
- HRESULT hr = E_INVALIDOPERATION;
- TRACE("iface %p, action %p stub!\n", iface, action);
- *action = NULL;
- EnterCriticalSection(&impl->cs);
- if (impl->session_thread && impl->session_running && !impl->session_paused)
- {
impl->session_running = FALSE;
LeaveCriticalSection(&impl->cs);
hr = async_action_create((IInspectable *)iface, stop_callback, action);
- }
- else LeaveCriticalSection(&impl->cs);
That would be instead: ```c++ EnterCriticalSection(&impl->cs); if ((running = impl->session_running)) impl->session_running = FALSE; LeaveCriticalSection(&impl->cs);
if (!running) hr = E_INVALIDOPERATION; else { WakeConditionVariable(&impl->cv); hr = async_action_create((IInspectable *)iface, stop_callback, action); } ```