EvtDeviceReportedMissing
EvtDeviceUsageNotificationEx
EvtDeviceWdmIrpDispatch
EvtDeviceWdmPostPoFxRegisterDevice
EvtDeviceWdmPrePoFxUnregisterDevice
WDF_DEVICE_INTERFACE_PROPERTY_DATA
WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT
WDF_DEVICE_PROPERTY_DATA
WDF_DEVICE_PROPERTY_DATA_INIT
WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS
WDF_EVENT_TYPE
WDF_IO_TYPE_CONFIG
WDF_IO_TYPE_CONFIG_INIT
WDF_POWER_FRAMEWORK_SETTINGS
WDF_POWER_FRAMEWORK_SETTINGS_INIT
WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE
WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE
WDF_REMOVE_LOCK_OPTIONS
WDF_REMOVE_LOCK_OPTIONS_FLAGS
WDF_REMOVE_LOCK_OPTIONS_INIT
WdfDeviceAllocAndQueryInterfaceProperty method
WdfDeviceAllocAndQueryPropertyEx method
WdfDeviceAssignInterfaceProperty method
WdfDeviceAssignProperty method
WdfDeviceConfigureWdmIrpDispatchCallback method
WdfDeviceGetDeviceStackIoType method
WdfDeviceGetHardwareRegisterMappedAddress
WdfDeviceInitSetIoTypeEx method
WdfDeviceInitSetReleaseHardwareOrderOnFailure method
WdfDeviceInitSetRemoveLockOptions method
WdfDeviceMapIoSpace
WdfDeviceOpenDevicemapKey method
WdfDevicePostEvent
WdfDeviceQueryInterfaceProperty method
WdfDeviceQueryPropertyEx method
WdfDeviceReadFromHardware
WdfDeviceResumeIdleWithTag method
WdfDeviceStopIdleWithTag method
WdfDeviceUnmapIoSpace
WdfDeviceWdmAssignPowerFrameworkSettings method
WdfDeviceWdmDispatchIrp method
WdfDeviceWdmDispatchIrpToIoQueue method
WdfDeviceWriteToHardware
WdfFdoInitAllocAndQueryPropertyEx method
WdfFdoInitQueryPropertyEx method
展開 最小化

WdfDeviceOpenRegistryKey メソッド

The WdfDeviceOpenRegistryKey method opens a device's hardware key or a driver's software key in the registry and creates a framework registry-key object that represents the registry key.

構文

NTSTATUS WdfDeviceOpenRegistryKey(
  [in]            WDFDEVICE Device,
  [in]            ULONG DeviceInstanceKeyType,
  [in]            ACCESS_MASK DesiredAccess,
  [in, optional]  PWDF_OBJECT_ATTRIBUTES KeyAttributes,
  [out]           WDFKEY *Key
);

パラメーター

Device [in]

A handle to a framework device object.

DeviceInstanceKeyType [in]

The driver sets the PLUGPLAY_REGKEY_DEVICE flag to open the Device Parameters subkey under the device's hardware key, or it sets the PLUGPLAY_REGKEY_DRIVER flag to open the driver's software key. If the PLUGPLAY_REGKEY_CURRENT_HWPROFILE flag is also set, WdfDeviceOpenRegistryKey opens the copy of the hardware or software key that is in the current hardware profile.

DesiredAccess [in]

An ACCESS_MASK-typed value that specifies access rights that the driver is requesting for the specified registry key. For a list of access rights that drivers typically use for registry keys, see Opening a Handle to a Registry-Key Object. Your driver must ask for only the types of access that it needs. For example, the driver must not ask for KEY_ALL_ACCESS if it will only read the registry key.

KeyAttributes [in, optional]

A pointer to a WDF_OBJECT_ATTRIBUTES structure that contains driver-supplied attributes for the new registry-key object. This parameter is optional and can be WDF_NO_OBJECT_ATTRIBUTES.

Key [out]

A pointer to a location that receives a handle to the new registry-key object.

戻り値

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

リターン コード説明
STATUS_INVALID_DEVICE_REQUEST

WdfDeviceOpenRegistryKey was not called at IRQL = PASSIVE_LEVEL.

STATUS_INVALID_PARAMETER

An invalid parameter was specified.

STATUS_INSUFFICIENT_RESOURCES

A registry-key object could not be allocated.

STATUS_ACCESS_DENIED

The system denied the specified access rights.

STATUS_OBJECT_NAME_NOT_FOUND

The specified registry key does not exist.

 

For a list of other return values that the WdfDeviceOpenRegistryKey method might return, see Framework Object Creation Errors.

The method might return other NTSTATUS values.

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

解説

If your driver must open a hardware or software key before it has called WdfDeviceCreate, it must call WdfFdoInitOpenRegistryKey instead of WdfDeviceOpenRegistryKey.

When the driver has finished using the registry key that it opened with WdfDeviceOpenRegistryKey, the driver must call WdfRegistryClose.

For more information about the registry, hardware and software keys, and registry objects, see Using the Registry in Framework-Based Drivers.

For code examples that use WdfDeviceOpenRegistryKey, see WdfRegistryCreateKey, WdfRegistryOpenKey, and WdfRegistryQueryValue.

要件

バージョン

Available in version 1.0 and later versions of KMDF.

ヘッダー

Wdfdevice.h (includeWdf.h)

ライブラリ

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

IRQL

PASSIVE_LEVEL

参照

WdfFdoInitOpenRegistryKey

 

 

コミュニティの追加

追加
表示:
© 2015 Microsoft