IMDSPEnumDevice::Next
The Next method retrieves a pointer to the next celt IMDSPDevice interfaces. This method must be implemented. It must not return WMDM_E_NOTSUPPORTED or E_NOTIMPL. For more information, see the second table under Implementing Service Providers.
Syntax
HRESULT Next(
ULONG celt,
IMDSPDevice** ppDevice,
ULONG* pceltFetched
);
Parameters
celt
[in] Number of devices requested.
ppDevice
[out] Array of pointers to the number of IMDSPDevice interfaces specified in the celt parameter. If NULL is returned, no more devices exist, or an error has occurred. If celt is more than 1, the caller must allocate enough memory to store celt number of interface pointers.
pceltFetched
[out] Pointer to a ULONG variable that receives the number of interfaces retrieved.
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 | The number of elements retrieved is less than celt. |
E_FAIL | An unspecified error occurred. |
E_OUTOFMEMORY | Not enough memory to create device objects. |
Remarks
When there are no more service provider interfaces for enumerated devices, or when there are fewer of these interfaces than requested by the celt parameter, the return value from Next is S_FALSE. When this happens, the pceltFetched parameter must be queried to determine how many interfaces, if any, were returned.
The device enumerator may not reflect the effect of device insertion and removal.
Requirements
Header: Defined in wmsp.idl.
Library: mssachlp.lib
See Also