NdisWriteConfiguration (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.

NdisWriteConfiguration writes a caller-supplied value for a specified entry into the registry.

Syntax

VOID NdisWriteConfiguration(
  _Out_ PNDIS_STATUS                  Status,
  _In_  NDIS_HANDLE                   ConfigurationHandle,
  _In_  PNDIS_STRING                  Keyword,
  _In_  PNDIS_CONFIGURATION_PARAMETER ParameterValue
);

Parameters

  • Status [out]
    Pointer to a caller-supplied variable in which this function returns the status of the call as one of the following:

    • NDIS_STATUS_SUCCESS
      The supplied value at ParameterValue was written into the registry. If this is a new entry, the name at Keyword also was written into the registry.

    • NDIS_STATUS_NOT_SUPPORTED
      The supplied ParameterType is invalid.

    • NDIS_STATUS_RESOURCES
      NDIS could not allocate resources, usually enough memory, to transfer the requested information to the registry.

    • NDIS_STATUS_FAILURE
      The requested information could not be written.

  • ConfigurationHandle [in]
    Specifies the handle to a registry key returned by NdisOpenConfiguration to a NIC driver, by NdisOpenProtocolConfiguration to a protocol driver, or by NdisOpenConfigurationKeyByIndex or NdisOpenConfigurationKeyByName to either type of NDIS driver.

  • Keyword [in]
    Pointer to an NDIS_STRING type describing a caller-supplied counted string, in the system-default character set, specifying the name of an entry for which to write the value. 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.

  • ParameterValue [in]
    Pointer to a caller-supplied NDIS_CONFIGURATION_PARAMETER structure, defined as follows:

    typedef struct _NDIS_CONFIGURATION_PARAMETER {
        NDIS_PARAMETER_TYPE ParameterType;
        union {
            ULONG IntegerData;
            NDIS_STRING StringData;
        } ParameterData;
    } NDIS_CONFIGURATION_PARAMETER, *PNDIS_CONFIGURATION_PARAMETER;
    

    The members of this structure can contain the following data:

    • ParameterType
      Specifies the type of the value entry as one of the following:

      NdisParameterBinary

      Specifies a binary value.

      NdisParameterInteger

      Specifies an integer in decimal notation.

      NdisParameterHexInteger

      Specifies an integer in hexadecimal notation.

      NdisParameterString

      Specifies a string of type NDIS_STRING.

      For Windows 2000 and later drivers, this is a counted Unicode string.

      NdisParameterMultiString

      Specifies a multistring parameter of the defined REG_MULTI_SZ type, which is defined in Windows 2000 and later versions.

  • ParameterType
    Specifies the value of the given named entry in the notation of the specified ParameterType. If ParameterType is a string type, this member is an NDIS_STRING type describing a counted string in the system-default character set.

    For Windows 2000 and later drivers, such a string contains Unicode characters.

Return value

None

Remarks

If an entry of the same name as at Keyword already exists under the opened registry key, NdisWriteConfiguration replaces its current value with the caller-supplied value. Otherwise, NdisWriteConfiguration adds a new value entry with the given name and supplied value to the registry.

In the configuration registry of Windows 2000 and later versions, an NDIS Keyword is a synonym for a value entry name. Such a name is a counted sequence of Unicode characters, terminated with a NUL.

NdisWriteConfiguration buffers and copies the caller-supplied string at Keyword and the caller-supplied data specified at ParameterValue. This memory is freed when the driver releases the ConfigurationHandle with NdisCloseConfiguration. The caller of NdisWriteConfiguration is responsible for releasing the buffered string at Keyword and the memory allocated for the NDIS_CONFIGURATION_PARAMETER structure.

As an alternative to calling NdisWriteConfiguration, every NDIS driver can set up configuration information in the registry for itself under the driver's Parameters key using an installation file.

For more information about setup and installation files for Windows 2000 and later versions, see Device Installation Overview.

Requirements

Target platform

Universal

Version

See NdisWriteConfiguration.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

PASSIVE_LEVEL

See also

ANSI_STRING

MiniportInitialize

NdisAnsiStringToUnicodeString

NdisCloseConfiguration

NdisFreeMemory

NdisFreeString

NdisInitAnsiString

NdisInitializeString

NdisInitUnicodeString

NdisOpenConfiguration

NdisOpenConfigurationKeyByIndex

NdisOpenConfigurationKeyByName

NdisOpenProtocolConfiguration

NdisReadConfiguration

NdisUnicodeStringToAnsiString

UNICODE_STRING

 

 

Send comments about this topic to Microsoft