RtmLockNextHop function (rtmv2.h)

The RtmLockNextHop function locks or unlocks a next hop. This function should be called by the next hop's owner to lock the next hop before making changes to the next hop. A pointer to the next hop is returned.

Syntax

DWORD RtmLockNextHop(
  [in]  RTM_ENTITY_HANDLE  RtmRegHandle,
  [in]  RTM_NEXTHOP_HANDLE NextHopHandle,
  [in]  BOOL               Exclusive,
  [in]  BOOL               LockNextHop,
  [out] PRTM_NEXTHOP_INFO  *NextHopPointer
);

Parameters

[in] RtmRegHandle

Handle to the client obtained from a previous call to RtmRegisterEntity.

[in] NextHopHandle

Handle to the next hop to lock or unlock.

[in] Exclusive

Specifies whether to lock or unlock the next hop in an exclusive (TRUE) or shared (FALSE) mode.

[in] LockNextHop

Specifies whether to lock or unlock the next hop. Specify TRUE to lock the next hop; specify FALSE to unlock it.

[out] NextHopPointer

On input, NextHopPointer is a pointer to NULL.

On output, if the client owns the next hop, NextHopPointer receives a pointer to the next-hop; otherwise, NextHopPointer remains unchanged.

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 Meaning
ERROR_ACCESS_DENIED
The calling client does not own this next hop.
ERROR_NOT_FOUND
The specified next hop was not found.
 
 

Remarks

Clients cannot change the NextHopAddress and InterfaceIndex members of the RTM_NEXTHOP_INFO structure; these values are used to uniquely identify a next hop.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header rtmv2.h
Library Rtm.lib
DLL Rtm.dll

See also

RTM_NEXTHOP_INFO

RtmAddNextHop

RtmDeleteNextHop

RtmFindNextHop

RtmGetNextHopPointer