情報
要求されたトピックは次のとおりです。しかし、このトピックはこのライブラリには含まれていません。

WdfRegistryAssignValue メソッド

The WdfRegistryAssignValue method assigns specified data to a specified value name in the registry.

構文

NTSTATUS WdfRegistryAssignValue(
  [in]  WDFKEY Key,
  [in]  PCUNICODE_STRING ValueName,
  [in]  ULONG ValueType,
  [in]  ULONG ValueLength,
  [in]  PVOID Value
);

パラメーター

Key [in]

A handle to a registry-key object that represents an opened registry key.

ValueName [in]

A pointer to a UNICODE_STRING structure that contains a value name.

ValueType [in]

A value that identifies the data type. For a list of data type values, see the Type member of KEY_VALUE_BASIC_INFORMATION.

ValueLength [in]

The length, in bytes, of the buffer that Value points to.

Value [in]

A pointer to a buffer that contains driver-supplied data.

戻り値

WdfRegistryAssignValue returns STATUS_SUCCESS if the operation succeeds. Otherwise, the method might return one of the following values:

リターン コード説明
STATUS_INVALID_DEVICE_REQUEST

WdfRegistryAssignValue was not called at IRQL = PASSIVE_LEVEL.

STATUS_INVALID_PARAMETER

An invalid parameter was specified.

STATUS_ACCESS_DENIED

The driver did not open the registry key with KEY_SET_VALUE access.

 

This method also might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

解説

If the value name that the ValueName parameter specifies already exists, WdfRegistryAssignValue updates the value's data.

For more information about registry-key objects, see Using the Registry in Framework-Based Drivers.

The following code example assigns hexadecimal 123456 to a registry value as binary data.

ULONG val;
NTSTATUS status;

val = 0x123456;
status = WdfRegistryAssignValue(
                                Key,
                                &valueName,
                                REG_BINARY,
                                sizeof(val),
                                &val
                                );

要件

バージョン

Available in version 1.0 and later versions of KMDF.

ヘッダー

Wdfregistry.h (includeWdf.h)

ライブラリ

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

PASSIVE_LEVEL

参照

KEY_VALUE_BASIC_INFORMATION
UNICODE_STRING
WdfRegistryAssignMemory
WdfRegistryAssignMultiString
WdfRegistryAssignString
WdfRegistryAssignUnicodeString
WdfRegistryAssignULong

 

 

コミュニティの追加

表示:
© 2014 Microsoft