<div class="content" name="NetrDfsAddFtRoot" uuid="eddab804-70e9-4b78-9763-d4cb6f052496"><p>The NetrDfsAddFtRoot (Opnum 10) method creates a new <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_2aad5e61-ffe9-406e-a192-328c5327ee72" data-linktype="relative-path">domainv1-based DFS namespace</a>
or adds a root target to an existing namespace. </p><p>The NetrDfsAddFtRoot method uses the following <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_9c5903c1-1477-4181-b451-3ba1e34a0c0c" data-linktype="relative-path">MIDL</a> syntax.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrDfsAddFtRoot(
   [in, string] WCHAR* ServerName,
   [in, string] WCHAR* DcName,
   [in, string] WCHAR* RootShare,
   [in, string] WCHAR* FtDfsName,
   [in, string] WCHAR* Comment,
   [in, string] WCHAR* ConfigDN,
   [in] BOOLEAN NewFtDfs,
   [in] DWORD ApiFlags,
   [in, out, unique] DFSM_ROOT_LIST** ppRootList
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>The pointer to a null-terminated <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8" data-linktype="relative-path">Unicode</a> string. This MUST
be used as the host name of the new DFS root target in the metadata.<a id="Appendix_A_Target_108"></a><a aria-label="Product behavior note 108" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_108" data-linktype="relative-path">&lt;108&gt;</a></p><p><b>DcName: </b>The pointer to a null-terminated
Unicode string. For a domainv1-based DFS namespace, this string contains the
host name of the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">DC</a> that
the new <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_ac90b498-3ba4-48d6-bcd6-5495f1654671" data-linktype="relative-path">DFS root target</a>
is to use to get or update <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_e8de88fd-d760-46fa-ad77-76961fa20aea" data-linktype="relative-path">DFS
metadata</a> for the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890" data-linktype="relative-path">DFS
namespace</a>. This parameter MAY be a NULL pointer, otherwise, it MUST be the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d" data-linktype="relative-path">PDC</a> for the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain</a> of the DFS
namespace.</p><p><b>RootShare: </b>The pointer to a null-terminated
Unicode string. This is the new DFS root target <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_3c179f10-1793-4268-96eb-de4d85a32060" data-linktype="relative-path">share name</a>. This can be
different from the <i>FtDfsName</i> parameter. The <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3" data-linktype="relative-path">share</a> MUST already exist.</p><p><b>FtDfsName: </b>The pointer to a null-terminated
Unicode string. This is the name of the new or existing <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_133ab305-ad75-4b38-8ec9-40bc0dc3b594" data-linktype="relative-path">domain-based DFS namespace</a>.</p><p><b>Comment: </b>The pointer to a null-terminated
Unicode string that contains a comment associated with the DFS namespace. Used
for informational purposes, this string has no protocol-specified restrictions
on length or content. The comment is meant for human consumption and does not
affect server functionality. This parameter MAY be NULL.</p><p><b>ConfigDN: </b>The pointer to a null-terminated
Unicode string. This string MUST be the path of the DFS namespace object entry
in the DFS Configuration Container (see section <a href="aac9f417-7065-4e3d-9bd9-ab81822adfd4" data-linktype="relative-path">2.3.3</a>).<a id="Appendix_A_Target_109"></a><a aria-label="Product behavior note 109" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_109" data-linktype="relative-path">&lt;109&gt;</a></p><p><b>NewFtDfs: </b>A Boolean value that, if TRUE,
indicates a request to create a new root. If FALSE, then this value indicates a
request to add a new root target to an existing root.</p><p><b>ApiFlags: </b>This parameter MUST be 0.</p><p><b>ppRootList: </b>On success, returns a list of DFS
root targets in the domain-based DFS namespace that the client will be
responsible for notifying of the change in the DFS namespace. See section <a href="88e325d9-538f-473c-8f49-25b879d3809d" data-linktype="relative-path">3.2.4.3.1</a>. The list MAY be
empty if the server has performed the notification.<a id="Appendix_A_Target_110"></a><a aria-label="Product behavior note 110" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_110" data-linktype="relative-path">&lt;110&gt;</a></p><p><b>Return Values: </b>The method MUST return 0 on
success and a nonzero error code on failure. The method can return any specific
error code value, as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a>.
The most common error codes are listed in the following table.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 ERROR_SUCCESS</td>
  <td>Successful completion.</td>
 </tr><tr>
  <td>0x00000005 ERROR_ACCESS_DENIED</td>
  <td>Permission to perform the operation was denied.</td>
 </tr><tr>
  <td>0x00000057 ERROR_INVALID_PARAMETER</td>
  <td>An incorrect parameter was specified.</td>
 </tr><tr>
  <td>0x000000B7 ERROR_ALREADY_EXISTS</td>
  <td>A namespace of the specified name already exists on the server.</td>
 </tr><tr>
  <td>0x00000906 NERR_NetNameNotFound</td>
  <td>The share that the RootShare parameter specifies does not already exist.</td>
 </tr></tbody></table>
</dd></dl><p>The share that the <i>RootShare</i> parameter specifies MUST
already exist on the server.</p><p>If the <i>DcName</i> parameter is not NULL, the server
assumes that this is the PDC for the domain in which the DFS namespace is to be
created.</p><p>If the domain-based DFS namespace already exists, and the <i>ServerName</i>
and <i>RootShare</i> parameters are a root target, the server MUST fail with
ERROR_ALREADY_EXISTS.</p><p>If the share that the <i>RootShare</i> parameter specifies
does not already exist, the RPC method MUST fail with NERR_NetNameNotFound
(0x00000906).</p><p>The server MUST update the following fields in the
domainv1-based DFS metadata.</p><table><thead>
  <tr>
   <th>
   <p>Operation </p>
   </th>
   <th>
   <p>DFS metadata changes required </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>Adding a new namespace</td>
  <td>Creates new DFS metadata.</td>
 </tr><tr>
  <td>Adding a new root target</td>
  <td>Updates the TargetCount field of the DFSTargetListBLOB, creates a new TargetEntryBLOB, updates the DFSTargetListBLOBSize, updates the BLOBDataSize of the DFSNamespaceRootBLOB, and adds the DFSRootTarget to the remoteServerName attribute in the object.</td>
 </tr></tbody></table><p>The server MUST synchronously update the DFS metadata.</p><p>The server MUST return a list of DFS root targets to the
client in the <i>ppRootList</i> parameter.<a id="Appendix_A_Target_111"></a><a aria-label="Product behavior note 111" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_111" data-linktype="relative-path">&lt;111&gt;</a></p></div>