mirror of https://github.com/OpenVPN/openvpn-gui
Browse Source
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
Lev Stipakov
2 years ago
committed by
Frank Lichtenheld
1 changed files with 7 additions and 1 deletions
Loading…
Reference in new issue