<div class="content" name="NetrWkstaTransportDel" uuid="2a8ab09b-ebbf-43b8-8c0d-1e14216567bf"><p>The <b>NetrWkstaTransportDel</b> method disables the use of
a transport protocol by the <a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625" data-linktype="relative-path">SMB</a>
<a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_15c89cb5-6767-49e7-b461-66acaf6c06c8" data-linktype="relative-path">network redirector</a> on a
remote computer. The transport can be re-enabled by calling the<b>
NetrWkstaTransportAdd</b> method (section <a href="e5864f30-d8c1-4693-ad9a-c142e8eb3afb" data-linktype="relative-path">3.2.4.5</a>).</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 <a href="9ef94a11-0e5c-49d7-9ac7-68d6f03565de" data-linktype="relative-path">2.2.2.1</a>)
that identifies the server. The <a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a> MUST map this
structure to an <a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a>
binding <a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_5044babb-08e3-4bb9-bc12-fe8f542b05ee" data-linktype="relative-path">handle</a> (<a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a> 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>USE_NOFORCE 0x00000000</td>
  <td>Do not disconnect or close the open handles if open handles are using the transport protocol.</td>
 </tr><tr>
  <td>USE_FORCE 0x00000001</td>
  <td>Same as 0x00000000 (USE_NOFORCE); do not disconnect or close the open handles if open handles are using the transport protocol.</td>
 </tr><tr>
  <td>USE_LOTS_OF_FORCE 0x00000002</td>
  <td>Forcefully close any open handles and disable the specified transport protocol from the SMB network redirector.</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 (<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>).</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value/code</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>NERR_Success 0x00000000</td>
  <td>The operation completed successfully.</td>
 </tr><tr>
  <td>ERROR_ACCESS_DENIED 0x00000005</td>
  <td>Access is denied.</td>
 </tr><tr>
  <td>ERROR_INVALID_PARAMETER 0x00000057</td>
  <td>One of the function parameters is invalid.</td>
 </tr><tr>
  <td>ERROR_OPEN_FILES 0x00002401</td>
  <td>There are open files, or printer handles are using the transport protocol pending on this connection.</td>
 </tr><tr>
  <td>ERROR_DEVICE_IN_USE 0x00002404</td>
  <td>The device or open directory handle is using the transport protocol and cannot be disconnected.</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 (<a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>
section <a href="../ms-rpce/0e5b0e1c-0ba5-4342-bc36-30c66a9d07fd" data-linktype="relative-path">3.3.3.1.3</a>.</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>