IMDServiceProvider::EnumDevices method (mswmdm.h)
The EnumDevices method enumerates the installed physical or software devices that are currently attached and are known by the service provider.
HRESULT EnumDevices( IMDSPEnumDevice **ppEnumDevice );
The method returns an HRESULT. All the interface methods in Windows Media Device Manager can return any of the following classes of error codes:
- Standard COM error codes
- Windows error codes converted to HRESULT values
- Windows Media Device Manager error codes
This method is called on service providers that are not registered as Plug and Play aware (see Enabling PnP for Devices and Enumerating Devices for details). A service provider should return only the enumerator, which will enumerate only the devices that are currently attached to the computer and are supported by the service provider.
This method will be called only when an application starts, or when the application calls IWMDeviceManager2::Reinitialize.
At present, Windows Media Device Manager does not support returning installed devices.
The service provider cannot alert the application when devices connect or disconnect from the computer. If a Plug and Play device connects or disconnects and an application implements IWMDMNotification, then Windows Media Device Manager will send a notification to the application.
This method must be implemented. It must not return WMDM_E_NOTSUPPORTED or E_NOTIMPL. For more information, see Mandatory and Optional Interfaces.