Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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 |
---|---|
|
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 |
---|---|
|
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
Requirement | Value |
---|---|
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 |