NdisOpenConfigurationKeyByIndex (NDIS 5.1) function
Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
NdisOpenConfigurationKeyByIndex opens a subkey of a given open registry key designated by a caller-supplied handle.
VOID NdisOpenConfigurationKeyByIndex( _Out_ PNDIS_STATUS Status, _In_ NDIS_HANDLE ConfigurationHandle, _In_ ULONG Index, _Out_ PNDIS_STRING KeyName, _Out_ PNDIS_HANDLE KeyHandle );
- Status [out]
Pointer to a caller-supplied variable in which this function returns the status of its attempt to open the designated registry key. Possible return values are one of the following:
- ConfigurationHandle [in]
- Index [in]
Specifies the index of the subkey to be opened. This zero-based value designates the subkey to be opened under the key already opened with ConfigurationHandle.
- KeyName [out]
Pointer to an NDIS_STRING type containing a caller-supplied buffer in which this functions returns a counted string in the system-default character set. This string specifies the name of the opened subkey if the call succeeds. For Windows 2000 and later drivers, this string contains Unicode characters. That is, for Windows 2000 and later, NDIS defines the NDIS_STRING type as a UNICODE_STRING type.
- KeyHandle [out]
Pointer to a caller-supplied variable in which this function returns a handle to the opened subkey if the call succeeds.
NdisOpenConfigurationKeyByIndex allows a driver to access configuration information that its installation file stored in a registry subkey.
Note that the ConfigurationHandle passed in to NdisOpenConfigurationKeyByIndex can be any valid handle to a registry key already opened by the caller. NdisOpenConfigurationKeyByIndex returns configuration information for subkeys relative to any valid ConfigurationHandle.
Since NdisOpenConfigurationKeyByIndex references a subkey through an index, the driver does not have to specify subkey names. A driver can sequence through a set of registry subkeys by repeatedly calling NdisOpenConfigurationKeyIndex after incrementing the index until the function returns NDIS_STATUS_FAILURE, thereby indicating that there are no more subkeys to open.
After a driver has consumed and, possibly, modified the configuration information stored in the registry, it must call NdisCloseConfiguration to release the handle obtained from NdisOpenConfigurationKeyByIndex. NdisCloseConfiguration also frees any temporary storage NDIS allocated for the driver's calls to NdisReadConfiguration, NdisReadNetworkAddress, and/or NdisWriteConfiguration with the SubKeyHandle returned by NdisOpenConfigurationKeyByIndex.