NetConfigurationAssignUnicodeString 函数 (netconfiguration.h)

NetConfigurationAssignUnicodeString 函数将指定的 Unicode 字符串分配给注册表中的指定值名称。

语法

NTSTATUS NetConfigurationAssignUnicodeString(
  [_In_] NETCONFIGURATION Configuration,
  [_In_] PCUNICODE_STRING ValueName,
  [_In_] PCUNICODE_STRING Value
);

参数

[_In_] Configuration

表示打开的注册表项的 NETCONFIGURATION 对象的句柄。

[_In_] ValueName

指向包含值名称 的UNICODE_STRING 结构的指针。

[_In_] Value

指向 UNICODE_STRING 结构的指针,该结构包含要分配给 ValueName 指定的值名称的字符串。

返回值

如果操作成功,此函数将返回STATUS_SUCCESS。 否则,此函数可能会返回相应的 NTSTATUS 错误代码。

注解

客户端驱动程序通过调用 NetAdapterOpenConfigurationNetConfigurationOpenSubConfiguration 获取 NETCONFIGURATION 对象的句柄。

如果打开的注册表项下已存在 与 ValueName 同名的条目, NetConfigurationAssignUnicodeString 会将其当前值替换为调用方提供的值。 否则, NetConfigurationAssignUnicodeString 会将具有给定名称和提供值的新值条目添加到注册表。

要求

要求
目标平台 通用
最低 KMDF 版本 1.21
标头 netconfiguration.h (包括 netadaptercx.h)
IRQL PASSIVE_LEVEL