<div class="content" name="NetrDfsSetInfo" uuid="7b033d5b-8d26-4931-8b3d-7aa35e441fb0"><p>The NetrDfsSetInfo method sets or modifies information
relevant to a specific <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_639b7503-b879-4ef7-98a8-14adf85bc16d" data-linktype="relative-path">DFS
root</a>, <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_ac90b498-3ba4-48d6-bcd6-5495f1654671" data-linktype="relative-path">DFS root target</a>,
<a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_0611e93d-f0e7-42ee-a591-d77ebcbb6619" data-linktype="relative-path">DFS link</a>, or <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_44e2f830-c28b-41e3-8c3c-d0bb576ed9fb" data-linktype="relative-path">DFS link target</a>.</p><p>The NetrDfsSetInfo 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 NetrDfsSetInfo(
   [in, string] WCHAR* DfsEntryPath,
   [in, unique, string] WCHAR* ServerName,
   [in, unique, string] WCHAR* ShareName,
   [in] DWORD Level,
   [in, switch_is(Level)] DFS_INFO_STRUCT* DfsInfo
 );
</pre></div>
</dd></dl><p><b>DfsEntryPath:</b> The pointer to a DFS root or a
DFS link path.</p><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> DFS root target or
DFS link target host name string. Clients MUST set this to a NULL pointer when
the DFS root or DFS link is used and not the DFS root target or DFS link
target.</p><p><b>ShareName: </b>The pointer to a null-terminated
Unicode string DFS root target or DFS link target host name. Clients MUST set
this to a NULL pointer when the DFS root or DFS link is used and not the DFS
root target or DFS link target.</p><p><b>Level: </b>Specifies the information level of the
data and, in turn, determines the action the method performs.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>Level_100 0x00000064</td>
  <td>Sets the comment associated with the root or link specified in the DfsInfo parameter. The ServerName and ShareName parameters MUST be NULL.</td>
 </tr><tr>
  <td>Level_101 0x00000065</td>
  <td>Sets the state associated with the root, link, root target, or link target specified in DfsInfo.&lt;52&gt;</td>
 </tr><tr>
  <td>Level_102 0x00000066</td>
  <td>Sets the time-out value associated with the root or link specified in DfsInfo. The ServerName and ShareName parameters MUST be ignored.</td>
 </tr><tr>
  <td>Level_103 0x00000067</td>
  <td>Sets the property flags for the root or link specified in DfsInfo. The ServerName and ShareName parameters MUST be NULL.</td>
 </tr><tr>
  <td>Level_104 0x00000068</td>
  <td>Sets the target priority rank and class for the root target or link target specified in DfsInfo.</td>
 </tr><tr>
  <td>Level_105 0x00000069</td>
  <td>Sets the comment, state, time-out information, and property flags for the namespace root or link specified in DfsInfo. Does not apply to a root target or link target. The ServerName and ShareName parameters MUST be NULL.</td>
 </tr><tr>
  <td>Level_106 0x0000006A</td>
  <td>Sets the target state and priority for the DFS root target or DFS link target specified in DfsInfo.&lt;53&gt; This does not apply to the DFS namespace root or link.</td>
 </tr><tr>
  <td>Level_107 0x0000006B</td>
  <td>Sets the comment, state, time-out, security descriptor information, and property flags for the namespace root or link specified in DfsInfo. Does not apply to a root target or link target. The ServerName and ShareName parameters MUST be NULL. The security descriptor MUST NOT have owner, group, or SACLs in it. The security descriptor MUST be a NULL, zero length value if used on a namespace root. In this case, note that it is equivalent to using Level_105.</td>
 </tr><tr>
  <td>Level_150 0x00000096</td>
  <td>Sets the security descriptor associated with a DFS link. Only stand-alone DFS namespaces and domainv2-based DFS namespaces are supported. The ServerName and ShareName parameters MUST both be NULL. The security descriptor MUST NOT have owner, group, or SACLs in it.</td>
 </tr></tbody></table>
