I have a necessity to use the ZwSetValueKey()
function declared in the Wdm.h
header file available as a part of the Windows Driver Kit (WDK) to access the registry keys created by a kernel mode driver but Visual Studio does not allow the use of the WDK headers as it fails to detect the required header file when included (by referring to the error message stating that Wdm.h
cannot be opened).
Thanks in advance.
The wdm.h
header file containing the ZwXXXX
functions are unsuited for use in applications that do not run in the kernel mode (as mentioned here). The equivalent NtXXXX
functions in winternl.h
and Ntdll.dll
, on the other hand, are accessible for use as a part of the Windows Native System Services routine by applications running in the user mode.
In the context of the function enlisted in the question, the function NtSetValueKey()
can be used in its substitute (as mentioned here).