The NdisWriteConfiguration function writes a caller-supplied value for a specified entry into the registry. This function must be invoked serially with respect to itself and the NdisReadConfiguration function.
Syntax
VOID NdisWriteConfiguration(
[out] PNDIS_STATUS Status,
[in] NDIS_HANDLE ConfigurationHandle,
[in] PNDIS_STRING Keyword,
[in] PNDIS_CONFIGURATION_PARAMETER ParameterValue
);
Parameters
[out] Status
指向调用方提供的变量的指针,在此变量中,此函数将调用的状态作为下列值之一返回:
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 无法分配资源(通常是足够的内存)将请求的信息传输到注册表。
NDIS_STATUS_FAILURE
无法编写请求的信息。
[in] ConfigurationHandle
The handle to a registry key that was returned by the NdisOpenConfigurationEx, NdisOpenConfigurationKeyByIndex, or NdisOpenConfigurationKeyByName function.
[in] Keyword
指向描述调用方提供的计数字符串的NDIS_STRING类型的指针,该字符串在系统默认字符集中指定要为其写入值的条目的名称。 对于 Microsoft Windows 2000 及更高版本的驱动程序,此字符串包含 Unicode 字符。 That is, for Windows 2000 and later, NDIS defines the NDIS_STRING type as a UNICODE_STRING type.
[in] ParameterValue
指向调用方提供的指针 NDIS_CONFIGURATION_PARAMETER structure.
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. 此类名称是 Unicode 字符的计数序列,以 null 字符结尾。
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 the NdisCloseConfiguration function. 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 using the AddReg directive in the driver's INF file.
有关 Windows 2000 及更高版本的安装和安装文件的详细信息,请参阅 设备安装概述。
Requirements
| Requirement | Value |
|---|---|
| 最低支持的客户端 | Windows Vista 中支持 NDIS 6.0 和 NDIS 5.1 驱动程序(请参阅 NdisWriteConfiguration (NDIS 5.1)。 Windows XP 中支持 NDIS 5.1 驱动程序(请参阅 NdisWriteConfiguration (NDIS 5.1)。 |
| Target Platform | Universal |
| Header | ndis.h (包括 Ndis.h) |
| Library | Ndis.lib |
| IRQL | PASSIVE_LEVEL |
| DDI 符合性规则 | Irql_Miscellaneous_Function(ndis) |