</dd>
<dd>
<p>The server MUST support Level values 100 and 101.
The server SHOULD support Level values 102-107 and 150. If the server does not
support the provided Level, it MUST fail the call.<a id="Appendix_A_Target_54"></a><a aria-label="Product behavior note 54" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_54" data-linktype="relative-path">&lt;54&gt;</a> The
server SHOULD return error code ERROR_INVALID_PARAMETER for unsupported level
values.<a id="Appendix_A_Target_55"></a><a aria-label="Product behavior note 55" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_55" data-linktype="relative-path">&lt;55&gt;</a></p>
</dd></dl><p><b>DfsInfo: </b>The pointer to a <a href="725240d3-2da7-41ef-8161-b7df1c2af497" data-linktype="relative-path">DFS_INFO_STRUCT</a> union that
contains the specified data. The value of the <i>Level</i> parameter selects
the case of the union.</p><p><b>Return Values: </b>This 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>0x00000002 ERROR_FILE_NOT_FOUND</td>
  <td>The specified DFS link target was not found as a target of the specified DFS link.</td>
 </tr><tr>
  <td>0x00000005 ERROR_ACCESS_DENIED</td>
  <td>Permission to perform the operation was denied.</td>
 </tr><tr>
  <td>0x00000032 ERROR_NOT_SUPPORTED</td>
  <td>The specified operation is not supported.</td>
 </tr><tr>
  <td>0x00000057 ERROR_INVALID_PARAMETER</td>
  <td>An incorrect parameter was specified.</td>
 </tr><tr>
  <td>0x00000490 ERROR_NOT_FOUND</td>
  <td>The specified DFS root namespace or DFS link, or DFS link or root target, does not exist.</td>
 </tr></tbody></table>
</dd></dl><p>The NetrDfsSetInfo method SHOULD<a id="Appendix_A_Target_56"></a><a aria-label="Product behavior note 56" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_56" data-linktype="relative-path">&lt;56&gt;</a> support a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_133ab305-ad75-4b38-8ec9-40bc0dc3b594" data-linktype="relative-path">domain-based DFS namespace</a>.
If it does not support a domain-based DFS namespace it MUST return
ERROR_NOT_SUPPORTED.</p><p>The server MUST verify the existence of the DFS namespace
that the <i>DfsEntryPath</i> parameter specifies. If the namespace does not
exist, the server MUST return ERROR_NOT_FOUND.</p><p>The server MUST verify the existence of the DFS link that
the <i>DfsEntryPath</i> parameter specifies. If that existence check fails, the
server MUST return ERROR_NOT_FOUND.</p><p>The server MUST verify the existence of the DFS link target
of the DFS link that the <i>ServerName</i> and <i>RootShare</i> parameters
specify. If that existence check fails, the server MUST return
ERROR_FILE_NOT_FOUND.</p><p>The server MUST fail any attempt to set the state of a DFS
root, a DFS link, a DFS root target or a DFS link target to a value that is not
specified for the <i>Level</i> parameter. The server MUST fail any attempt to
set the property flags on a DFS link that are defined only for a DFS root.</p><p>When the <i>Level</i> parameter is 101 and the <b>State</b>
field in the <a href="af9d607e-04e5-4722-8d00-76cf9c7b69f9" data-linktype="relative-path">DFS_INFO_101</a>
structure is DFS_VOLUME_STATE_RESYNCHRONIZE, the server MUST reload the
contents of the DFSMetadataCache for the DFS namespace that the <i>ShareName</i>
parameter specifies. It MUST then update its local DFS namespace information by
comparing this information against the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_e8de88fd-d760-46fa-ad77-76961fa20aea" data-linktype="relative-path">DFS metadata</a>. The details
of this update operation are implementation-dependent.</p><p>When level 107 is used for a DFS namespace root or for a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_2aad5e61-ffe9-406e-a192-328c5327ee72" data-linktype="relative-path">domainv1-based</a> DFS link,
the <i>pSecurityDescriptor</i> parameter has no meaning because security
descriptors cannot be associated with those objects. In these cases, if <i>pSecurityDescriptor</i>
is not NULL, the server MUST fail with ERROR_NOT_SUPPORTED.</p><p>For domainv1-based DFS root, if the <b>Level</b> in the <b>DfsInfo</b>
structure is 103, 105, or 107, and if the <b>PropertyFlagMask</b> field has the
DFS_PROPERTY_FLAG_ABDE flag set, the server MUST fail the call with
ERROR_NOT_SUPPORTED.</p><p>If the <b>Level</b> in the <b>DfsInfo</b> structure is 103,
105, or 107, and if <b>PropertyFlagMask</b> field has
DFS_PROPERTY_FLAG_CLUSTER_ENABLED flag set, the server MUST fail the call with
ERROR_NOT_SUPPORTED.</p><p>The server MUST synchronously update the following fields in
the DFS metadata for a stand-alone DFS namespace, depending on the value of the
<i>Level</i> parameter.</p><table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>DFS metadata changes required </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>100 (0x00000064)</td>
  <td>Update Comment in the NamespaceElement.</td>
 </tr><tr>
  <td>101 (0x00000065)</td>
  <td>If a link, update the State field of NamespaceElement. If a root target or link target, update the TargetState field of Target.</td>
 </tr><tr>
  <td>102 (0x00000066)</td>
  <td>Update the ReferralTTL field of NamespaceElement.</td>
 </tr><tr>
  <td>103 (0x00000067)</td>
  <td>Update the Properties field of NamespaceElement.</td>
 </tr><tr>
  <td>104 (0x00000068)</td>
  <td>Update the PriorityRank and PriorityClass fields of Target.</td>
 </tr><tr>
  <td>105 (0x00000069)</td>
  <td>Update the Comment, State, ReferralTTL, and Properties fields of NamespaceElement.</td>
 </tr><tr>
  <td>106 (0x0000006A)</td>
  <td>Update the PriorityRank, PriorityClass, and TargetState fields of Target.</td>
 </tr><tr>
  <td>107 (0x0000006B)</td>
  <td>Update the Comment, State, ReferralTTL, SecurityDescriptor, and Properties fields of NamespaceElement.</td>
 </tr><tr>
  <td>150 (0x00000096)</td>
  <td>Update SecurityDescriptor of the NamespaceElement.</td>
 </tr></tbody></table><p>The server MUST update the following fields in the DFS
