Partager via


DMOEnum function (dmoreg.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The DMOEnum function enumerates DMOs listed in the registry. The caller can search by category, media type, or both.

Syntax

HRESULT DMOEnum(
  REFGUID                     guidCategory,
  DWORD                       dwFlags,
  DWORD                       cInTypes,
  const DMO_PARTIAL_MEDIATYPE *pInTypes,
  DWORD                       cOutTypes,
  const DMO_PARTIAL_MEDIATYPE *pOutTypes,
  IEnumDMO                    **ppEnum
);

Parameters

guidCategory

GUID that specifies which category of DMO to search. Use GUID_NULL to search every category. See DMO GUIDs for a list of category GUIDs.

dwFlags

Bitwise combination of zero or more flags from the DMO_ENUM_FLAGS enumeration.

cInTypes

Number of input media types to use in the search criteria. Use zero to match any input type.

pInTypes

Pointer to an array of DMO_PARTIAL_MEDIATYPE structures that contain the input media types. Specify the size of the array in the cInTypes parameter.

cOutTypes

Number of output media types to use in the search criteria. Use zero to match any output type.

pOutTypes

Pointer to an array of DMO_PARTIAL_MEDIATYPE structures that contain the output media types. Specify the size of the array in the cOutTypes parameter.

ppEnum

Address of a variable to receive the IEnumDMO interface of the enumerator.

Return value

Returns an HRESULT value. Possible values include the following.

Return code Description
E_FAIL
Failure
E_OUTOFMEMORY
Insufficient memory
S_OK
Success

Remarks

This method returns a pointer to an enumerator object that supports the IEnumDMO interface. The application uses the IEnumDMO interface to enumerate over the set of DMOs that match the search criteria.

Examples

The following example enumerates all audio effect DMOs on the user's system, including keyed DMOs.

IEnumDMO* pEnum = NULL; 
HRESULT hr = DMOEnum(
    DMOCATEGORY_AUDIO_EFFECT, // Category
    DMO_ENUMF_INCLUDE_KEYED,  // Included keyed DMOs
    0, NULL,                  // Input types (don't care)
    0, NULL,                  // Output types (don't care)
    &pEnum);

if (SUCCEEDED(hr)) 
{
    CLSID clsidDMO;
    WCHAR* wszName;
    do
    {
        hr = pEnum->Next(1, &clsidDMO, &wszName, NULL);
        if (hr == S_OK) 
        {  
            // Now wszName holds the friendly name of the DMO, 
            // and clsidDMO holds the CLSID. 

            // Remember to release wszName!
            CoTaskMemFree(wszName);
        }
    } while (hr == S_OK);
    pEnum->Release();
}

Requirements

Requirement Value
Target Platform Windows
Header dmoreg.h (include Dmo.h)
Library Msdmo.lib
DLL Msdmo.dll

See also

DMO Functions