Table of contents
TOC
Collapse the table of content
Expand the table of content

ICSPNode::Add

Last Updated: 10/28/2016

This method adds an immediate child node to a configuration service provider node and returns a pointer to the new node.

Syntax

HRESULT Add([in] IConfigManager2URI* pChildName,
            [in] CFG_DATATYPE DataType,
            [in] VARIANT varValue, 
            [in, out] ICSPNode** ppNewNode, 
            [in, out] DWORD* pgrfNodeOptions);

Parameters

pChildName
      Name of child node to add.

DataType
      Data type of the child node to add. Supported types include:

  • CFG_DATATYPE_NODE

  • CFG_DATATYPE_NULL

  • CFG_DATATYPE_BINARY

  • CFG_DATATYPE_INTEGER

  • CFG_DATATYPE_STRING

  • CFG_DATATYPE_MULTIPLE_STRING

varValue
      Value of the child node to add.

ppNewNode
      New child node to return.

pgrfNodeOptions
      Features supported on the new child node.

Feature nameBit value (in hex)Notes

CSPNODE_OPTION_NATIVESECURITY

0x01

The native security option signifies that the node handles its own security checking, and that ConfigManager2 does not have to manage security for this node.

CSPNODE_OPTION_INTERNALTRANSACTION

0x02

The internal transactioning option tells ConfigManager2 that the configuration service provider handles the transactioning (rollback and commitment) for the node. To handle internal transactioning, the node must implement the ICSPNodeTransactioning.

CSPNODE_OPTION_HANDLEALLPROPERTIES

0x04

Unused.

CSPNODE_OPTION_SECRETDATA

0x08

Unused.

Return Value

This method returns an ICSPNode and the feature options supported on that child node. If the method returns null, call GetLastError to get the error value.

A value of S_OK indicates that a node was successfully found. CMN_E_ALREADY_EXISTS indicates that a child node with the same name already exists. CFGMGR_E_COMMANDNOTALLOWED indicates that this node does not support the Add method.

Remarks

For externally–transactioned nodes, if this method is implemented, then ICSPNode::Clear and ICSPNode::DeleteChild must also be implemented or rollback will fail.

Requirements

Header: None

Create a custom configuration service provider

© 2017 Microsoft