<div class="content"><p> </p><p>The NetrDfsSetInfo method sets or modifies information
relevant to a specific <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_639b7503-b879-4ef7-98a8-14adf85bc16d" data-linktype="relative-path">DFS root</a></span>, <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_ac90b498-3ba4-48d6-bcd6-5495f1654671" data-linktype="relative-path">DFS root
target</a></span>, <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_0611e93d-f0e7-42ee-a591-d77ebcbb6619" data-linktype="relative-path">DFS link</a></span>, or <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_44e2f830-c28b-41e3-8c3c-d0bb576ed9fb" data-linktype="relative-path">DFS link
target</a></span>.</p><p>The NetrDfsSetInfo 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 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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8" data-linktype="relative-path">Unicode</a></span>
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>
  <p>Level_100</p>
  <p>0x00000064</p>
  </td>
  <td>
  <p>Sets the comment associated with the root or link
  specified in the <i>DfsInfo</i> parameter. The <i>ServerName</i> and <i>ShareName</i>
  parameters MUST be NULL.</p>
  </td>
 </tr><tr>
  <td>
  <p>Level_101</p>
  <p>0x00000065</p>
  </td>
  <td>
  <p>Sets the state associated with the root, link, root
  target, or link target specified in <i>DfsInfo</i>.<a id="Appendix_A_Target_52"></a><a aria-label="Product behavior note 52" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_52" data-linktype="relative-path">&lt;52&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>Level_102</p>
  <p>0x00000066</p>
  </td>
  <td>
  <p>Sets the time-out value associated with the root or
  link specified in <i>DfsInfo</i>. The <i>ServerName</i> and <i>ShareName</i>
  parameters MUST be ignored.</p>
  </td>
 </tr><tr>
  <td>
  <p>Level_103</p>
  <p>0x00000067</p>
  </td>
  <td>
  <p>Sets the property flags for the root or link specified
  in <i>DfsInfo</i>. The <i>ServerName</i> and <i>ShareName</i> parameters MUST
  be NULL.</p>
  </td>
 </tr><tr>
  <td>
  <p>Level_104</p>
  <p>0x00000068</p>
  </td>
  <td>
  <p>Sets the target priority rank and class for the root
  target or link target specified in <i>DfsInfo</i>.</p>
  </td>
 </tr><tr>
  <td>
  <p>Level_105</p>
  <p>0x00000069</p>
  </td>
  <td>
  <p>Sets the comment, state, time-out information, and
  property flags for the namespace root or link specified in <i>DfsInfo</i>.
  Does not apply to a root target or link target. The <i>ServerName</i> and <i>ShareName</i>
  parameters MUST be NULL.</p>
  </td>
 </tr><tr>
  <td>
  <p>Level_106</p>
  <p>0x0000006A</p>
  </td>
  <td>
  <p>Sets the target state and priority for the DFS root
  target or DFS link target specified in <i>DfsInfo</i>.<a id="Appendix_A_Target_53"></a><a aria-label="Product behavior note 53" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_53" data-linktype="relative-path">&lt;53&gt;</a> This does not apply to the <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890" data-linktype="relative-path">DFS
  namespace</a></span> root or link.</p>
  </td>
 </tr><tr>
  <td>
  <p>Level_107</p>
  <p>0x0000006B</p>
  </td>
  <td>
  <p>Sets the comment, state, time-out, security descriptor
  information, and property flags for the namespace root or link specified in <i>DfsInfo</i>.
  Does not apply to a root target or link target. The <i>ServerName</i> and <i>ShareName</i>
  parameters MUST be NULL. The security descriptor MUST NOT have owner, group,
  or <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_c189801e-3752-4715-88f4-17804dad5782" data-linktype="relative-path">SACLs</a></span>
  in it.</p>
  <p>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.</p>
  </td>
 </tr><tr>
  <td>
  <p>Level_150</p>
  <p>0x00000096</p>
  </td>
  <td>
  <p>Sets the security descriptor associated with a DFS
  link. Only <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_ce6af522-ba70-4ba1-a684-b98b809c72ad" data-linktype="relative-path">stand-alone DFS namespaces</a></span>
  and <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_8099f7c1-2a31-4a20-81e6-824689bd9c5a" data-linktype="relative-path">domainv2-based DFS namespaces</a></span>
  are supported. The <i>ServerName</i> and <i>ShareName</i> parameters MUST
  both be NULL. The security descriptor MUST NOT have owner, group, or SACLs in
  it.</p>
  </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 <span><a href="725240d3-2da7-41ef-8161-b7df1c2af497" data-linktype="relative-path">DFS_INFO_STRUCT</a></span>
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 <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>0x00000002</p>
  <p>ERROR_FILE_NOT_FOUND</p>
  </td>
  <td>
  <p>The specified DFS link target was not found as a
  target of the specified DFS link.</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>0x00000032</p>
  <p>ERROR_NOT_SUPPORTED</p>
  </td>
  <td>
  <p>The specified operation is not supported.</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>0x00000490</p>
  <p>ERROR_NOT_FOUND</p>
  </td>
  <td>
  <p>The specified DFS root namespace or DFS link, or DFS
  link or root target, does not exist.</p>
  </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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_133ab305-ad75-4b38-8ec9-40bc0dc3b594" data-linktype="relative-path">domain-based
