CONFIGRET CONFIGMG_Create_DevNode(PDEVNODE pdnDevNode, DEVNODEID pDeviceID, DEVNODE dnParent, ULONG ulFlags)
Adds a device node to the hardware tree.
pdnDevNode
Address that receives a handle to the new device node. Can be NULL.
pDeviceID
Device identifier. If this parameter is NULL, Configuration Manager does not attempt to find a device loader for the device.
dnParent
Handle of the device node that is the parent of the device node being created.
ulFlags
Must be zero.
Typically, an enumerator calls this function while it is enumerating new devices (during the CONFIG_ENUMERATE event). Configuration Manager allocates the device node and puts the device node in the sibling list of the child device node of dnParent. All fields are initialized to their default values. After this function returns successfully, the enumerator should fill in the fields it can, particularly the resource descriptors. When the enumerator returns from the event, Configuration Manager attempts to load a device driver for the new descendant of the enumerator's device node (if pDeviceID is not NULL).
This function returns CR_ALREADY_SUCH_DEVNODE if there is already a device node corresponding to pDeviceID in the tree. (This error is not returned when pDeviceID is NULL, because there can be multiple NULL device identifiers. These cannot be found using CONFIGMG_Locate_DevNode, however.) When this error is returned, the DN_HAS_MARK flag is set, and pdnDevNode is updated to the handle of the preexisting device node.