Share via


NdisOpenConfigurationKeyByIndex (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

VOID NdisOpenConfigurationKeyByIndex(
  PNDIS_STATUS Status,
  NDIS_HANDLE ConfigurationHandle,
  ULONG Index,
  PNDIS_STRING KeyName,
  PNDIS_HANDLE KeyHandle
);

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.
  • 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 Value

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

Header ndis.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Library Functions
NdisCloseConfiguration
NdisOpenConfiguration
NdisOpenConfigurationKeyByName
NdisOpenProtocolConfiguration
NdisReadConfiguration
NdisReadNetworkAddress
NdisWriteConfiguration