DFS namespace</a></span>. 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 <span><a href="af9d607e-04e5-4722-8d00-76cf9c7b69f9" data-linktype="relative-path">DFS_INFO_101</a></span>
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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_e8de88fd-d760-46fa-ad77-76961fa20aea" data-linktype="relative-path">DFS metadata</a></span>. The
details of this update operation are implementation-dependent.</p><p>When level 107 is used for a DFS namespace root or for a <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_2aad5e61-ffe9-406e-a192-328c5327ee72" data-linktype="relative-path">domainv1-based</a></span>
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>
  <p>100</p>
  <p>(0x00000064)</p>
  </td>
  <td>
  <p>Update <b>Comment</b> in the <b>NamespaceElement</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>101</p>
  <p>(0x00000065)</p>
  </td>
  <td>
  <p>If a link, update the <b>State</b> field of <b>NamespaceElement</b>.
  If a root target or link target, update the <b>TargetState</b> field of <b>Target</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>102</p>
  <p>(0x00000066)</p>
  </td>
  <td>
  <p>Update the <b>ReferralTTL</b> field of <b>NamespaceElement</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>103</p>
  <p>(0x00000067)</p>
  </td>
  <td>
  <p>Update the <b>Properties</b> field of <b>NamespaceElement</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>104</p>
  <p>(0x00000068)</p>
  </td>
  <td>
  <p>Update the <b>PriorityRank</b> and <b>PriorityClass</b>
  fields of <b>Target</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>105</p>
  <p>(0x00000069)</p>
  </td>
  <td>
  <p>Update the <b>Comment</b>, <b>State</b>, <b>ReferralTTL</b>,
  and <b>Properties</b> fields of <b>NamespaceElement</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>106</p>
  <p>(0x0000006A)</p>
  </td>
  <td>
  <p>Update the <b>PriorityRank</b>, <b>PriorityClass</b>,
  and <b>TargetState</b> fields of <b>Target</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>107</p>
  <p>(0x0000006B)</p>
  </td>
  <td>
  <p>Update the <b>Comment</b>, <b>State</b>, <b>ReferralTTL</b>,
  <b>SecurityDescriptor</b>, and <b>Properties</b> fields of <b>NamespaceElement</b>.</p>
  </td>
 </tr><tr>
  <td>
  <p>150</p>
  <p>(0x00000096)</p>
  </td>
  <td>
  <p>Update <b>SecurityDescriptor</b> of the <b>NamespaceElement</b>.</p>
  </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>
  <p>100 (0x00000064)</p>
  </td>
  <td>
  <p>Update <b>CommentSize</b> and <b>Comment</b> in <span><a href="4ccdd530-9696-4572-968f-27d689b33999" data-linktype="relative-path">DFSRootOrLinkIDBLOB</a></span>
  and BLOBDataSize of <span><a href="9f18db22-cfcc-429f-88eb-364a5ae7482c" data-linktype="relative-path">DFSNamespaceLinkBLOB</a></span>.</p>
  </td>
 </tr><tr>
  <td>
  <p>101 (0x00000065)</p>
  </td>
  <td>
  <p>If a link, update the <b>State</b> field of
  DFSRootOrLinkIDBLOB.</p>
  <p>If a root target or link target, update the <b>TargetState</b>
  field of <span><a href="c914cbbc-eb6f-4843-b344-f20dd0619853" data-linktype="relative-path">TargetEntryBLOB</a></span>.</p>
  </td>
 </tr><tr>
  <td>
  <p>102 (0x00000066)</p>
  </td>
  <td>
  <p>Update the <b>ReferralTTL</b> field of
  DFSNamespaceRootBLOB or DFSNamespaceLinkBLOB.</p>
  </td>
 </tr><tr>
  <td>
  <p>103 (0x00000067)</p>
  </td>
  <td>
  <p>Update the <b>Type</b> field of DFSRootOrLinkIDBLOB.</p>
  </td>
 </tr><tr>
  <td>
  <p>104 (0x00000068)</p>
  </td>
  <td>
  <p>Update the <b>PriorityRank</b> and <b>PriorityClass</b>
  fields of TargetEntryBLOB.</p>
  </td>
 </tr><tr>
  <td>
  <p>105 (0x00000069)</p>
  </td>
  <td>
  <p>Update <b>CommentSize</b> and <b>Comment</b> in
  DFSRootOrLinkIDBLOB, the <b>State</b> field of DFSRootOrLinkIDBLOB, the <b>ReferralTTL</b>
  field of DFSNamespaceRootBLOB or DFSNamespaceLinkBLOB, and the <b>Type</b>
  field of DFSRootOrLinkIDBLOB.</p>
  </td>
 </tr><tr>
  <td>
  <p>106 (0x0000006A)</p>
  </td>
  <td>
  <p>Update the <b>PriorityRank</b>, <b>PriorityClass</b>,
  and <b>TargetState</b> fields of TargetEntryBLOB.</p>
  </td>
 </tr><tr>
  <td>
  <p>107 (0x0000006B)</p>
  </td>
  <td>
  <p>See 105 (0x00000069).</p>
  </td>
 </tr></tbody></table><p>If the server does not support levels 104 or 106, it MUST
