| 4584 | //============================================================================= |
| 4585 | |
| 4586 | RtApiWasapi::RtApiWasapi() |
| 4587 | : coInitialized_(false) |
| 4588 | , deviceEnumerator_(NULL) |
| 4589 | { |
| 4590 | // WASAPI can run either apartment or multi-threaded |
| 4591 | HRESULT hr = CoInitialize(NULL); |
| 4592 | if (!FAILED(hr)) |
| 4593 | coInitialized_ = true; |
| 4594 | |
| 4595 | // Instantiate device enumerator |
| 4596 | hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, |
| 4597 | CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), |
| 4598 | (void **) &deviceEnumerator_); |
| 4599 | |
| 4600 | // If this runs on an old Windows, it will fail. Ignore and proceed. |
| 4601 | if (FAILED(hr)) |
| 4602 | deviceEnumerator_ = NULL; |
| 4603 | } |
| 4604 | |
| 4605 | //----------------------------------------------------------------------------- |
| 4606 |
nothing calls this directly
no outgoing calls
no test coverage detected