<div class="content"><p> </p><p>The <b>NetrWkstaTransportAdd</b> method enables the <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625" data-linktype="relative-path">SMB</a></span>
<span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_15c89cb5-6767-49e7-b461-66acaf6c06c8" data-linktype="relative-path">network
redirector</a></span> to use a transport protocol on a remote computer.</p><dl>
<dd>
<div><pre> unsigned long NetrWkstaTransportAdd(
   [in, string, unique] WKSSVC_IDENTIFY_HANDLE ServerName,
   [in] unsigned long Level,
   [in] LPWKSTA_TRANSPORT_INFO_0 TransportInfo,
   [in, out, unique] unsigned long* ErrorParameter
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>A <b>WKSSVC_IDENTIFY_HANDLE</b>
structure (section <span><a href="9ef94a11-0e5c-49d7-9ac7-68d6f03565de" data-linktype="relative-path">2.2.2.1</a></span>) that
identifies the <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server (2)</a></span>. The <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span>
MUST map this structure to an <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> binding <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_5044babb-08e3-4bb9-bc12-fe8f542b05ee" data-linktype="relative-path">handle</a></span>
(<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>The information level of the data. <i>Level</i>
is set to zero, meaning the <i>TransportInfo</i> parameter points to a <b>WKSTA_TRANSPORT_INFO_0</b>
structure (section <span><a href="89195ba8-c9dd-4c61-8ca5-dae4f8ca5a39" data-linktype="relative-path">2.2.5.8</a></span>).</p><p><b>TransportInfo: </b>A pointer to a <b>WKSTA_TRANSPORT_INFO_0</b>
structure.</p><p><b>ErrorParameter: </b>A pointer to a value that
receives the index, starting at 0, of the first member of the <b>WKSTA_TRANSPORT_INFO_0</b>
structure that causes the function to return ERROR_INVALID_PARAMETER. If this
parameter is NULL, the index is not returned on error.</p><p><b>Return Values: </b>When the message processing
result meets the description in column two of the following table, this method
MUST return one of the following values (<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>).</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value/code</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>NERR_Success</p>
  <p>0x00000000</p>
  </td>
  <td>
  <p>The operation completed successfully.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_ACCESS_DENIED</p>
  <p>0x00000005</p>
  </td>
  <td>
  <p>Access is denied. </p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_PARAMETER</p>
  <p>0x00000057</p>
  </td>
  <td>
  <p>One of the function parameters is not valid.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_LEVEL</p>
  <p>0x0000007C</p>
  </td>
  <td>
  <p>The information level is invalid.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>Any other return value MUST conform to the error code
requirements in <b>Protocol Details </b>(section <span><a href="aeea622a-ea3e-40cc-a9b1-b4a2a3b2bf6b" data-linktype="relative-path">3</a></span>).</p><p>If the <i>Level</i> parameter is not equal to zero, the
server MUST fail the call and return ERROR_INVALID_LEVEL.</p><p>If the server does not support this method then it SHOULD be
processed as follows. </p><p>If any of the input parameters are invalid, the server
SHOULD return ERROR_INVALID_PARAMETER. Otherwise, it SHOULD<a id="Appendix_A_Target_41"></a><a aria-label="Product behavior note 41" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_41" data-linktype="relative-path">&lt;41&gt;</a> return NERR_Success.</p><p>The server SHOULD<a id="Appendix_A_Target_42"></a><a aria-label="Product behavior note 42" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_42" data-linktype="relative-path">&lt;42&gt;</a> enforce
security measures to verify that the caller has authorization to execute this
routine. If the server enforces security measures and the caller does not have
the required credentials, the server SHOULD fail the call with
ERROR_ACCESS_DENIED. Specifications for determining the identity of the caller
for the purpose of performing an access check are in <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>
section <span><a href="../ms-rpce/0e5b0e1c-0ba5-4342-bc36-30c66a9d07fd" data-linktype="relative-path">3.3.3.1.3</a></span>.</p><p>The <i>TransportInfo</i> parameter specifies details about
the transport protocol that is to be enabled. If any of the input parameters
are invalid, the server MUST return ERROR_INVALID_PARAMETER. If the caller has
passed the <i>ErrorParameter</i> parameter, the server MUST return the
zero-based index of the first member of the structure the <i>TransportInfo</i>
parameter points to that was invalid.</p><p>If this method call is successful, the server MUST store
values from members of the <b>WKSTA_TRANSPORT_INFO_0</b> structure passed in
the <i>TransportInfo</i> parameter into the ADM elements for each transport in <b>TransportList</b>
(section <span><a href="8bf313ce-36c1-4b77-a4c4-a3cd270e9f40" data-linktype="relative-path">3.2.1.4</a></span>) as follows:</p><ul><li><p><span><span> 
</span></span><b>wkti0_transport_address</b> stored in <b>Transport.Address</b></p>
</li><li><p><span><span> 
</span></span><b>wkti0_transport_name</b> stored in <b>Transport.Name</b></p>
</li><li><p><span><span> 
</span></span><b>wkti0_number_of_vcs</b> stored in <b>Transport.VC_Count</b></p>
</li><li><p><span><span> 
</span></span><b>wkti0_wan_ish</b> stored in <b>Transport.Wannish</b></p>
</li></ul></div>