CM_Enumerate_Enumerators_Ex function

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

The CM_Enumerate_Enumerators_Ex function enumerates a local or a remote machine's device enumerators, by supplying each enumerator's name.


WINAPI CM_Enumerate_Enumerators_Ex(
  _In_     ULONG    ulEnumIndex,
  _Out_    PWSTR    Buffer,
  _Inout_  PULONG   pulLength,
  _In_     ULONG    ulFlags,
  _In_opt_ HMACHINE hMachine


ulEnumIndex [in]

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

Buffer [out]

Address of a buffer to receive an enumerator name. This buffer should be MAX_DEVICE_ID_LEN-sized (or, set Buffer to zero and obtain the actual name length in the location referenced by puLength).

pulLength [in, out]

Caller-supplied address of a location to hold the buffer size. The caller supplies the length of the buffer pointed to by Buffer. The function replaces this value with the actual size of the enumerator's name string. If the caller-supplied buffer length is too small, the function supplies the required buffer size and returns CR_BUFFER_SMALL.

ulFlags [in]

Not used, must be zero.

hMachine [in, optional]

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.


To enumerate the local or a remote machine's device enumerators, call CM_Enumerate_Enumerators_Ex repeatedly, starting with a ulEnumIndex index value of zero, and incrementing the index value with each subsequent call until the function returns CR_NO_SUCH_VALUE.

After enumerator names have been obtained, the names can be used as input to CM_Get_Device_ID_List.

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.


Target platform



Available in Microsoft Windows 2000 and later versions of Windows.


Cfgmgr32.h (include Cfgmgr32.h)



Unicode and ANSI names

CM_Enumerate_Enumerators_ExW (Unicode)

See also




Send comments about this topic to Microsoft