Partager via


3.2.4.5 NetrWkstaTransportAdd (Opnum 6)

The NetrWkstaTransportAdd method enables the SMB network redirector to use a transport protocol on a remote computer.

 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
 );

ServerName: A WKSSVC_IDENTIFY_HANDLE structure (section 2.2.2.1) that identifies the server (2). The client MUST map this structure to an RPC binding handle ([C706] sections 4.3.5 and 5.1.5.2). The server MUST ignore this parameter.

Level: The information level of the data. Level is set to zero, meaning the TransportInfo parameter points to a WKSTA_TRANSPORT_INFO_0 structure (section 2.2.5.8).

TransportInfo: A pointer to a WKSTA_TRANSPORT_INFO_0 structure.

ErrorParameter: A pointer to a value that receives the index, starting at 0, of the first member of the WKSTA_TRANSPORT_INFO_0 structure that causes the function to return ERROR_INVALID_PARAMETER. If this parameter is NULL, the index is not returned on error.

Return Values: When the message processing result meets the description in column two of the following table, this method MUST return one of the following values ([MS-ERREF] section 2.2).

Value/code

Meaning

NERR_Success

0x00000000

The operation completed successfully.

ERROR_ACCESS_DENIED

0x00000005

Access is denied.

ERROR_INVALID_PARAMETER

0x00000057

One of the function parameters is not valid.

ERROR_INVALID_LEVEL

0x0000007C

The information level is invalid.

Any other return value MUST conform to the error code requirements in Protocol Details (section 3).

If the Level parameter is not equal to zero, the server MUST fail the call and return ERROR_INVALID_LEVEL.

If the server does not support this method then it SHOULD be processed as follows.

If any of the input parameters are invalid, the server SHOULD return ERROR_INVALID_PARAMETER. Otherwise, it SHOULD<41> return NERR_Success.

The server SHOULD<42> 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 [MS-RPCE] section 3.3.3.1.3.

The TransportInfo 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 ErrorParameter parameter, the server MUST return the zero-based index of the first member of the structure the TransportInfo parameter points to that was invalid.

If this method call is successful, the server MUST store values from members of the WKSTA_TRANSPORT_INFO_0 structure passed in the TransportInfo parameter into the ADM elements for each transport in TransportList (section 3.2.1.4) as follows:

  • wkti0_transport_address stored in Transport.Address

  • wkti0_transport_name stored in Transport.Name

  • wkti0_number_of_vcs stored in Transport.VC_Count

  • wkti0_wan_ish stored in Transport.Wannish