Commit fe9839e7 authored by Jan Köster's avatar Jan Köster
Browse files

test

parent 3b979f85
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -286,16 +286,17 @@ namespace confplus {
                continue;
            }

            // Every confplus path segment becomes its own registry key.
            // /zaehler2mqtt/http/addr  zaehler2mqtt\  http\  addr\
            // Every confplus path segment becomes its own registry key:
            // /zaehler2mqtt/http/addr -> zaehler2mqtt\ -> http\ -> addr\
            std::string subKeyPath = currentPath.empty()
                ? localKeyName
                : (currentPath + "\\" + localKeyName);

            HKEY hSubKey = nullptr;
            DWORD dwDisp = 0;
            LONG lRes = RegCreateKeyExA(
                hRootKey, subKeyPath.c_str(), 0, NULL,
                REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hSubKey, NULL);
                REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hSubKey, &dwDisp);

            if (lRes != ERROR_SUCCESS) {
                std::cerr << "Failed to create subkey: " << subKeyPath << std::endl;