Previous Next

NdisOpenConfigurationKeyByIndex

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
    );

Parameters

Status
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:
NDIS_STATUS_SUCCESS
NDIS has initialized accessed to the subkey specified by KeyName and Index.
NDIS_STATUS_FAILURE
The key could not be opened.
ConfigurationHandle
The handle to a registry key for which a subkey is to be opened. Usually ConfigurationHandle was returned by NdisOpenConfiguration or NdisOpenProtocolConfiguration.
Index
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
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
Pointer to a caller-supplied variable in which this function returns a handle to the opened subkey if the call succeeds.

Headers

Declared in Ndis.h. Include Ndis.h.

Comments

NdisOpenConfigurationKeyByIndex allows a driver to access configuration information that its installation script 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.

Callers of NdisOpenConfigurationKeyByIndex run at IRQL < DISPATCH_LEVEL.

See Also

ANSI_STRING, MiniportInitialize, NdisCloseConfiguration, NdisOpenConfiguration, NdisOpenConfigurationKeyByName, NdisOpenProtocolConfiguration, NdisReadConfiguration, NdisWriteConfiguration, ProtocolBindAdapter, UNICODE_STRING