Skip to content

Commit

Permalink
gui: add a button to subscribe for notifications
Browse files Browse the repository at this point in the history
Instead of subscribe for notifications at startup,
do it on button click. This is because current driver
version doesn't yet support notifications.

Signed-off-by: Lev Stipakov <[email protected]>
  • Loading branch information
lstipakov committed Oct 22, 2024
1 parent ad8c81d commit 3b74322
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define VER_DEV_NAME L"\\\\.\\ovpn-dco-ver"

#define BTN_SEND_CC 100
#define BTN_SUBSCRIBE_NOTIF 101

LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);

Expand Down Expand Up @@ -204,8 +205,6 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR args, int ncmdsho

StartOverlappedRead();

StartOverlappedNotif();

while (true) {
HANDLE events[] = { hEvRead, hEvWrite, hEvNotif };
DWORD waitResult = MsgWaitForMultipleObjects(3, events, FALSE, INFINITE, QS_ALLINPUT);
Expand Down Expand Up @@ -616,6 +615,8 @@ LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
hCCRemoteAddress = CreateEditBox(hwnd, L"192.168.100.1", 290, 160, 120);
hCCRemotePort = CreateEditBox(hwnd, L"1194", 430, 160, 60);

CreatePushButton(hwnd, L"Subscribe notif", (HMENU)BTN_SUBSCRIBE_NOTIF, 640, 160);

CreatePushButton(hwnd, OVPN_IOCTL_MP_NEW_PEER, 10, 210);
hMPNewPeerLocalIP = CreateEditBox(hwnd, L"192.168.100.2", 150, 210, 120);
hMPNewPeerLocalPort = CreateEditBox(hwnd, L"1194", 290, 210, 60);
Expand Down Expand Up @@ -686,6 +687,8 @@ LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
}
else if ((ULONG)wp == BTN_SEND_CC) {
SendCC();
} else if ((ULONG)wp == BTN_SUBSCRIBE_NOTIF) {
StartOverlappedNotif();
}

}
Expand Down

0 comments on commit 3b74322

Please sign in to comment.