Platform SDK: Network Management

NetMessageNameAdd

The NetMessageNameAdd function registers a message alias in the message name table. The function requires that the messenger service be started.

Security Requirements

Only members of the Administrators local group can successfully execute the NetMessageNameAdd function on a remote server.

NET_API_STATUS NetMessageNameAdd(
  LPCWSTR servername,  
  LPCWSTR msgname      
);

Parameters

servername
[in] Pointer to a constant Unicode 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.
msgname
[in] Pointer to a constant Unicode string specifying the message alias to add. The string cannot be more than 15 characters long.

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_INVALID_PARAMETER The specified parameter is invalid.
NERR_AlreadyExists The message alias already exists on this computer. For more information, see the following Remarks section.
NERR_DuplicateName The name specified is already in use as a message alias on the network.
NERR_NetworkError A general failure occurred in the network hardware.
NERR_TooManyNames The maximum number of message aliases has been exceeded.

Remarks

The forward action flag is no longer a parameter to the LAN Manager 2.x NetMessageNameAdd function because message forwarding is no longer supported. If the NetMessageNameAdd function detects that a forwarded version of msgname exists on the network, the function will fail with error NERR_Already_Exists.

Requirements

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

See Also

Network Management Overview, Network Management Functions, Message Functions, NetMessageNameDel