大网数据广告活动
网络与域名解析

RtmRegisterClient function (Rtm.h)

· 52CE 我爱测

The RtmRegisterClient function registers a client as a handler of the specified protocol. It establishes a route change notification mechanism for the client, and sets protocol options.

[This API has been superseded by the Routing Table Manager Version 2 API and will not be available beyond Windows Server 2003. Applications should use the Routing Table Manager Version 2 API.]

The RtmRegisterClient function registers a client as a handler of the specified protocol. It establishes a route change notification mechanism for the client, and sets protocol options.

Syntax

HANDLE RtmRegisterClient(
  _In_ DWORD  ProtocolFamily,
  _In_ DWORD  RoutingProtocol,
  _In_ HANDLE ChangeEvent,
  _In_ DWORD  Flags
);

Parameters

ProtocolFamily [in]

Specifies the protocol family of the routing protocol to register.

RoutingProtocol [in]

Specifies the routing protocol identifier, the same as that used when registering with the router manager. See RegisterProtocol.

ChangeEvent [in]

Specifies that a best route to a network in the table has changed. The routing table manager signals this event after a change to the best route to any network in the table. See RtmDequeueRouteChangeMessage for more information about route-change notification.

This parameter is optional. If the caller specifies NULL for this parameter, the routing table manager does not notify the client of changes in best route status.

Flags [in]

Specifies miscellaneous options for special handling of the routing protocol. The following value is currently supported.

Flags Meaning
RTM_PROTOCOL_SINGLE_ROUTE The routing table manager keeps only one route per destination network for the routing protocol. In other words, the routing table manager replaces route entries that have the same destination network numbers instead of adding new ones.

Return value

On successful return, a HANDLE value that identifies the client in subsequent calls to the routing table manager.

A NULL handle indicates that the routing table manager was unable to register the client. Call GetLastError to obtain the reason for the failure.

Value Description
ERROR_CLIENT_ALREADY_EXISTS Another client has already registered to handle the specified protocol.
ERROR_INVALID_PARAMETER The specified protocol family is not supported, or the Flags parameter is invalid.
ERROR_NO_SYSTEM_RESOURCES Insufficient resources to carry out the operation.
ERROR_NOT_ENOUGH_MEMORY Insufficient memory to allocate data structures for the client.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows 2000 Server [desktop apps only]
End of server support Windows Server 2003
Header Rtm.h
Library Rtm.lib
DLL Rtm.dll

See also

Routing Table Manager Version 1 Reference

Routing Table Manager Version 1 Functions

GetLastError

RegisterProtocol

RTMv1 Protocol Family Identifiers

RtmDequeueRouteChangeMessage

RtmDeregisterClient

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。