[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.
This commit is contained in:
Hervé Poussineau 2022-01-24 18:55:26 +01:00
parent b80d806e05
commit 1add6de3e8

View file

@ -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