<div class="content"><p> </p><p>The NetrServerTransportAddEx method binds the specified <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span>
to the transport protocol. This extended method allows the caller to specify
information levels 1, 2, and 3 beyond what the <span><a href="440e3c7e-0880-4bf5-bd6f-5df8915739fe" data-linktype="relative-path">NetrServerTransportAdd</a></span>
method allows.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrServerTransportAddEx(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in] DWORD Level,
   [in, switch_is(Level)] LPTRANSPORT_INFO Buffer
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>An <span><a href="5f8329ee-1965-4ea1-ad35-3b29fbb63232" data-linktype="relative-path">SRVSVC_HANDLE (section 2.2.1.1)</a></span>
pointer that identifies the server. The <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span> MUST map this
structure to an RPC binding handle (see <span><a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a></span> sections
4.3.5 and 5.1.5.2). The server MUST ignore this parameter.</p><p><b>Level: </b>Specifies the information level of the
data. This parameter MUST be the following value.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0</p>
  </td>
  <td>
  <p>The buffer is of type <span><a href="7f7ab460-848a-4053-b311-fe56b53d628a" data-linktype="relative-path">SERVER_TRANSPORT_INFO_0</a></span>.</p>
  </td>
 </tr><tr>
  <td>
  <p>1</p>
  </td>
  <td>
  <p>The buffer is of type <span><a href="0950454f-d40b-4836-a8b2-a41f7cdbbad8" data-linktype="relative-path">SERVER_TRANSPORT_INFO_1</a></span>.</p>
  </td>
 </tr><tr>
  <td>
  <p>2</p>
  </td>
  <td>
  <p>The buffer is of type <span><a href="ea99a44b-95ae-4867-b3bc-c47f6e931fd5" data-linktype="relative-path">SERVER_TRANSPORT_INFO_2</a></span>.</p>
  </td>
 </tr><tr>
  <td>
  <p>3</p>
  </td>
  <td>
  <p>The buffer is of type <span><a href="9c199b47-8b3c-4d17-81ed-8443f170830f" data-linktype="relative-path">SERVER_TRANSPORT_INFO_3</a></span>.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>Buffer: </b>A pointer to the <span><a href="7e653b12-6402-4320-b096-8916430426ac" data-linktype="relative-path">TRANSPORT_INFO</a></span>
union that describes the data. The type of data depends on the value of the <i>Level</i>
parameter, as the preceding table shows.</p><p><b>Return Values: </b>The method returns 0x00000000
(NERR_Success) to indicate success; otherwise, it returns a nonzero error code.
The method can take 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>NERR_Success</p>
  </td>
  <td>
  <p>The client request succeeded.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000005</p>
  <p>ERROR_ACCESS_DENIED</p>
  </td>
  <td>
  <p>Access is denied.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000034</p>
  <p>ERROR_DUP_NAME</p>
  </td>
  <td>
  <p>A duplicate name exists on the network.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x0000007C</p>
  <p>ERROR_INVALID_LEVEL</p>
  </td>
  <td>
  <p>The system call level is not correct.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000057</p>
  <p>ERROR_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>The parameter is incorrect.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000008</p>
  <p>ERROR_NOT_ENOUGH_MEMORY</p>
  </td>
  <td>
  <p>Not enough storage is available to process this
  command.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The server SHOULD<a id="Appendix_A_Target_93"></a><a aria-label="Product behavior note 93" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_93" data-linktype="relative-path">&lt;93&gt;</a> enforce