use the <span><a href="../ms-dtyp/2c57429b-fdd4-488f-b5fc-9e4cf020fcdf" data-linktype="relative-path">FILETIME</a></span>
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 <span><a href="e12881d6-4799-43bd-8de3-e1daef210408" data-linktype="relative-path">2.3.4</a></span>.</p><table><thead>
  <tr>
   <th>
   <p>Value </p>
   </th>
   <th>
   <p>DFS metadata changes required </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>100 (0x00000064)</p>
  </td>
  <td>
  <p>Update msDFS-Commentv2.</p>
  </td>
 </tr><tr>
  <td>
  <p>101 (0x00000065)</p>
  </td>
  <td>
  <p><b>State</b> field of msDFS-TargetListv2.</p>
  </td>
 </tr><tr>
  <td>
  <p>102 (0x00000066)</p>
  </td>
  <td>
  <p>Update msDFS-Ttlv2.</p>
  </td>
 </tr><tr>
  <td>
  <p>103 (0x00000067)</p>
  </td>
  <td>
  <p>Update msDFS-Propertiesv2.</p>
  </td>
 </tr><tr>
  <td>
  <p>104 (0x00000068)</p>
  </td>
  <td>
  <p>Update the <b>priorityClass</b> and <b>priorityRank</b>
  attributes in msDFS-TargetListv2.</p>
  </td>
 </tr><tr>
  <td>
  <p>105 (0x00000069)</p>
  </td>
  <td>
  <p>Update msDFS-Commentv2, msDFS-Ttlv2,
  msDFS-Propertiesv2, and the State field of msDFS-Targetlistv2.</p>
  </td>
 </tr><tr>
  <td>
  <p>106 (0x0000006A)</p>
  </td>
  <td>
  <p>Update priorityClass, priorityRank, and the State
  field of msDFS-TargetListv2.</p>
  </td>
 </tr><tr>
  <td>
  <p>107 (0x0000006B)</p>
  </td>
  <td>
  <p>Update msDFS-Commentv2, msDFS-Ttlv2, msDFS-Propertiesv2,
  msDFS-LinkSecurityDescriptorv2, and the State field of msDFS-TargetListv2.</p>
  </td>
 </tr><tr>
  <td>
  <p>150 (0x00000096)</p>
  </td>
  <td>
  <p>Update msDFS-LinkSecurityDescriptorv2.</p>
  </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 <span><a href="../ms-srvs/accf23b0-0f57-441c-9185-43041f1b0ee9" data-linktype="relative-path">[MS-SRVS]</a></span>
section <span><a href="../ms-srvs/048b35f8-ac41-4b4a-bd4f-408e4d381234" data-linktype="relative-path">3.1.4.11</a></span>).</p><p>If <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_cf94d206-f71c-4ca1-891a-24c83f533e45" data-linktype="relative-path">DFS root scalability mode</a></span>
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>