metadata for a domainv1-based DFS namespace, depending on the value of the <i>Level</i>
parameter.</p><table><thead>
  <tr>
   <th>
   <p>Value </p>
   </th>
   <th>
   <p>DFS metadata changes required </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>100 (0x00000064)</td>
  <td>Update CommentSize and Comment in DFSRootOrLinkIDBLOB and BLOBDataSize of DFSNamespaceLinkBLOB.</td>
 </tr><tr>
  <td>101 (0x00000065)</td>
  <td>If a link, update the State field of DFSRootOrLinkIDBLOB. If a root target or link target, update the TargetState field of TargetEntryBLOB.</td>
 </tr><tr>
  <td>102 (0x00000066)</td>
  <td>Update the ReferralTTL field of DFSNamespaceRootBLOB or DFSNamespaceLinkBLOB.</td>
 </tr><tr>
  <td>103 (0x00000067)</td>
  <td>Update the Type field of DFSRootOrLinkIDBLOB.</td>
 </tr><tr>
  <td>104 (0x00000068)</td>
  <td>Update the PriorityRank and PriorityClass fields of TargetEntryBLOB.</td>
 </tr><tr>
  <td>105 (0x00000069)</td>
  <td>Update CommentSize and Comment in DFSRootOrLinkIDBLOB, the State field of DFSRootOrLinkIDBLOB, the ReferralTTL field of DFSNamespaceRootBLOB or DFSNamespaceLinkBLOB, and the Type field of DFSRootOrLinkIDBLOB.</td>
 </tr><tr>
  <td>106 (0x0000006A)</td>
  <td>Update the PriorityRank, PriorityClass, and TargetState fields of TargetEntryBLOB.</td>
 </tr><tr>
  <td>107 (0x0000006B)</td>
  <td>See 105 (0x00000069).</td>
 </tr></tbody></table><p>If the server does not support levels 104 or 106, it MUST
