CM_Enumerate_Classes_Ex function (cfgmgr32.h)

[Beginning with Windows 8 and Windows Server 2012, this function has been deprecated. Please use CM_Enumerate_Classes instead.]

The CM_Enumerate_Classes_Ex function, when called repeatedly, enumerates a local or a remote machine's installed device classes, by supplying each class's GUID.

Syntax

CMAPI CONFIGRET CM_Enumerate_Classes_Ex(
  [in]           ULONG    ulClassIndex,
  [out]          LPGUID   ClassGuid,
  [in]           ULONG    ulFlags,
  [in, optional] HMACHINE hMachine
);

Parameters

[in] ulClassIndex

Caller-supplied index into the machine's list of device classes. For more information, see the following Remarks section.

[out] ClassGuid

Caller-supplied address of a GUID structure (described in the Microsoft Windows SDK) to receive a device class's GUID.

[in] ulFlags

Beginning with Windows 8, callers can specify the following flags:

CM_ENUMERATE_CLASSES_INSTALLER

Enumerate device setup classes.

CM_ENUMERATE_CLASSES_INTERFACE

Enumerate device interface classes.

Otherwise, should be set to zero.

[in, optional] hMachine

Caller-supplied machine handle, obtained from a previous call to CM_Connect_Machine.

Note  Using this function to access remote machines is not supported beginning with Windows 8 and Windows Server 2012, as this functionality has been removed.
 

Return value

If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in Cfgmgr32.h.

Remarks

To enumerate the local or a remote machine's device classes, call CM_Enumerate_Classes_Ex repeatedly, starting with a ulClassIndex index value of zero and incrementing the index value with each subsequent call until the function returns CR_NO_SUCH_VALUE. Some index values might represent list entries containing invalid class data, in which case the function returns CR_INVALID_DATA. This return value can be ignored.

The class GUIDs obtained from this function can be used as input to the device installation functions.

Beginning with Windows 8 and later operating systems, callers can use the ulFlags member to specify which device classes CM_Enumerate_Classes_Ex should return. Prior to Windows 8, CM_Enumerate_Classes_Ex returned only device setup classes.

Functionality to access remote machines has been removed in Windows 8 and Windows Server 2012 and later operating systems thus you cannot access remote machines when running on these versions of Windows.

Requirements

Requirement Value
Minimum supported client Available in Microsoft Windows 2000 and later versions of Windows.
Target Platform Desktop
Header cfgmgr32.h (include Cfgmgr32.h)
Library Cfgmgr32.lib
DLL Cfgmgr32.dll

See also

CM_Enumerate_Classes