CM_Get_Device_ID_List_Ex function

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

The CM_Get_Device_ID_List_Ex function retrieves a list of device instance IDs for the device instances on a local or a remote machine.


WINAPI CM_Get_Device_ID_List_Ex(
  _In_opt_ PCTSTR   pszFilter,
  _Out_    PWCHAR   Buffer,
  _In_     ULONG    BufferLen,
  _In_     ULONG    ulFlags,
  _In_opt_ HMACHINE hMachine


pszFilter [in, optional]

Caller-supplied pointer to a character string specifying a subset of the machine's device instance identifiers, or NULL. See the following description of ulFlags.

Buffer [out]

Address of a buffer to receive a set of NULL-terminated device instance identifier strings. The end of the set is terminated by an extra NULL. The required buffer size should be obtained by calling CM_Get_Device_ID_List_Size_Ex.

BufferLen [in]

Caller-supplied length, in characters, of the buffer specified by Buffer.

ulFlags [in]

One of the optional, caller-supplied bit flags that specify search filters. If no flags are specified, the function supplies all instance identifiers for all device instances. For a list of bit flags, see the ulFlags description for CM_Get_Device_ID_List.

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.


For information about device instance IDs, see Device Identification Strings.

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_Get_Device_ID_List_ExW (Unicode)



Send comments about this topic to Microsoft