NdisOpenConfigurationKeyByIndex (Windows CE 5.0)

Send Feedback

This function opens a sub key of a given open registry key designated by a caller-supplied handle.

VOID NdisOpenConfigurationKeyByIndex(PNDIS_STATUSStatus,NDIS_HANDLEConfigurationHandle,ULONGIndex,PNDIS_STRINGKeyName,PNDIS_HANDLEKeyHandle);

Parameters

  • Status
    [out] Points to a caller-supplied variable in which this function returns the status of its attempt to open the designated registry key.
  • ConfigurationHandle
    [in] The handle to a registry key for which a sub key is to be opened. Usually ConfigurationHandle was returned by NdisOpenConfiguration or NdisOpenProtocolConfiguration.
  • Index
    [in] Specifies the index of the sub key to be opened. This zero-based value designates the sub key to be opened under the key already opened with ConfigurationHandle.
  • KeyName
    [out] Points to a caller-supplied buffer in which this functions returns a counted string in the system-default character set that specifies the name of the opened sub key if the call succeeds.
  • KeyHandle
    [out] Points to a caller-supplied variable in which this function returns a handle to the opened sub key if the call succeeds.

Return Values

The following table shows return values for this function.

Value Description
NDIS_STATUS_SUCCESS NDIS has initialized accessed to the sub key specified by KeyName and Index.
NDIS_STATUS_FAILURE The key could not be opened.

Remarks

NdisOpenConfigurationKeyByIndex allows a driver to access configuration information that its installation script stored in a registry sub key.

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 sub keys relative to any valid ConfigurationHandle.

Because NdisOpenConfigurationKeyByIndex references a sub key through an index, the driver does not have to specify sub key names. A driver can sequence through a set of registry sub keys by repeatedly calling NdisOpenConfigurationKeyIndex after incrementing the index until the function returns NDIS_STATUS_FAILURE, thereby indicating that there are no more sub keys 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.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.

See Also

NdisCloseConfiguration | NdisOpenConfiguration | NdisOpenConfigurationKeyByName | NdisOpenProtocolConfiguration | NdisReadConfiguration | NdisReadNetworkAddress | NdisWriteConfiguration

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.