Поделиться через


NdisIfAllocateNetLuidIndex (Compact 2013)

3/26/2014

This function allocates a NET_LUID index for an NDIS network interface provider.

Syntax

NDIS_STATUS
  NdisIfAllocateNetLuidIndex(
    IN NET_IFTYPE  IfType,
    OUT PUINT32  pNetLuidIndex
    );

Parameters

  • IfType
    The Internet Assigned Numbers Authority (IANA) interface type for an index. For example, IF_TYPE_ETHERNET_CSMACD (6) is the value for IfType that is assigned to any Ethernet-like interface. For a list of interface types, see NDIS Interface Types.
  • pNetLuidIndex
    A pointer to a caller-supplied NET_LUID index variable. If allocation is successful, NdisIfAllocateNetLuidIndex sets this variable to the allocated 24-bit NET_LUID index value.

Return Value

NdisIfAllocateNetLuidIndex returns one of the following values:

Value

Description

NDIS_STATUS_SUCCESS

The operation completed successfully.

NDIS_STATUS_RESOURCES

The operation failed because of insufficient resources.

Remarks

NDIS interface providers call the NdisIfAllocateNetLuidIndex function to allocate a NET_LUID index. An interface provider must allocate a NET_LUID index before the interface provider can register an interface.

NdisIfAllocateNetLuidIndex attempts to allocate a 24-bit NET_LUID index that is unique to the local device and is associated with the interface type that the IfType parameter specifies. NDIS records the NET_LUID index in persistent storage so that the index can remain associated with the same interface even after the device restarts. NDIS will not allocate the same NET_LUID index to future callers of NdisIfAllocateNetLuidIndex until after the interface provider calls the NdisIfFreeNetLuidIndex function to free the index.

To build a NET_LUID value from the NET_LUID index and the interface type, an interface provider calls the NDIS_MAKE_NET_LUID macro.

The interface provider must store the NET_LUID values that it allocates in persistent storage. For example, if there is a loss of computer power, the provider should have stored the NET_LUID values in persistent storage so that it can call NdisIfFreeNetLuidIndex later to free any indexes that are no longer being used. Also, the provider should use the same NET_LUID value when it registers the same interface with the NdisIfRegisterInterface function.

Requirements

Header

ndis.h

See Also

Reference

NDIS Network Interface Functions
NDIS_MAKE_NET_LUID
NdisIfFreeNetLuidIndex
NdisIfRegisterInterface

Other Resources

NET_LUID