Bug Fix #102 - Ignore WLAN service disabled

This commit is contained in:
Gary Sharp
2016-10-10 15:35:32 +11:00
parent 1dfa3f4f15
commit 062769a7e3
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -71,6 +71,13 @@ namespace Disco.Client.Interop
// Connect to wireless service
interopResult = WlanApi.WlanOpenHandle(WlanApi.WLAN_API_VERSION_2_0, IntPtr.Zero, out wlanServiceVersion, out wlanHandle);
if (interopResult == WlanApi.ERROR_SERVICE_NOT_ACTIVE)
{
// Indicates the Wlan service has not been started on the client
// typically as it is not needed (no wireless adapter) or if it
// has been forcibly disabled.
return null;
}
if (interopResult != WlanApi.ERROR_SUCCESS)
{
throw new Exception($"Unable to connect to local wireless service. WlanOpenHandle returned: {interopResult}");
@@ -156,6 +163,14 @@ namespace Disco.Client.Interop
// Connect to wireless service
interopResult = WlanApi.WlanOpenHandle(WlanApi.WLAN_API_VERSION_2_0, IntPtr.Zero, out wlanServiceVersion, out wlanHandle);
if (interopResult == WlanApi.ERROR_SERVICE_NOT_ACTIVE)
{
// Indicates the Wlan service has not been started on the client
// typically as it is not needed (no wireless adapter) or if it
// has been forcibly disabled.
Presentation.UpdateStatus("Enrolling Device", $"Configuring Wireless Profiles\r\nSkipping, the WLAN service is not enabled", true, -1, 3000);
return;
}
if (interopResult != WlanApi.ERROR_SUCCESS)
{
throw new Exception($"Unable to connect to local wireless service. WlanOpenHandle returned: {interopResult}");