https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7309801e5ab693add8510…
commit 7309801e5ab693add8510da72921d982432d75a3
Author: Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua>
AuthorDate: Sun Jan 16 19:57:43 2022 +0200
Commit: Robert Naumann <gonzomdx(a)gmail.com>
CommitDate: Mon Mar 28 08:13:05 2022 +0200
[NTOS:IO] IoRegisterDeviceInterface: create non-volatile keys for new device interfaces
Always create only non-volatile (sub)keys when registering a new device interface, so then they are saved after reboot.
On Windows, nearly all device interface keys are non-volatile, except the "Control" subkey, which is managed by IoSetDeviceInterfaceState instead.
In particular, it fixes MS sysaudio loading failure with MS audio drivers replacement (ks, portcls, swenum, sysaudio, wdmaud). My IoGetDeviceInterfaceAlias implementation is also required to be applied. MS sysaudio implementation(s) except that those keys are non-volatile (but we're creating them volatile instead), and trying to create a subkey(s) there (via other IoDeviceInterface* routines), to read/write some needed data. But then they fail to do that with STATUS_CHILD_MUST_BE_VOLA [...]
The volatile keys can never have non-volatile subkeys.
CORE-17361
---
ntoskrnl/io/iomgr/deviface.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ntoskrnl/io/iomgr/deviface.c b/ntoskrnl/io/iomgr/deviface.c
index 6a57e7d203b..d640f7087b9 100644
--- a/ntoskrnl/io/iomgr/deviface.c
+++ b/ntoskrnl/io/iomgr/deviface.c
@@ -1060,7 +1060,7 @@ IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject,
&ObjectAttributes,
0, /* TileIndex */
NULL, /* Class */
- REG_OPTION_VOLATILE,
+ REG_OPTION_NON_VOLATILE,
NULL); /* Disposition */
if (!NT_SUCCESS(Status))
@@ -1111,7 +1111,7 @@ IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject,
&ObjectAttributes,
0, /* TileIndex */
NULL, /* Class */
- REG_OPTION_VOLATILE,
+ REG_OPTION_NON_VOLATILE,
NULL); /* Disposition */
if (!NT_SUCCESS(Status))
@@ -1175,7 +1175,7 @@ IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject,
&ObjectAttributes,
0, /* TileIndex */
NULL, /* Class */
- REG_OPTION_VOLATILE,
+ REG_OPTION_NON_VOLATILE,
NULL); /* Disposition */
if (!NT_SUCCESS(Status))