+ /* Open driver registry key and create Settings subkey */
+ hDriverKey = SetupDiOpenDevRegKey(
+ DeviceInfoSet, DeviceInfoData,
+ DICS_FLAG_GLOBAL, 0, DIREG_DRV,
+ KEY_CREATE_SUB_KEY);
+ if (hDriverKey == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ DPRINT("SetupDiOpenDevRegKey() failed with error 0x%lx\n", rc);
+ goto cleanup;
+ }
+ rc = RegCreateKeyEx(
+ hDriverKey, L"Settings",
+ 0, NULL, REG_OPTION_NON_VOLATILE,
+#if _WIN32_WINNT >= 0x502
+ KEY_READ | KEY_WRITE,
+#else
+ KEY_ALL_ACCESS,
+#endif
+ NULL, &hSettingsKey, &disposition);
+ if (rc != ERROR_SUCCESS)
+ {
+ DPRINT("RegCreateKeyEx() failed with error 0x%lx\n", rc);
+ goto cleanup;
+ }
+
+ /* Install .SoftwareSettings to Settings subkey */
+ result = SetupInstallFromInfSection(
+ InstallParams.hwndParent, hInf, SectionName,
+ SPINST_REGISTRY, hSettingsKey,
+ NULL, 0, NULL, NULL,
+ NULL, NULL);
+ if (!result)
+ {
+ rc = GetLastError();
+ DPRINT("SetupInstallFromInfSection() failed with error 0x%lx\n", rc);
+ goto cleanup;
+ }
+
+ /* Get service name and open service registry key */