[NETSHELL] Fix Network Tray icon activity indication (#4669)

The network activity tray icon wasn't showing activity until the Properties
dialog was opened at least once.
This was due to the fact that the tray icon was initialized once with missing
initialization parameters for pContext (default state and Adapter index).
Fix this problem by adding the missing initialization.

CORE-4497, CORE-9017, CORE-15744
This commit is contained in:
Kyle Katarn 2022-09-09 23:51:51 +02:00 committed by GitHub
parent d5382f91e6
commit 6dcc07c18d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -9,6 +9,8 @@
#include <winsock.h>
#define NETTIMERID 0xFABC
CLanStatus::CLanStatus() :
m_lpNetMan(NULL),
m_pHead(NULL)
@ -116,7 +118,7 @@ UpdateLanStatusUiDlg(
}
VOID
UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext)
UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext)
{
MIB_IFROW IfEntry;
HICON hIcon, hOldIcon = NULL;
@ -839,7 +841,7 @@ LANStatusDlg(
case WM_INITDIALOG:
pContext = (LANSTATUSUI_CONTEXT *)lParam;
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
pContext->nIDEvent = SetTimer(hwndDlg, 0xFABC, 1000, NULL);
pContext->nIDEvent = SetTimer(hwndDlg, NETTIMERID, 1000, NULL);
return TRUE;
case WM_TIMER:
pContext = (LANSTATUSUI_CONTEXT*)GetWindowLongPtr(hwndDlg, DWLP_USER);
@ -946,6 +948,8 @@ CLanStatus::InitializeNetTaskbarNotifications()
ZeroMemory(pContext, sizeof(LANSTATUSUI_CONTEXT));
pContext->uID = Index;
pContext->pNet = pNetCon;
pContext->Status = -1;
pContext->dwAdapterIndex = Index;
pItem->uID = Index;
pItem->pNext = NULL;
pItem->pNet = pNetCon;

View File

@ -125,3 +125,4 @@
#define IDS_WZD_DOMAIN_NAME 13457
#define IDR_NETSHELL 20000