MgmTakeInterfaceOwnership function (mgm.h)

The MgmTakeInterfaceOwnership function is called by a client (such as a routing protocol) when it is enabled on an interface.

Only one client can take ownership of a given interface at any time. The only exception to this rule is the IGMP. IGMP can coexist with another client on an interface.

Syntax

DWORD MgmTakeInterfaceOwnership(
  [in] HANDLE hProtocol,
  [in] DWORD  dwIfIndex,
  [in] DWORD  dwIfNextHopAddr
);

Parameters

[in] hProtocol

Handle to the protocol obtained from a previous call to MgmRegisterMProtocol.

[in] dwIfIndex

Specifies the index of the interface of which to take ownership.

[in] dwIfNextHopAddr

Specifies the address of the next hop that corresponds to the index specified by dwIfIndex. The dwIfIndex and dwIfNextHopIPAddr parameters uniquely identify a next hop on point-to-multipoint interfaces. A point-to-multipoint interface is a connection where one interface connects to multiple networks. Examples of point-to-multipoint interfaces include non-broadcast multiple access (NBMA) interfaces and the internal interface on which all dial-up clients connect.

For broadcast interfaces (such as Ethernet interfaces) or point-to-point interfaces, which are identified by only the value of dwIfIndex, specify zero.

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_ALREADY_EXISTS
The specified interface is already owned by another routing protocol.
ERROR_CAN_NOT_COMPLETE
Could not complete the call to this function.
ERROR_INVALID_PARAMETER
Invalid handle to a client.
ERROR_NOT_ENOUGH_MEMORY
Not enough memory to complete this operation.
 
 

Remarks

A client must take ownership of an interface only after registering itself with the multicast group manager, but before it adds group membership entries.

Requirements

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

See also

MgmGetProtocolOnInterface

MgmRegisterMProtocol

MgmReleaseInterfaceOwnership