From d9314287a75d11f1d4ef63a216ccd0db15ca0f25 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 3 Jun 2007 19:01:58 +0000 Subject: [PATCH] Redirect registry keys from 'CurrentControlSet' to 'ControlSet001' without using registry links. svn path=/trunk/; revision=26980 --- reactos/tools/mkhive/registry.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/reactos/tools/mkhive/registry.c b/reactos/tools/mkhive/registry.c index 6ef405167b7..d9cb3625501 100644 --- a/reactos/tools/mkhive/registry.c +++ b/reactos/tools/mkhive/registry.c @@ -132,8 +132,9 @@ RegpOpenOrCreateKey( else RtlInitUnicodeString(&KeyString, LocalKeyName); - while (ParentKey->DataType == REG_LINK) - ParentKey = ParentKey->LinkedKey; + /* Redirect from 'CurrentControlSet' to 'ControlSet001' */ + if (!wcsncmp(LocalKeyName, L"CurrentControlSet", 17)) + RtlInitUnicodeString(&KeyString, L"ControlSet001"); /* Check subkey in memory structure */ Ptr = ParentKey->SubKeyList.Flink; @@ -667,16 +668,11 @@ RegInitializeRegistry(VOID) &SystemHive, L"Registry\\Machine\\SYSTEM"); - /* Create link 'CurrentControlSet' --> 'ControlSet001' */ + /* Create 'ControlSet001' key */ RegCreateKeyW( NULL, L"Registry\\Machine\\SYSTEM\\ControlSet001", &ControlSetKey); - RegCreateKeyW( - NULL, - L"Registry\\Machine\\SYSTEM\\CurrentControlSet", - &LinkKey); - RegSetValueExW(LinkKey, NULL, 0, REG_LINK, (PCHAR)&ControlSetKey, sizeof(PVOID)); } /* EOF */