NdisIfAllocateNetLuidIndex function

The NdisIfAllocateNetLuidIndex 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 [in]

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 [out]

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:

Return codeDescription
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 computer 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 computer 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 it can call NdisIfFreeNetLuidIndex later to free any indexes that are no longer in use. Also, the provider should use the same NET_LUID value whenever it registers the same interface with the NdisIfRegisterInterface function.

Requirements

Target platform

Desktop

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

Irql_Interfaces_Function

See also

NDIS_MAKE_NET_LUID
NdisIfFreeNetLuidIndex
NdisIfRegisterInterface
NET_LUID

 

 

Send comments about this topic to Microsoft

Show: