NdisIfAllocateNetLuidIndex function (ndis.h)
The NdisIfAllocateNetLuidIndex function allocates a NET_LUID index for an NDIS network interface provider.
Syntax
NDIS_STATUS NdisIfAllocateNetLuidIndex(
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.
[out] 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:
Return code | Description |
---|---|
|
The operation completed successfully. |
|
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
Requirement | Value |
---|---|
Minimum supported client | Supported in NDIS 6.0 and later. |
Target Platform | Desktop |
Header | ndis.h (include Ndis.h) |
Library | Ndis.lib |
IRQL | PASSIVE_LEVEL |
DDI compliance rules | Irql_Interfaces_Function(ndis) |