NetServerTransportAdd function (lmserver.h)

The NetServerTransportAdd function binds the server to the transport protocol.

The extended function NetServerTransportAddEx allows the calling application to specify the SERVER_TRANSPORT_INFO_1, SERVER_TRANSPORT_INFO_2, and SERVER_TRANSPORT_INFO_3 information levels.

Syntax

NET_API_STATUS NET_API_FUNCTION NetServerTransportAdd(
  [in] LMSTR  servername,
  [in] DWORD  level,
  [in] LPBYTE bufptr
);

Parameters

[in] servername

A pointer to a string that specifies the name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.

[in] level

Specifies the information level of the data. This parameter can be the following value.

Value Meaning
0
Specifies information about the transport protocol, including name, address, and location on the network. The bufptr parameter points to a SERVER_TRANSPORT_INFO_0 structure.

[in] bufptr

A pointer to the buffer that contains the data.

For more information, see Network Management Function Buffers.

Return value

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.

Return code Description
ERROR_ACCESS_DENIED
The user does not have access to the requested information.
ERROR_DUP_NAME
A duplicate name exists on the network.
ERROR_INVALID_DOMAINNAME
The domain name could not be found on the network.
ERROR_INVALID_LEVEL
The value specified for the level parameter is invalid.
ERROR_INVALID_PARAMETER
A parameter is invalid.

This error is returned if the svti0_transportname or svti0_transportaddress member in the SERVER_TRANSPORT_INFO_0 structure pointed to by the bufptr parameter is NULL. This error is also returned if the svti0_transportaddresslength member in the SERVER_TRANSPORT_INFO_0 structure pointed to by the bufptr parameter is zero or larger than MAX_PATH (defined in the Windef.h header file).

This error is also returned for other invalid parameters.

ERROR_NOT_ENOUGH_MEMORY
Insufficient memory is available.

Remarks

Only members of the Administrators or Server Operators local group can successfully execute the NetServerTransportAdd function.

If you add a transport protocol to a server using a call to the NetServerTransportAdd function, the connection will not remain after the server reboots or restarts.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header lmserver.h (include Lm.h)
Library Netapi32.lib
DLL Netapi32.dll

See also

NetServerComputerNameAdd

NetServerComputerNameDel

NetServerTransportAddEx

NetServerTransportDel

NetServerTransportEnum

Network Management Functions

Network Management Overview

SERVER_TRANSPORT_INFO_0

SERVER_TRANSPORT_INFO_1

SERVER_TRANSPORT_INFO_2

SERVER_TRANSPORT_INFO_3

Server and Workstation Transport Functions