Skip to content

Latest commit

 

History

History
158 lines (88 loc) · 7.26 KB

rtmdeleteroute.md

File metadata and controls

158 lines (88 loc) · 7.26 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
RtmDeleteRoute function (Rtm.h)
The RtmDeleteRoute function deletes a route entry.
a98026e9-40f5-42e9-943c-dfc561feef6d
RtmDeleteRoute function RAS
apiref
RtmDeleteRoute
Rtm.dll
DllExport
reference
05/31/2018

RtmDeleteRoute function

[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