openvpn.c: add missing calling convention

Commit 131c75e5 ("Notify dialog windows when OpenVPN state changes") added callback
function, but forgot to specify __stdcall calling convention with CALLBACK keyword.

This is not an issue for x64 builds, but x86 requires __stdcall calling convention for callbacks,
otherwise compiler throws an error:

  Error: D:\a\openvpn-gui\openvpn-gui\openvpn.c(292): error C2440: 'function': cannot convert from 'BOOL (__cdecl *)(HWND,LPARAM)' to 'WNDENUMPROC'

Reported-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: Lev Stipakov <lev@openvpn.net>
pull/444/head
Lev Stipakov 2021-08-19 13:18:43 +03:00 committed by Samuli Seppänen
parent 014dc1a6c2
commit 290906b8db
1 changed files with 1 additions and 1 deletions

View File

@ -255,7 +255,7 @@ parse_assigned_ip(connection_t *c, const char *msg)
* OpenVPN daemon (e., "CONNECTED")
* The function signature matches callback for EnumThreadWindows.
*/
BOOL
BOOL CALLBACK
NotifyStateChange(HWND hwnd, LPARAM lParam)
{
SendMessage(hwnd, WM_OVPN_STATE, 0, lParam);