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

RtmDeleteRoute function (Rtm.h)

· 52CE 我爱测

The RtmDeleteRoute function deletes a route entry.

[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 RtmDeleteRoute function deletes a route entry.

Syntax

DWORD RtmDeleteRoute(
  _In_  HANDLE ClientHandle,
  _In_  PVOID  Route,
  _Out_ DWORD  Flags,
  _Out_ PVOID  CurBestRoute
);

Parameters

ClientHandle [in]

Handle that identifies the client and therefore the routing protocol of the added or updated route. Obtain this handle by calling RtmRegisterClient.

Route [in]

Pointer to a protocol-family-specific structure that specifies the new or updated route. The following fields are used by the routing table manager to update the routing table:

Value Meaning
RR_Network Specifies the destination network number.
RR_InterfaceID Specifies the index of the interface through which the route was received.
RR_NextHopAddress Specifies the network address of the next-hop router.

Flags [out]

Pointer to a set of flags that indicate the type of the change message, and what information was placed in the provided buffers. This parameter is one of the following values.

Flags Meaning
RTM_NO_CHANGE Deleting the route did not affect the best route to any destination network. In other words, another entry represents a route to the same destination network and has a lower metric.
RTM_ROUTE_DELETED The route deleted was the only route available for a particular destination network.
RTM_ROUTE_CHANGED After this route was deleted, another route became the best route to a particular destination network. CurBestRoute points to the information for the new best route.

CurBestRoute [out]

Pointer to a structure that receives the current best-route information, if any. The type of the structure is specific to the protocol family, for example, IP or IPX.

This parameter is optional. If the caller specifies NULL for this parameter, the current best-route information is not returned.

Return value

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is one of the following error codes.

Value Description
ERROR_INVALID_HANDLE The client handle parameter is not a valid handle.
ERROR_INVALID_PARAMETER The route structure pointed to by the Route parameter contains a member value.
ERROR_NO_SUCH_ROUTE There are no entries in the routing table that match the parameters of the specified route.
ERROR_NO_SYSTEM_RESOURCES There are insufficient resources to perform the operation.

Remarks

The function generates a route-change message if the best route to a destination network has changed as the result of the deletion. However, the route-change message is not sent to the client that makes this call. Instead, relevant information is returned by this function directly to that 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

RtmAddRoute

RtmDequeueRouteChangeMessage

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)

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

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