use the <a href="../ms-dtyp/2c57429b-fdd4-488f-b5fc-9e4cf020fcdf" data-linktype="relative-path">FILETIME</a>
encoding for the <b>TargetTimestamp</b> field of the TargetEntryBLOB and update
the field for each modified TargetEntryBLOB, as specified in section
2.3.3.1.1.3.1.</p><p>If the server supports levels 104 and 106, it MUST instead
use the encoding which provides the <b>PriorityRank</b> and <b>PriorityClass</b>
in the <b>TargetTimestamp</b> field.</p><p>Note that for interoperability, all root targets of a
namespace SHOULD use the same encoding for this <b>TargetTimestamp</b> field.</p><p>The server MUST update the following fields in the DFS
metadata for a domainv2-based DFS namespace, depending on the value of the <i>Level</i>
parameter. For information about these fields, see section <a href="e12881d6-4799-43bd-8de3-e1daef210408" data-linktype="relative-path">2.3.4</a>.</p><table><thead>
  <tr>
   <th>
   <p>Value </p>
   </th>
   <th>
   <p>DFS metadata changes required </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>100 (0x00000064)</td>
  <td>Update msDFS-Commentv2.</td>
 </tr><tr>
  <td>101 (0x00000065)</td>
  <td>State field of msDFS-TargetListv2.</td>
 </tr><tr>
  <td>102 (0x00000066)</td>
  <td>Update msDFS-Ttlv2.</td>
 </tr><tr>
  <td>103 (0x00000067)</td>
  <td>Update msDFS-Propertiesv2.</td>
 </tr><tr>
  <td>104 (0x00000068)</td>
  <td>Update the priorityClass and priorityRank attributes in msDFS-TargetListv2.</td>
 </tr><tr>
  <td>105 (0x00000069)</td>
  <td>Update msDFS-Commentv2, msDFS-Ttlv2, msDFS-Propertiesv2, and the State field of msDFS-Targetlistv2.</td>
 </tr><tr>
  <td>106 (0x0000006A)</td>
  <td>Update priorityClass, priorityRank, and the State field of msDFS-TargetListv2.</td>
 </tr><tr>
  <td>107 (0x0000006B)</td>
  <td>Update msDFS-Commentv2, msDFS-Ttlv2, msDFS-Propertiesv2, msDFS-LinkSecurityDescriptorv2, and the State field of msDFS-TargetListv2.</td>
 </tr><tr>
  <td>150 (0x00000096)</td>
  <td>Update msDFS-LinkSecurityDescriptorv2.</td>
 </tr></tbody></table><p>The server MUST synchronously update the DFS metadata of a
domain-based DFS namespace.</p><p>For domainv2-based or standalone DFS root, if the
DFS_PROPERTY_FLAG_ABDE flag in <b>NamespaceElement.Properties</b> is either set
or cleared as a result of this method, the server MUST communicate with the
local SMB service to enable (DFS_PROPERTY_FLAG_ABDE set) or disable
(DFS_PROPERTY_FLAG_ABDE cleared) the Access-Based Directory Enumeration
property on the DFS root target by calling the <b>NetrShareSetinfo</b> method
using Level 1005 (as specified in <a href="../ms-srvs/accf23b0-0f57-441c-9185-43041f1b0ee9" data-linktype="relative-path">[MS-SRVS]</a>
section <a href="../ms-srvs/048b35f8-ac41-4b4a-bd4f-408e4d381234" data-linktype="relative-path">3.1.4.11</a>).</p><p>If <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_cf94d206-f71c-4ca1-891a-24c83f533e45" data-linktype="relative-path">DFS
root scalability mode</a> is not enabled for the domain-based DFS namespace,
the server MUST notify other DFS root targets of the change in DFS metadata by
asynchronously issuing a NetrDfsSetInfo method with the <i>Level</i> parameter
101, and with the <b>State</b> field of DFS_INFO_101 set to
DFS_VOLUME_STATE_RESYNCHRONIZE.<a id="Appendix_A_Target_57"></a><a aria-label="Product behavior note 57" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_57" data-linktype="relative-path">&lt;57&gt;</a></p></div>