共用方式為


3.1.4.22 NetrServerTransportAdd (Opnum 25)

The NetrServerTransportAdd method binds the server to the transport protocol.

 NET_API_STATUS NetrServerTransportAdd(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in] DWORD Level,
   [in] LPSERVER_TRANSPORT_INFO_0 Buffer
 );

ServerName: An SRVSVC_HANDLE (section 2.2.1.1) pointer that identifies the server. The client MUST map this structure to an RPC binding handle (see [C706] sections 4.3.5 and 5.1.5.2). The server MUST ignore this parameter.

Level: Specifies the information level of the data. This parameter MUST be zero.

Buffer: A pointer to the SERVER_TRANSPORT_INFO_0 structure that describes the data.

Return Values: The method returns 0x00000000 (NERR_Success) to indicate success; otherwise, it returns a nonzero error code. The method can take any specific error code value, as specified in [MS-ERREF] section 2.2. The most common error codes are listed in the following table.

Return value/code

Description

0x00000000

NERR_Success

The client request succeeded.

0x00000005

ERROR_ACCESS_DENIED

Access is denied.

0x00000034

ERROR_DUP_NAME

A duplicate name exists on the network.

0x0000007C

ERROR_INVALID_LEVEL

The system call level is not correct.

0x00000057

ERROR_INVALID_PARAMETER

The parameter is incorrect.

0x00000008

ERROR_NOT_ENOUGH_MEMORY

Not enough storage is available to process this command.

The NetrServerTransportAdd message MUST be processed in the same way as the NetrServerTransportAddEx message, except that it MUST allow only level 0 (that is, SERVER_TRANSPORT_INFO_0). The NetrServerTransportAddEx message is specified in section 3.1.4.23.

The server MAY<92> enforce security measures to verify that the caller has the required permissions to execute this call. If the server enforces these security measures and the caller does not have the required credentials, the server SHOULD<93> fail the call.