Access the Registry with NDIS 6.0 Functions (Compact 2013)

3/26/2014

The NDIS 6.0 NdisOpenConfigurationEx function replaces the NDIS 5.xNdisOpenConfiguration function. NdisOpenConfigurationEx provides a configuration handle to the registry location where the miniport driver's configuration parameters are stored. You use this configuration handle to access registry settings for your miniport driver.

The following table shows which API elements have been renamed and/or changed for NDIS 6.0.

NDIS 5.x

NDIS 6.0

NdisOpenConfiguration

NdisOpenConfigurationEx

To update registry access functionality for NDIS 6.0

  1. Remove calls to NdisOpenConfiguration.

  2. Use NdisOpenConfigurationEx to create a configuration handle to the registry.

The following example shows how to initialize the configuration object and call NdisOpenConfigurationEx.

Important

For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.

NDIS_HANDLE MyRegistryConfigurationHandle;
NDIS_CONFIGURATION_OBJECT MyConfigObject;

// Initialize the configuration object with the adapter handle:
MyConfigObject.Header.Type = NDIS_OBJECT_TYPE_CONFIGURATION_OBJECT;
MyConfigObject.Header.Revision = NDIS_CONFIGURATION_OBJECT_REVISION_1;
MyConfigObject.Header.Size = sizeof( NDIS_CONFIGURATION_OBJECT );
MyConfigObject.NdisHandle = pAdapter->MiniportAdapterHandle;
MyConfigObject.Flags = 0;

// Get the configuration handle:
Status = NdisOpenConfigurationEx( 
    &MyConfigObject, &MyRegistryConfigurationHandle);

In the preceding example, NdisOpenConfigurationEx returns the configuration handle in the MyRegistryConfigurationHandle variable. You use this returned configuration handle in subsequent calls to the NdisReadConfiguration and NdisWriteConfiguration functions. For more information about the NDIS configuration interface, see NDIS Configuration Interface.

See Also

Concepts

Modify Adapter Initialization Functionality for NDIS 6.0