<div class="content"><p> </p><p>The NetrDfsAddFtRoot (Opnum 10) method creates a new <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_2aad5e61-ffe9-406e-a192-328c5327ee72" data-linktype="relative-path">domainv1-based
DFS namespace</a></span> or adds a root target to an existing namespace. </p><p>The NetrDfsAddFtRoot method uses the following <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_9c5903c1-1477-4181-b451-3ba1e34a0c0c" data-linktype="relative-path">MIDL</a></span>
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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8" data-linktype="relative-path">Unicode</a></span>
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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">DC</a></span> that the new <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_ac90b498-3ba4-48d6-bcd6-5495f1654671" data-linktype="relative-path">DFS root
target</a></span> is to use to get or update <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_e8de88fd-d760-46fa-ad77-76961fa20aea" data-linktype="relative-path">DFS metadata</a></span> for the
<span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890" data-linktype="relative-path">DFS
namespace</a></span>. This parameter MAY be a NULL pointer, otherwise, it MUST
be the <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d" data-linktype="relative-path">PDC</a></span> for the <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain</a></span>
of the DFS namespace.</p><p><b>RootShare: </b>The pointer to a null-terminated
Unicode string. This is the new DFS root target <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_3c179f10-1793-4268-96eb-de4d85a32060" data-linktype="relative-path">share name</a></span>. This can
be different from the <i>FtDfsName</i> parameter. The <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3" data-linktype="relative-path">share</a></span> 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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_133ab305-ad75-4b38-8ec9-40bc0dc3b594" data-linktype="relative-path">domain-based
DFS namespace</a></span>.</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 <span><a href="aac9f417-7065-4e3d-9bd9-ab81822adfd4" data-linktype="relative-path">2.3.3</a></span>).<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 <span><a href="88e325d9-538f-473c-8f49-25b879d3809d" data-linktype="relative-path">3.2.4.3.1</a></span>.
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 <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a></span>.
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>
  <p>0x00000000</p>
  <p>ERROR_SUCCESS</p>
  </td>
  <td>
  <p>Successful completion.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000005</p>
  <p>ERROR_ACCESS_DENIED</p>
  </td>
  <td>
  <p>Permission to perform the operation was denied.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000057</p>
  <p>ERROR_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>An incorrect parameter was specified.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000000B7</p>
  <p>ERROR_ALREADY_EXISTS</p>
  </td>
  <td>
  <p>A namespace of the specified name already exists on
  the server.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000906</p>
  <p>NERR_NetNameNotFound</p>
  </td>
  <td>
  <p>The share that the RootShare parameter specifies does
  not already exist.</p>
  </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>
  <p>Adding a new namespace</p>
  </td>
  <td>
  <p>Creates new DFS metadata.</p>
  </td>
 </tr><tr>
  <td>
  <p>Adding a new root target</p>
  </td>
  <td>
  <p>Updates the <b>TargetCount</b> field of the <span><a href="0e4aa671-ba82-4645-a259-94fe7b04086b" data-linktype="relative-path">DFSTargetListBLOB</a></span>,
  creates a new <span><a href="c914cbbc-eb6f-4843-b344-f20dd0619853" data-linktype="relative-path">TargetEntryBLOB</a></span>,
  updates the DFSTargetListBLOBSize, updates the BLOBDataSize of the <span><a href="9f18db22-cfcc-429f-88eb-364a5ae7482c" data-linktype="relative-path">DFSNamespaceRootBLOB</a></span>,
  and adds the DFSRootTarget to the <b>remoteServerName</b> attribute in the <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_8bb43a65-7a8c-4585-a7ed-23044772f8ca" data-linktype="relative-path">object</a></span>.</p>
  </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>