Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CM_Add_ID_Ex function

The CM_Add_ID_Ex function appends a device ID (if not already present) to a device instance's hardware ID list or compatible ID list, on either the local or a remote machine.

Syntax


CMAPI
CONFIGRET
WINAPI CM_Add_ID_Ex(
  _In_      DEVINST dnDevInst,
  _In_      PWSTR pszID,
  _In_      ULONG ulFlags,
  _In_opt_  HMACHINE hMachine
);

Parameters

dnDevInst [in]

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

hMachine

.

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.

 

hMachine [in, optional]

Caller-supplied machine handle to which the caller-supplied device instance handle is bound.

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

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 a local or a remote machine, see CM_Get_Child_Ex.

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

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Cfgmgr32.h (include Cfgmgr32.h)

Library

Cfgmgr32.lib

See also

CM_Add_ID
CM_Get_Child_Ex

 

 

Send comments about this topic to Microsoft

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.