OSDN Git Service

private_lib: move WPA_EVENT_DRIVER_STATE to driver_cmd_common.h
[android-x86/external-wpa_supplicant_8.git] / wpa_supplicant / config_winreg.c
index 2750b63..1b5e237 100644 (file)
@@ -302,6 +302,7 @@ static struct wpa_ssid * wpa_config_read_network(HKEY hk, const TCHAR *netw,
                RegCloseKey(nhk);
                return NULL;
        }
+       dl_list_init(&ssid->psk_list);
        ssid->id = id;
 
        wpa_config_set_network_defaults(ssid);
@@ -434,7 +435,7 @@ static int wpa_config_read_networks(struct wpa_config *config, HKEY hk)
 }
 
 
-struct wpa_config * wpa_config_read(const char *name)
+struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp)
 {
        TCHAR buf[256];
        int errors = 0;
@@ -442,7 +443,12 @@ struct wpa_config * wpa_config_read(const char *name)
        HKEY hk;
        LONG ret;
 
-       config = wpa_config_alloc_empty(NULL, NULL);
+       if (name == NULL)
+               return NULL;
+       if (cfgp)
+               config = cfgp;
+       else
+               config = wpa_config_alloc_empty(NULL, NULL);
        if (config == NULL)
                return NULL;
        wpa_printf(MSG_DEBUG, "Reading configuration profile '%s'", name);