[NTOS:IO] OpenRegistryHandlesFromSymbolicLink: Use REG_OPTION_NON_VOLATILE

Use REG_OPTION_NON_VOLATILE instead of REG_OPTION_VOLATILE in all ZwCreateKey calls of OpenRegistryHandlesFromSymbolicLink, since the keys created/opened by this function, should be non-volatile (in other words, be saved after reboot).
Also Device Parameters subkey that is created in IoOpenDeviceInterfaceRegistryKey (which uses that routine as well), is non-volatile too, so the parent keys whose contain it, cannot be volatile.
It will fix an error with status 0xc0000181 (STATUS_CHILD_MUST_BE_VOLATILE) occuring during loading kernel mode audio drivers from Windows XP/2003, especially checked (debug) versions, with my IoGetDeviceInterfaceAlias implementation. Also it may fix other error cases.
CORE-17361
This commit is contained in:
Oleg Dubinskiy 2021-04-04 20:57:23 +03:00 committed by George Bișoc
parent c869c4778d
commit 94054a5735

View file

@ -103,7 +103,7 @@ OpenRegistryHandlesFromSymbolicLink(IN PUNICODE_STRING SymbolicLinkName,
&ObjectAttributes, &ObjectAttributes,
0, 0,
NULL, NULL,
REG_OPTION_VOLATILE, REG_OPTION_NON_VOLATILE,
NULL); NULL);
ZwClose(ClassesKey); ZwClose(ClassesKey);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -154,7 +154,7 @@ OpenRegistryHandlesFromSymbolicLink(IN PUNICODE_STRING SymbolicLinkName,
&ObjectAttributes, &ObjectAttributes,
0, 0,
NULL, NULL,
REG_OPTION_VOLATILE, REG_OPTION_NON_VOLATILE,
NULL); NULL);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
@ -172,7 +172,7 @@ OpenRegistryHandlesFromSymbolicLink(IN PUNICODE_STRING SymbolicLinkName,
&ObjectAttributes, &ObjectAttributes,
0, 0,
NULL, NULL,
REG_OPTION_VOLATILE, REG_OPTION_NON_VOLATILE,
NULL); NULL);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {