/* Function used to load the WEP keys for a selected interface  */
gboolean airpcap_if_load_driver_keys(PAirpcapHandle ad, airpcap_if_info_t *if_info)
/* Function used to load the WEP keys for a selected interface  */
gboolean airpcap_if_load_driver_keys(PAirpcapHandle ad, airpcap_if_info_t *if_info)
{
    if_info->keysCollectionSize = 0;
    if_info->keysCollection = NULL;
    if (!airpcap_if_get_driver_keys(ad, NULL, &(if_info->keysCollectionSize)))
    {
        if (if_info->keysCollectionSize == 0)
        {
            if_info->keysCollection = NULL;
            airpcap_if_close(ad);
            return FALSE;
        }
        if_info->keysCollection = (PAirpcapKeysCollection)g_malloc(if_info->keysCollectionSize);
        if (!if_info->keysCollection)
        {
            if_info->keysCollectionSize = 0;
            if_info->keysCollection = NULL;
            airpcap_if_close(ad);
            return FALSE;
        }
        airpcap_if_get_driver_keys(ad, if_info->keysCollection, &(if_info->keysCollectionSize));
        return TRUE;
    }
    airpcap_if_close(ad);
    return FALSE;
}