<div class="content"><p> </p><p>The <b>NetrWkstaTransportDel</b> method disables the use of
a transport protocol by 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> on a remote computer. The transport can be re-enabled by
calling the<b> NetrWkstaTransportAdd</b> method (section <span><a href="e5864f30-d8c1-4693-ad9a-c142e8eb3afb" data-linktype="relative-path">3.2.4.5</a></span>).</p><dl>
<dd>
<div><pre> unsigned long NetrWkstaTransportDel(
   [in, string, unique] WKSSVC_IDENTIFY_HANDLE ServerName,
   [in, string, unique] wchar_t* TransportName,
   [in] unsigned long ForceLevel
 );
</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 server. 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>TransportName: </b>A pointer to a string that
specifies the name of the transport protocol to disconnect from the SMB network
redirector.</p><p><b>ForceLevel: </b>The action to take if there are
handles open to files or printers using the transport protocol. This parameter
MUST be one of the following values: </p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value/code</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>USE_NOFORCE</p>
  <p>0x00000000</p>
  </td>
  <td>
  <p>Do not disconnect or close the open handles if open
  handles are using the transport protocol.</p>
  </td>
 </tr><tr>
  <td>
  <p>USE_FORCE</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>Same as 0x00000000 (USE_NOFORCE); do not disconnect or
  close the open handles if open handles are using the transport protocol.</p>
  </td>
 </tr><tr>
  <td>
  <p>USE_LOTS_OF_FORCE</p>
  <p>0x00000002</p>
  </td>
  <td>
  <p>Forcefully close any open handles and disable the
  specified transport protocol from the SMB network redirector.</p>
  </td>
 </tr></tbody></table>
</dd></dl><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 invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_OPEN_FILES</p>
  <p>0x00002401</p>
  </td>
  <td>
  <p>There are open files, or printer handles are using the
  transport protocol pending on this connection.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_DEVICE_IN_USE</p>
  <p>0x00002404</p>
  </td>
  <td>
  <p>The device or open directory handle is using the
  transport protocol and cannot be disconnected.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>If the <i>ForceLevel</i> parameter does not equal
0x00000000, 0x00000001, or 0x00000002, the server MUST fail the call with
ERROR_INVALID_PARAMETER. If the <i>ForceLevel</i> parameter is 0x00000000 or
0x00000001 and any open directory handle is using the transport protocol
provided in the <i>TransportName</i> field, the server MUST fail the call with
ERROR_DEVICE_IN_USE. If the <i>ForceLevel</i> parameter is 0x00000000 or
0x00000001 and any open files or printer handles are using the transport
protocol provided in the <i>TransportName</i> field, fail the call with
ERROR_OPEN_FILES.</p><p>If the server does not support this method, it SHOULD<a id="Appendix_A_Target_43"></a><a aria-label="Product behavior note 43" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_43" data-linktype="relative-path">&lt;43&gt;</a> return NERR_Success if the <i>ForceLevel</i>
parameter is valid. If the server does support this method, it MUST be
processed as follows.</p><p>The server SHOULD<a id="Appendix_A_Target_44"></a><a aria-label="Product behavior note 44" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_44" data-linktype="relative-path">&lt;44&gt;</a> enforce
security measures to verify that the caller has the required permissions to
execute this routine. If the server enforces security measures and the caller
does not have the required credentials, the server MUST 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>If any open file or printer handles are using the transport
protocol that this call is trying to disable, the server behavior MUST depend
on the value of the <i>ForceLevel</i> parameter. If the <i>ForceLevel</i>
parameter is 0x00000000 or 0x00000001, the server MUST fail the call. If the <i>ForceLevel</i>
parameter is 0x00000002, the server MUST forcefully close all open handles and
disable the transport protocol.</p><p>If this method call is successful, the server MUST remove
this protocol from its list of currently enabled transport protocols.</p></div>