Hardware Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize

CM_Add_ID function

The CM_Add_ID function appends a specified device ID (if not already present) to a device instance'shardware ID list or compatible ID list.

Syntax


CMAPI
CONFIGRET
WINAPI CM_Add_ID(
  _In_ DEVINST dnDevInst,
  _In_ PWSTR   pszID,
  _In_ ULONG   ulFlags
);

Parameters

dnDevInst [in]

Caller-supplied device instance handle that is bound to the local machine.

pszID [in]

Caller-supplied pointer to a NULL-terminated device ID string.

ulFlags [in]

Caller-supplied flag constant that specifies the list onto which the supplied device ID should be appended. The following flag constants are valid.

Flag ConstantDefinition

CM_ADD_ID_COMPATIBLE

The specified device ID should be appended to the specific device instance's compatible ID list.

CM_ADD_ID_HARDWARE

The specified device ID should be appended to the specific device instance's hardware ID list.

 

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

Each appended device ID is considered less compatible than IDs already existing in the specified list. For information about device IDs, hardware IDs, and compatible IDs, see Device Identification Strings.

Callers of this function must have SeLoadDriverPrivilege. (Privileges are described in the Microsoft Windows SDK documentation.)

For information about using device instance handles that are bound to the local machine, see CM_Get_Child.

Requirements

Target platform

Desktop

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Cfgmgr32.h (include Cfgmgr32.h)

Library

Cfgmgr32.lib

Unicode and ANSI names

CM_Add_IDW (Unicode)

See also

CM_Add_ID_Ex
CM_Get_Child

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft