Let the user know when WinPcap isn't loaded.
This commit is contained in:
parent
4705c3e59a
commit
36040e90a3
|
@ -6238,7 +6238,9 @@ LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
int menuItemCount = ComboBox_GetCount(deviceMenu);
|
int menuItemCount = ComboBox_GetCount(deviceMenu);
|
||||||
int deviceCount = -1;
|
int deviceCount = -1;
|
||||||
std::vector<std::string> deviceStringList;
|
std::vector<std::string> deviceStringList;
|
||||||
|
int curSel = 0;
|
||||||
|
bool enableWin = false;
|
||||||
|
|
||||||
for (int i = 0; i < menuItemCount; i++)
|
for (int i = 0; i < menuItemCount; i++)
|
||||||
{
|
{
|
||||||
ComboBox_DeleteString(deviceMenu, 0);
|
ComboBox_DeleteString(deviceMenu, 0);
|
||||||
|
@ -6247,30 +6249,28 @@ LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
if (isPCapSupported)
|
if (isPCapSupported)
|
||||||
{
|
{
|
||||||
deviceCount = wifiHandler->GetBridgeDeviceList(&deviceStringList);
|
deviceCount = wifiHandler->GetBridgeDeviceList(&deviceStringList);
|
||||||
}
|
|
||||||
|
|
||||||
if (deviceCount < 0)
|
if (deviceCount <= 0)
|
||||||
{
|
{
|
||||||
ComboBox_AddString(deviceMenu, "Error: Cannot find any devices.");
|
ComboBox_AddString(deviceMenu, "Error: No devices found.");
|
||||||
ComboBox_SetCurSel(deviceMenu, 0);
|
}
|
||||||
EnableWindow(deviceMenu, FALSE);
|
else
|
||||||
}
|
{
|
||||||
else if (deviceCount == 0)
|
for (size_t i = 0; i < deviceCount; i++)
|
||||||
{
|
{
|
||||||
ComboBox_AddString(deviceMenu, "No devices found.");
|
ComboBox_AddString(deviceMenu, deviceStringList[i].c_str());
|
||||||
ComboBox_SetCurSel(deviceMenu, 0);
|
}
|
||||||
EnableWindow(deviceMenu, FALSE);
|
curSel = CommonSettings.wifi.infraBridgeAdapter;
|
||||||
|
enableWin = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < deviceCount; i++)
|
ComboBox_AddString(deviceMenu, "Error: Could not load WinPcap.");
|
||||||
{
|
|
||||||
ComboBox_AddString(deviceMenu, deviceStringList[i].c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
ComboBox_SetCurSel(deviceMenu, CommonSettings.wifi.infraBridgeAdapter);
|
|
||||||
EnableWindow(deviceMenu, TRUE);
|
|
||||||
}
|
}
|
||||||
|
ComboBox_SetCurSel(deviceMenu, curSel);
|
||||||
|
EnableWindow(deviceMenu, enableWin);
|
||||||
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue