IWMDeviceManager::EnumDevices method (mswmdm.h)

The EnumDevices method retrieves a pointer to the IWMDMEnumDevice interface that can be used to enumerate portable devices connected to the computer.


HRESULT EnumDevices(
  IWMDMEnumDevice **ppEnumDevice



Pointer to a pointer to an IWMDMEnumDevice interface used to enumerate devices. The caller must release this interface when done with it.

Return value

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
For an extensive list of possible error codes, see Error Codes.


This method returns devices based on earlier versions of Windows Media Device Manager. To get all devices, including newer devices (such as MTP devices), call IWMDMDeviceManager2::EnumDevices2.


Target Platform Windows
Header mswmdm.h
Library Mssachlp.lib

See also

Enumerating Devices

IWMDMEnumDevice Interface

IWMDeviceManager Interface