Jinoh Kang (@iamahuman) commented about dlls/windows.media.speech/recognizer.c:
- HRESULT hr = S_OK;
- if (!(session->audio_buf_event = CreateEventW(NULL, FALSE, FALSE, NULL)))
return HRESULT_FROM_WIN32(GetLastError());
- if (FAILED(hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void **)&mm_enum)))
goto cleanup;
- if (FAILED(hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(mm_enum, eCapture, eMultimedia, &mm_device)))
goto cleanup;
- if (FAILED(hr = IMMDevice_Activate(mm_device, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void **)&session->audio_client)))
goto cleanup;
- if (SUCCEEDED(hr = IMMDevice_GetId(mm_device, &str)))
TRACE("selected capture device ID: %s\n", debugstr_w(str));
```suggestion:-1+0 hr = IMMDevice_GetId(mm_device, &str); TRACE("selected capture device ID: %s (HRESULT %#x)\n", debugstr_w(str), hr); ```
It's more helpful to report failure than to silence it, since (1) `TRACE` is usually enabled for debugging purposes and (2) randomly omitted TRACE might cause confusion. `IMMDevice::GetId` returns NULL in `*ppstrId` on failure, and `debugstr_w` reports NULL as `(null)`.