security measures to verify that the caller has the required permissions to
execute this call. If the caller does not have the required credentials, the
server SHOULD<a id="Appendix_A_Target_94"></a><a aria-label="Product behavior note 94" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_94" data-linktype="relative-path">&lt;94&gt;</a> fail the call.</p><p>The <i>Level</i> parameter determines the type of structure
that the client has used to specify information about the new transport. The
value MUST be 0, 1, 2, or 3. If the <i>Level</i> parameter is not equal to one
of the valid values, the server MUST fail the call with an ERROR_INVALID_LEVEL
error code.</p><p>If the <i>Level</i> parameter is 0, the <i>Buffer</i>
parameter points to a SERVER_TRANSPORT_INFO_0 structure.</p><p>If the <i>Level</i> parameter is 1, the <i>Buffer</i>
parameter points to a SERVER_TRANSPORT_INFO_1 structure.</p><p>If the <i>Level</i> parameter is 2, the <i>Buffer</i>
parameter points to a SERVER_TRANSPORT_INFO_2 structure.</p><p>If the <i>Level</i> parameter is 3, the <i>Buffer</i>
parameter points to a SERVER_TRANSPORT_INFO_3 structure.</p><p>The server MUST validate all information that is provided in
the SERVER_TRANSPORT_INFO structure and MUST fail the call with
ERROR_INVALID_PARAMETER if any of these checks fail:</p><ul><li><p><span><span> 
</span></span>Both svti*_transportname and svti*_transportaddress MUST NOT be
NULL; svti*_transportaddresslength MUST NOT be zero.</p>
</li><li><p><span><span> 
</span></span>If svti*_domain is not NULL, its length MUST NOT be greater than
15.</p>
</li><li><p><span><span> 
</span></span>The svti*_flags can be any combination of the following flags as
defined in section 2.2.4.96: 0, SVTI2_REMAP_PIPE_NAMES, and SVTI2_SCOPED_NAME.</p>
</li></ul><p>The server MUST invoke the events specified in <span><a href="../ms-cifs/d416ff7c-c536-406e-a951-4f04b2fd1d2b" data-linktype="relative-path">[MS-CIFS]</a></span>
section <span><a href="../ms-cifs/a0a15b40-1d97-4912-aa03-48f78e46a85e" data-linktype="relative-path">3.3.4.17</a></span>
and <span><a href="../ms-smb2/5606ad47-5ee0-437a-817e-70c366052962" data-linktype="relative-path">[MS-SMB2]</a></span>
section <span><a href="../ms-smb2/5fc9f24b-4278-4c58-98be-312c6c089630" data-linktype="relative-path">3.3.4.21</a></span>,
passing the following as the parameters: <i>svti*_transportname</i>, <i>svti*_transportaddress</i>,
and a transport enable flag set to TRUE.</p><p>If both the CIFS and SMB2 servers return
ERROR_NOT_SUPPORTED, the server MUST return ERROR_NOT_SUPPORTED (0x00000032) to
the caller. If both the CIFS and SMB2 servers return an error other than
ERROR_NOT_SUPPORTED, the server must fail the call with an
implementation-dependent error.</p><p>If either the CIFS or SMB2 server returns STATUS_SUCCESS,
the server MUST create a new Transport and add it to the <b>TransportList</b>.
The Transport MUST be initialized as follows: </p><ul><li><p><span><span> 
</span></span><b>Transport.Name</b> MUST be set to the caller-supplied <i>svti*_transportname</i>.
For acceptable forms of svti*_transportname, see section 2.2.4.96.</p>
</li><li><p><span><span> 
</span></span><b>Transport.ServerName</b> MUST be set to the caller-supplied <i>svti*_transportaddress</i>.
For acceptable forms of <i>svti*_transportaddress</i>, see section 2.2.4.96.</p>
</li><li><p><span><span> 
</span></span><b>Transport.Domain</b> MUST be set to svti*_domain.</p>
</li><li><p><span><span> 
</span></span><b>Transport.Flags</b> MUST be set to svti*_flags.</p>
</li><li><p><span><span> 
</span></span><b>Transport.ConnectionCount</b> MUST be set to zero.</p>
</li><li><p><span><span> 
</span></span>The Transport MUST be persisted in an implementation-specific
store.</p>
</li></ul><p>The server MUST then return NERR_Success to the caller.</p></div>