https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1add6de3e813904ff6903…
commit 1add6de3e813904ff69037530b839929a87a9571
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Mon Jan 24 18:55:26 2022 +0100
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Wed Jan 26 19:30:32 2022 +0100
[VIDEOPRT] Change case of device registry path written to registry
Change it it two places, to handle when 'UseNewKey' is enabled or disabled.
This fixes the Spice guest agent, which searches 'System' case-sensitively in
it.
---
win32ss/drivers/videoprt/videoprt.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c
index 0348b677c7b..803d934c920 100644
--- a/win32ss/drivers/videoprt/videoprt.c
+++ b/win32ss/drivers/videoprt/videoprt.c
@@ -524,7 +524,7 @@ IntLoadRegistryParameters(VOID)
NTSTATUS Status;
HANDLE KeyHandle;
UNICODE_STRING UseNewKeyPath =
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\GraphicsDrivers\\UseNewKey");
- UNICODE_STRING Path =
RTL_CONSTANT_STRING(L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Control");
+ UNICODE_STRING Path =
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control");
UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"SystemStartOptions");
OBJECT_ATTRIBUTES ObjectAttributes;
PKEY_VALUE_PARTIAL_INFORMATION KeyInfo;
@@ -792,6 +792,14 @@ VideoPortInitialize(
}
RtlCopyUnicodeString(&DriverExtension->RegistryPath, RegistryPath);
+
+ /* There is a bug in Spice guest agent, which searches 'System'
case-sensitively.
+ * Replace 'SYSTEM' by 'System' to fix that.
+ * Probably for similar reason, Windows also replaces 'MACHINE' by
'Machine'.
+ */
+ wcsncpy(wcsstr(DriverExtension->RegistryPath.Buffer,
L"\\SYSTEM\\"), L"\\System\\", ARRAYSIZE(L"\\SYSTEM\\") -
1);
+ wcsncpy(wcsstr(DriverExtension->RegistryPath.Buffer,
L"\\MACHINE\\"), L"\\Machine\\", ARRAYSIZE(L"\\MACHINE\\") -
1);
+
INFO_(VIDEOPRT, "RegistryPath: %wZ\n",
&DriverExtension->RegistryPath);
}
else