/* Function used to read the Decryption Keys from the preferences and store them properly into the airpcap adapter.  */
static gboolean load_wlan_driver_wep_keys(void)
/* Function used to read the Decryption Keys from the preferences and store them properly into the airpcap adapter.  */
static gboolean load_wlan_driver_wep_keys(void)
{
    keys_cb_data_t* user_data;
    wlan_prefs = prefs_find_module("wlan");
    user_data = (keys_cb_data_t*)g_malloc(sizeof(keys_cb_data_t));
    user_data->list = NULL;
    user_data->current_index = 0;
    user_data->number_of_keys= 0;
    prefs_pref_foreach(wlan_prefs, get_wep_key, (gpointer)user_data);
    wlan_prefs->prefs_changed = TRUE;
    prefs_apply(wlan_prefs);
    write_wlan_driver_wep_keys_to_registry(user_data->list);
    g_list_foreach(user_data->list, (GFunc)free_key_string, NULL);
    g_list_free(user_data->list);
    g_free(user_data);
    return TRUE;
}