From da74f5a9ff597d2eee022fb5255a798bcc0734a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Thu, 15 Dec 2005 14:15:18 +0000 Subject: [PATCH] Set the ConfigFlags value in registry if not present svn path=/trunk/; revision=20189 --- reactos/ntoskrnl/io/pnpmgr.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/io/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr.c index 25d802d39dc..4269f94aebf 100644 --- a/reactos/ntoskrnl/io/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr.c @@ -996,7 +996,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey, UNICODE_STRING KeyName; HANDLE LogConfKey; ULONG ResCount; - ULONG ListSize; + ULONG ListSize, ResultLength; NTSTATUS Status; DPRINT("IopSetDeviceInstanceData() called\n"); @@ -1051,6 +1051,26 @@ IopSetDeviceInstanceData(HANDLE InstanceKey, ZwClose(LogConfKey); } + /* Set the 'ConfigFlags' value */ + RtlInitUnicodeString(&KeyName, L"ConfigFlags"); + Status = ZwQueryValueKey(InstanceKey, + &KeyName, + KeyValueBasicInformation, + NULL, + 0, + &ResultLength); + if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + { + /* Write the default value */ + ULONG DefaultConfigFlags = 0; + Status = ZwSetValueKey(InstanceKey, + &KeyName, + 0, + REG_DWORD, + &DefaultConfigFlags, + sizeof(DefaultConfigFlags)); + } + #if 0 if (DeviceNode->PhysicalDeviceObject != NULL) {