// wdfregistry.h
HANDLE WdfRegistryWdmGetHandle(
[in] WDFKEY Key
);
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
The WdfRegistryWdmGetHandle method returns a Windows Driver Model (WDM) handle to the registry key that a specified framework registry-key object represents.
Key [in]A handle to a registry-key object that represents an opened registry key.
WdfRegistryWdmGetHandle returns a WDM handle to a registry key.
A bug check occurs if the driver supplies an invalid object handle.
A KMDF driver can pass the returned WDM handle to the ZwXxx routines that accept a WDM handle as input.
A UMDF driver can pass the returned handle to APIs that require an HKEY, such as RegEnumKeyEx.
The handle that the WdfRegistryWdmGetHandle method returns is valid until the registry-key object is deleted. If the driver provides an EvtCleanupCallback function for the registry-key object, the pointer is valid until the callback function returns.
For more information about registry-key objects, see Using the Registry in Framework-Based Drivers.
The following code example obtains a WDM handle to the registry key that a specified framework registry-key object represents.
HANDLE hKey;
hKey = WdfRegistryWdmGetHandle(Key);