<div class="content"><p> </p><p>The <b>NetrWkstaTransportEnum</b> method provides details
about the transport protocols currently enabled for use 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.</p><dl>
<dd>
<div><pre> unsigned long NetrWkstaTransportEnum(
   [in, string, unique] WKSSVC_IDENTIFY_HANDLE ServerName,
   [in, out] LPWKSTA_TRANSPORT_ENUM_STRUCT TransportInfo,
   [in] unsigned long PreferredMaximumLength,
   [out] unsigned long* TotalEntries,
   [in, out, unique] unsigned long* ResumeHandle
 );
</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>TransportInfo: </b>A pointer to a buffer that
receives a <b>WKSTA_TRANSPORT_ENUM_STRUCT</b> structure (section <span><a href="2d417023-b057-4949-a8a8-236806570acf" data-linktype="relative-path">2.2.5.16</a></span>),
which contains a <b>Level</b> member that MUST be set to zero.</p><p><b>PreferredMaximumLength: </b>The number of bytes to
allocate for the return data.</p><p><b>TotalEntries: </b>The total number of entries that
could have been enumerated from the current resume position. This field can be
set to any value when sent and MUST be ignored on receipt.</p><p><b>ResumeHandle: </b>A pointer that, if specified,
and if this method returns NERR_BufTooSmall, MUST receive an
implementation-specific value<a id="Appendix_A_Target_37"></a><a aria-label="Product behavior note 37" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_37" data-linktype="relative-path">&lt;37&gt;</a> that can
be passed in subsequent calls to this method, to continue with the enumeration
of currently enabled transport protocols.</p><dl>
<dd>
<p>If this parameter is NULL or points to zero, the
enumeration MUST start from the beginning of the list of currently enabled
transport protocols.</p>
</dd></dl><p><b>Return Values: </b>When the message processing
result matches 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_LEVEL</p>
  <p>0x0000007C</p>
  </td>
  <td>
  <p>The information level is invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>NERR_BufTooSmall</p>
  <p>0x0000084B</p>
  </td>
  <td>
  <p>More entries are available. The <i>TransportInfo</i>
  buffer was not large enough to contain all the entries. </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>The server SHOULD<a id="Appendix_A_Target_38"></a><a aria-label="Product behavior note 38" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_38" data-linktype="relative-path">&lt;38&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>For any other conditions, this method MUST return any other
value, and the client MUST treat all other values the same.</p><p>If the <b>Level</b> member in the <b>WKSTA_TRANSPORT_ENUM_STRUCT</b>
structure passed in the <i>TransportInfo</i> parameter does not equal
0x00000000, the server MUST fail the call.</p><p>If the <b>Level</b> member is 0x00000000, the server MUST
return an array of details about the transport protocols currently enabled for
use by the SMB network redirector by filling the <b>WKSTA_TRANSPORT_INFO_0_CONTAINER</b>
structure <b>WkstaTransportInfo</b> member (section <span><a href="d26f115b-ea43-4edf-ac95-7d92b08b9c2e" data-linktype="relative-path">2.2.5.15</a></span>) of the <i>TransportInfo</i>
parameter 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> set to <b>Transport.Address</b></p>
</li><li><p><span><span> 
</span></span><b>wkti0_transport_name</b> set to <b>Transport.Name</b></p>
</li><li><p><span><span> 
</span></span><b>wkti0_number_of_vcs</b> set to <b>Transport.VC_Count</b></p>
</li><li><p><span><span> 
</span></span><b>wkti0_wan_ish</b> set to <b>Transport.Wannish</b></p>
</li></ul><p>If the <i>PreferredMaximumLength</i> parameter equals <b>MAX_PREFERRED_LENGTH</b>
(section <span><a href="68338fae-259c-4a06-8793-9be93cf492ff" data-linktype="relative-path">2.2.1.3</a></span>), the
server MUST return all the requested data. If the <i>PreferredMaximumLength</i>
is insufficient to hold all the entries, the server MUST return the maximum
number of entries that fit in the <i>TransportInfo</i> buffer and return
NERR_BufTooSmall.</p><p>The following rules specify processing of the <i>ResumeHandle</i>
parameter:</p><ul><li><p><span><span> 
</span></span>If the <i>ResumeHandle</i> parameter is either NULL or points to
0x00000000, the enumeration MUST start from the beginning of the list of the currently
enabled transport protocols. <a id="Appendix_A_Target_39"></a><a aria-label="Product behavior note 39" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_39" data-linktype="relative-path">&lt;39&gt;</a></p>
</li><li><p><span><span> 
</span></span>If the <i>ResumeHandle</i> parameter is nonzero, the server MUST
begin enumeration based on the value of <i>ResumeHandle</i>. The server is not
required to maintain any state between calls invoking the <b>NetrWkstaTransportEnum</b>
method.</p>
</li><li><p><span><span> 
</span></span>If the client specified a <i>ResumeHandle</i>, and if the server
returns NERR_BufTooSmall, the server MUST set <i>ResumeHandle</i> to an
implementation-specific value that allows the server to continue with this
enumeration on a subsequent call to this method, using the same value for <i>ResumeHandle</i>.</p>
</li></ul><p>The server is not required to maintain any state between
calls to the <b>NetrWkstaTransportEnum</b> method. If the server returns
NERR_Success, it MUST set the <i>TotalEntries</i> parameter to equal the total
number of entries that could have been enumerated from the current resume
position. If the server returns NERR_BufTooSmall, it SHOULD set the <i>TotalEntries</i>
value to the total number of entries that could have been enumerated from the
current resume position.<a id="Appendix_A_Target_40"></a><a aria-label="Product behavior note 40" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_40" data-linktype="relative-path">&lt;40&gt;</a></p></div>