diff --git a/win32ss/drivers/videoprt/registry.c b/win32ss/drivers/videoprt/registry.c index 4fed31e451d..5e0a802ee63 100644 --- a/win32ss/drivers/videoprt/registry.c +++ b/win32ss/drivers/videoprt/registry.c @@ -201,17 +201,21 @@ IntCopyRegistryKey( NameString.Length = (USHORT)KeyValueInformation->NameLength; NameString.MaximumLength = NameString.Length; - /* Create the key value in the destination key */ - Status = ZwSetValueKey(DestKeyHandle, - &NameString, - KeyValueInformation->TitleIndex, - KeyValueInformation->Type, - (PUCHAR)KeyValueInformation + KeyValueInformation->DataOffset, - KeyValueInformation->DataLength); - if (!NT_SUCCESS(Status)) + if ((wcscmp(NameString.Buffer, L"DefaultSettings.XResolution") != 0) && + (wcscmp(NameString.Buffer, L"DefaultSettings.YResolution") != 0)) { - /* Just warn, but continue with the remaining sub-keys */ - WARN_(VIDEOPRT, "failed to set value '%wZ'.\n", &NameString); + /* Create the key value in the destination key */ + Status = ZwSetValueKey(DestKeyHandle, + &NameString, + KeyValueInformation->TitleIndex, + KeyValueInformation->Type, + (PUCHAR)KeyValueInformation + KeyValueInformation->DataOffset, + KeyValueInformation->DataLength); + if (!NT_SUCCESS(Status)) + { + /* Just warn, but continue with the remaining sub-keys */ + WARN_(VIDEOPRT, "failed to set value '%wZ'.\n", &NameString); + } } /* Next subkey */ @@ -339,7 +343,7 @@ IntSetupDeviceSettingsKey( OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = ZwOpenKey(&SourceKeyHandle, KEY_WRITE, &ObjectAttributes); + Status = ZwOpenKey(&SourceKeyHandle, KEY_READ, &ObjectAttributes); if (Status != STATUS_SUCCESS) { ERR_(VIDEOPRT, "ZwOpenKey failed for settings key: status 0x%lx\n", Status); @@ -565,7 +569,7 @@ IntCreateNewRegistryPath( OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = ZwOpenKey(&NewKey, KEY_READ, &ObjectAttributes); + Status = ZwOpenKey(&NewKey, KEY_WRITE, &ObjectAttributes); if (!NT_SUCCESS(Status)) { ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status);