mirror of https://github.com/OpenVPN/openvpn-gui
To get connection for menu command, we use "dwMenuData" property
of a menu. With single connection profile we read "dwMenuData"
of a main menu, not a submenu. There has been a bug in code which hasn't
set "dwMenuData" for the main menu but it has worked until recently, since
this property stored index of connection array and index 0 has always
worked.
Since commit 94179911
("Use a list instead of array for connections list")
we have switched to a linked list and store list pointer in dwMenuData.
However due to bug dwMenuData has always being 0, and logic which
fetches connections doesn't work:
minfo.fMask = MIM_MENUDATA;
GetMenuInfo((HMENU) lParam, &minfo);
c = (connection_t *) minfo.dwMenuData;
if (!c)
break; /* ignore invalid connection */
Fix by assigning main menu's dwMenuData to a head of connections list.
Fixes https://github.com/OpenVPN/openvpn-gui/issues/592
Signed-off-by: Lev Stipakov <lev@openvpn.net>
pull/600/head
parent
11bdc44481
commit
e923f2caa8
Loading…
Reference in new issue