The GUID is obtained the same way the stock Wlan::API does it and it is used all over the place, e.g in the (added by me) WlanSetProfile(), which creates a new profile from the required XML structures like thus:
sub WlanSetProfile { croak "Wlan functions are not available" unless $wlan_available; my ($handle, $guuid, $xmlref) = @_; my $reason = Zero; $API{ WlanSetProfile }->Call($handle, $guuid, 0, $$xmlref, 0, 1, 0 +, $reason) == 0 or die "$^E"; };
Background: I want to automate establishing an ad-hoc network. On XP, insecure WEP is the only available encryption method. So, in order to make things a bit more secure, before connecting I create a new profile with a new WEP key, effectively creating a session key.
WlanSetProfile() succeeds and I can use the new profile to connect manually. So, the GUID is good. Also, the UTF16LE profilename is good, because before creating a new profile, I do some housekeeping and delete the previously used profile with the (added by me) WlanDeleteProfile()
sub WlanDeleteProfile { croak "Wlan functions are not available" unless $wlan_available; my ($handle, $guuid, $profilename) = @_; $API{ WlanDeleteProfile }->Call($handle, $guuid, $profilename, 0) +== 0 or die "$^E"; };
Deleting a profile works by supplying its name in the required fashion. WlanDeleteProfile() succeeds.
Unfortunately, using S for P in the signature
['WlanConnect' => 'IPSI' => 'I']makes no difference.
I think my best bet is to follow Corion's suggestion and investigate pack()ing some string.
In reply to Re^4: Adding WlanConnect() to Win32::Wlan::API
by tomsell
in thread Adding WlanConnect() to Win32::Wlan::API
by tomsell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |