sub WlanConnect {
croak "Wlan functions are not available" unless $wlan_available;
my ($handle, $guuid, $profilename, $ssid) = @_;
# possibly overkill, a pDot11Ssid = 0 should suffice
my $pDot11Ssid = Win32::API::Struct->new('DOT11_SSID');
$pDot11Ssid->{uSSIDLength} = length $ssid;
$pDot11Ssid->{ucSSID} = $ssid;
my $Wlan_connection_parameters = Win32::API::Struct->new('WLAN_CONNECTION_PARAMETERS');
$Wlan_connection_parameters->{wlanConnectionMode} = 0;
$Wlan_connection_parameters->{strProfile} = $profilename;
$Wlan_connection_parameters->{pDot11Ssid} = $pDot11Ssid;
$Wlan_connection_parameters->{pDesiredBssidList} = 0;
$Wlan_connection_parameters->{dot11BssType} = 3;
$Wlan_connection_parameters->{dwFlags} = 0;
$API{ WlanConnect }->Call($handle, $guuid, $Wlan_connection_parameters, 0) == 0
or die "$^E";
};
####
Win32::API::Struct->typedef('WLAN_CONNECTION_PARAMETERS', qw(
WLAN_CONNECTION_MODE wlanConnectionMode;
LPCWSTR strProfile;
PDOT11_SSID pDot11Ssid;
PDOT11_BSSID_LIST pDesiredBssidList;
DOT11_BSS_TYPE dot11BssType;
DWORD dwFlags;
));
####
Win32::API::Struct->typedef ('DOT11_SSID', qw(
ULONG uSSIDLength;
UCHAR ucSSID;
));
####
An attempt was made to reference a token that does not exist at...