Platform SDK: Network Management

NetWkstaTransportAdd

The NetWkstaTransportAdd function binds (or connects) the redirector to the transport. The redirector is the software on the client computer which generates file requests to the server computer.

Security Requirements

Only members of the Administrators local group can successfully execute the NetWkstaTransportAdd function.

NET_API_STATUS NetWkstaTransportAdd(
  LPWSTR servername,  
  DWORD level,        
  LPBYTE buf,         
  LPDWORD parm_err    
);

Parameters

servername
[in] Pointer to a Unicode string specifying the name of the remote server on which the function is to execute. The string must begin with \\. If this parameter is NULL, the local computer is used.
level
[in] Specifies the information level of the data. This parameter can be the following value.
Value Meaning
0 Specifies workstation transport protocol information. The buf parameter points to a WKSTA_TRANSPORT_INFO_0 structure.

buf
[in] Pointer to the buffer that specifies the data. The format of this data depends on the value of the level parameter.
parm_err
[out] Pointer to a DWORD value that receives the index of the first parameter that causes the ERROR_INVALID_PARAMETER error. If this parameter is NULL, the index is not returned on error.

Return Values

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value can be one of the following error codes.

Value Meaning
ERROR_ACCESS_DENIED The user does not have access to the requested information.
ERROR_INVALID_LEVEL The level parameter, which indicates what level of data structure information is available, is invalid.
ERROR_INVALID_PARAMETER One of the function parameters is invalid.

Remarks

If the NetWkstaTransportAdd function returns ERROR_INVALID_PARAMETER, you can use the parm_err parameter to indicate the member of the WKSTA_TRANSPORT_INFO_0 structure that is invalid. The following table lists the values that can be returned in the parm_err parameter and the corresponding structure member that is in error.

Value Member
TRANSPORT_QUALITYOFSERVICE_PARMNUM wkti0_quality_of_service
TRANSPORT_NAME_PARMNUM wkti0_transport_name

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Lmwksta.h; include Lm.h.
  Library: Use Netapi32.lib.

See Also

Network Management Overview, Network Management Functions, Server and Workstation Transport Functions, NetWkstaTransportDel, WKSTA_TRANSPORT_INFO_0