Platform SDK: Network Management

NetServerTransportAddEx

The NetServerTransportAddEx function binds the specified server to the transport protocol. This extended function allows the calling application to specify the SERVER_TRANSPORT_INFO_1, SERVER_TRANSPORT_INFO_2, and SERVER_TRANSPORT_INFO_3 information levels.

Security Requirements

Only members of the Administrators or Account Operators local group can successfully execute the NetServerTransportAddEx function.

NET_API_STATUS NetServerTransportAddEx(
  LPSTR servername, 
  DWORD level, 
  LPBYTE bufptr 
);

Parameters

servername
[in] Pointer to a null-terminated character 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 a DWORD value that indicates the information level of the data. This parameter can be one of the following values.
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.
1 Specifies information about the transport protocol, including name, address, network location, and domain. The bufptr parameter points to a SERVER_TRANSPORT_INFO_1 structure.
2 Specifies the same information as level 1, with the addition of an svti2_flags member. The bufptr parameter points to a SERVER_TRANSPORT_INFO_2 structure.
3 Specifies the same information as level 2, with the addition of credential information. The bufptr parameter points to a SERVER_TRANSPORT_INFO_3 structure.

bufptr
[in] Pointer to the buffer that contains the data. The format of this data depends on the value of the level parameter.

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_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 The specified parameter is invalid.
ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available.

Remarks

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

The NetServerComputerNameAdd function is a utility function. It combines the functionality of the NetServerTransportEnum function and the NetServerTransportAddEx function, allowing you to specify an emulated server name.

Requirements

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

See Also

Network Management Overview, Network Management Functions, Server and Workstation Transport Functions, NetServerTransportEnum, NetServerTransportAdd, NetServerComputerNameAdd, NetServerComputerNameDel, NetServerTransportDel, SERVER_TRANSPORT_INFO_0, SERVER_TRANSPORT_INFO_1, SERVER_TRANSPORT_INFO_2, SERVER_TRANSPORT_INFO_3