[Applies to KMDF and UMDF]
The WdfDeviceOpenDevicemapKey method opens the DEVICEMAP key and creates a framework registry-key object that represents the registry key.
NTSTATUS WdfDeviceOpenDevicemapKey( WDFDEVICE Device, PCUNICODE_STRING KeyName, ACCESS_MASK DesiredAccess, PWDF_OBJECT_ATTRIBUTES KeyAttributes, WDFKEY *Key );
A handle to a framework device object.
A pointer to a UNICODE_STRING structure that specifies the name of the subkey to open under DEVICEMAP.
An ACCESS_MASK-typed value that specifies access rights that the driver is requesting for the specified registry key.
A KMDF driver typically requests KEY_READ, KEY_WRITE, or KEY_READ | KEY_WRITE.
A UMDF driver typically requests KEY_READ or KEY_SET_VALUE.
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.
A pointer to a location that receives a handle to the new registry-key object. The
WdfDeviceOpenDevicemapKey returns STATUS_SUCCESS if the operation succeeds. Otherwise, the method might return one of the following values:
WdfDeviceOpenDevicemapKey was not called at IRQL = PASSIVE_LEVEL.
||An invalid parameter was specified. For UMDF, this return value can indicate insufficient access rights.|
||A registry-key object could not be allocated.|
||The specified registry key does not exist.|
For a list of other return values that the WdfDeviceOpenDevicemapKey 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.
The registry contains a HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP key that some drivers for older technologies, such as serial and parallel ports, use. If your driver supports a technology that uses the DEVICEMAP key, the driver can access subkeys and values under the key by calling WdfDeviceOpenDevicemapKey.
WdfDeviceOpenDevicemapKey returns a volatile Key. This means that the information is not preserved when the corresponding registry hive is unloaded.
When the driver has finished using the registry key that it opened with WdfDeviceOpenDevicemapKey, 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.
|Minimum KMDF version||1.15|
|Minimum UMDF version||2.15|
|Header||wdfdevice.h (include Wdf.h)|
|Library||Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)|