NetServerTransportAdd function
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 NetServerTransportAdd( _In_ LPWSTR servername, _In_ DWORD level, _In_ LPBYTE bufptr );
Parameters
- servername [in]
-
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.
- level [in]
-
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.
- bufptr [in]
-
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 |
|---|---|
|
The user does not have access to the requested information. |
|
A duplicate name exists on the network. |
|
The domain name could not be found on the network. |
|
The value specified for the level parameter is invalid. |
|
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. |
|
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] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- Network Management Overview
- Network Management Functions
- Server and Workstation Transport Functions
- NetServerComputerNameAdd
- NetServerComputerNameDel
- NetServerTransportAddEx
- NetServerTransportDel
- NetServerTransportEnum
- SERVER_TRANSPORT_INFO_0
- SERVER_TRANSPORT_INFO_1
- SERVER_TRANSPORT_INFO_2
- SERVER_TRANSPORT_INFO_3