Windows-sys IMMDeviceEnumerator

Hello Good morning, I am reviewing the windows documentation for listing audio devices with rust.

In the documentation we get the following code, written in C++

const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
  const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
  hr = CoCreateInstance(
         CLSID_MMDeviceEnumerator, NULL,
         CLSCTX_ALL, IID_IMMDeviceEnumerator,
         (void**)&pEnumerator);

when I try to look it up in the windows-sys library I only get the MMDeviceEnumerator enumerator and not IMMDeviceEnumerator.

the windows-sys crate contains declaration for basic data types and function signatures, the COM (and by extension, the WinRT) stuff is not there. you need the windows crate for the full set of Windows APIs.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.