The NdisIfAllocateNetLuidIndex function allocates a NET_LUID index for an NDIS network interface provider.
NDIS_STATUS NdisIfAllocateNetLuidIndex( NET_IFTYPE ifType, PUINT32 pNetLuidIndex );
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.
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.
NdisIfAllocateNetLuidIndex returns one of the following values:
||The operation completed successfully.|
||The operation failed because of insufficient resources.|
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.
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.
|Minimum supported client||Supported in NDIS 6.0 and later.|
|Header||ndis.h (include Ndis.h)|
|DDI compliance rules||Irql_Interfaces_Function|