+ /* Open the 'CurrentVersion' key */
+ RtlInitUnicodeString(&KeyName,
+ L"Microsoft");
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyName,
+ OBJ_CASE_INSENSITIVE,
+ SoftwareKeyHandle,
+ NULL);
+
+ Status = NtCreateKey(&MicrosoftKeyHandle,
+ KEY_CREATE_SUB_KEY,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ 0,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to create key %wZ (Status: %08lx)\n", &KeyName, Status);
+ goto done;
+ }
+
+ /* Open the 'CurrentVersion' key */
+ RtlInitUnicodeString(&KeyName,
+ L"Windows NT");
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyName,
+ OBJ_CASE_INSENSITIVE,
+ MicrosoftKeyHandle,
+ NULL);
+
+ Status = NtCreateKey(&WindowsNtKeyHandle,
+ KEY_CREATE_SUB_KEY,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ 0,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to create key %wZ (Status: %08lx)\n", &KeyName, Status);
+ goto done;
+ }
+
+ /* Open the 'CurrentVersion' key */
+ RtlInitUnicodeString(&KeyName,
+ L"CurrentVersion");
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyName,
+ OBJ_CASE_INSENSITIVE,
+ WindowsNtKeyHandle,
+ NULL);
+
+ Status = NtCreateKey(&CurrentVersionKeyHandle,
+ KEY_CREATE_SUB_KEY | KEY_SET_VALUE,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ 0,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to create key %wZ (Status: %08lx)\n", &KeyName, Status);
+ goto done;
+ }
+