Partager via


IWMDMEnumDevice::Next

banner art

The Next method returns a pointer to the next device identified by an IWMDMDevice interface.

Syntax

HRESULT Next(
  ULONG  celt,
  IWMDMDevice**  ppDevice,
  ULONG*  pceltFetched
);

Parameters

celt

[in]  Number of devices requested.

ppDevice

[out]  Pointer to a device identified by an instance of an IWMDMDevice interface.

pceltFetched

[out]  Pointer to a variable that receives the number of devices (interfaces) returned.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager and service provider 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 a complete list of possible error codes, see Error Codes.

Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.
S_FALSE Not all the devices requested were found.
E_FAIL An unspecified error occurred.

Remarks

The returned device interface(s) are based on a cached list of devices. If a Plug and Play device is attached or removed, the current enumerator will not reflect that, and therefore, Next will return devices based on the cached list. Applications should obtain a new enumerator object by calling IWMDeviceManager::EnumDevices to get a refreshed list of devices.

Requirements

Header: Defined in wmdm.idl.

Library: mssachlp.lib

See Also