12#define NETTIMERID 0xFABC
29 DWORD DurationSeconds;
48 else if (IfEntry->
dwSpeed < 1000000)
56 else if (IfEntry->
dwSpeed < 1000000000)
89 DurationSeconds = Ticks / 1000;
90 TimeConnected.
wSecond = (DurationSeconds % 60);
91 TimeConnected.
wMinute = (DurationSeconds / 60) % 60;
92 TimeConnected.
wHour = (DurationSeconds / (60 * 60)) % 24;
93 TimeConnected.
wDay = DurationSeconds / (60 * 60 * 24);
98 if (!TimeConnected.
wDay)
104 if (TimeConnected.
wDay == 1)
107 DayBuffer[0] =
L'\0';
112 DayBuffer[0] =
L'\0';
172 if (pContext->
Status != 4)
180 if (pContext->
Status != 5)
187 if (hwndDlg &&
hIcon)
300 lc.
fmt = LVCFMT_FIXED_WIDTH;
340 li.pszText = szBuffer;
347 }
while (
pCur &&
pCur->IpAddress.String[0]);
364 li.pszText = szBuffer;
380 UINT nCharDate, nCharTime;
383 st.
wYear = pTM->tm_year + 1900;
384 st.
wMonth = pTM->tm_mon + 1;
385 st.
wDay = pTM->tm_mday;
386 st.
wHour = pTM->tm_hour;
452 pCurAdapter = pAdapterInfo;
454 pCurAdapter = pCurAdapter->
Next;
465 li.pszText = szBuffer;
503 struct tm *leaseOptained;
514 struct tm *leaseExpire;
571 WCHAR szBuffer[100] = {0};
588 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
692 pContext->hwndDlg =
NULL;
745 pCurAdapter = pAdapterInfo;
746 while (pCurAdapter->
Index != dwAdapterIndex)
747 pCurAdapter = pCurAdapter->
Next;
811 if (hppages[pinfo.
nPages])
891 TRACE(
"InitializeNetTaskbarNotifications\n");
915 pItem = pItem->
pNext;
932 hr = pEnumCon->Next(1, &pNetCon, &
Count);
936 TRACE(
"new connection\n");
950 pContext->
pNet = pNetCon;
955 pItem->
pNet = pNetCon;
960 ERR(
"CreateDialogParamW failed\n");
972 hr = pNetCon->GetProperties(&pProps);
993 pContext->hwndStatusDlg = hwndDlg;
999 pLast->
pNext = pItem;
1008 ERR(
"Shell_NotifyIconW failed\n");
1033 pItem = pItem->
pNext;
1043 const GUID *pguidCmdGroup,
1055 const GUID *pguidCmdGroup,
1063 if (
IsEqualGUID(*pguidCmdGroup, CGID_ShellServiceObject))
ULONGLONG WINAPI GetTickCount64(VOID)
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
void ReleaseBuffer(_In_ int nNewLength=-1)
HRESULT InitializeNetTaskbarNotifications()
CComPtr< INetConnectionManager > m_lpNetMan
NOTIFICATION_ITEM * m_pHead
STDMETHOD() Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) override
HRESULT ShowStatusDialogByCLSID(const GUID *pguidCmdGroup)
STDMETHOD() QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD *prgCmds, OLECMDTEXT *pCmdText) override
BOOL GetAdapterIndexFromNetCfgInstanceId(PIP_ADAPTER_INFO pAdapterInfo, LPWSTR szNetCfg, PDWORD pIndex)
HRESULT WINAPI CNetConnectionManager_CreateInstance(REFIID riid, LPVOID *ppv)
#define IDD_LAN_NETSTATUSDETAILS
#define IDD_LAN_NETSTATUS
#define IDC_STATUS_PROPERTIES
#define IDS_STATUS_CONNECTED
#define IDC_DETAILSGATEWAY
#define IDS_ASSIGNED_MANUAL
#define IDS_DURATION_DAYS
#define IDD_LAN_NETSTATUSADVANCED
#define IDS_ASSIGNED_DHCP
#define IDC_DETAILSSUBNET
#define IDS_LEASE_EXPIRES
#define IDS_PHYSICAL_ADDRESS
#define IDS_LEASE_OBTAINED
#define IDS_STATUS_DISCONNECTED
#define IDS_STATUS_UNREACHABLE
#define IDS_STATUS_CONNECTING
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
#define MultiByteToWideChar
#define FAILED_UNEXPECTEDLY(hr)
DWORD WINAPI GetTickCount(VOID)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER pAddr
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT GetProperties([out] NETCON_PROPERTIES **ppProps)
DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow)
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
#define MIB_IF_OPER_STATUS_DISCONNECTED
#define MIB_IF_OPER_STATUS_CONNECTED
#define MIB_IF_OPER_STATUS_NON_OPERATIONAL
#define MIB_IF_OPER_STATUS_UNREACHABLE
#define MIB_IF_OPER_STATUS_OPERATIONAL
static BOOL tmToStr(IN struct tm *pTM, OUT LPWSTR szBuffer, IN UINT nBufferSize)
VOID ShowStatusPropertyDialog(LANSTATUSUI_CONTEXT *pContext, HWND hwndDlg)
VOID InitializeLANStatusUiDlg(HWND hwndDlg, LANSTATUSUI_CONTEXT *pContext)
INT_PTR CALLBACK LANStatusUiDetailsDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID UpdateLanStatusUiDlg(HWND hwndDlg, MIB_IFROW *IfEntry, LANSTATUSUI_CONTEXT *pContext)
static INT InsertItemToListView(HWND hDlgCtrl, UINT ResId)
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
INT_PTR CALLBACK LANStatusUiAdvancedDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID AddIPAddressToListView(HWND hDlgCtrl, PIP_ADDR_STRING pAddr, INT Index)
INT_PTR CALLBACK LANStatusUiDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID InsertColumnToListView(HWND hDlgCtrl, UINT ResId, UINT SubItem, UINT Size)
INT_PTR CALLBACK LANStatusDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID DisableNetworkAdapter(INetConnection *pNet, LANSTATUSUI_CONTEXT *pContext, HWND hwndDlg)
VOID InitializePropertyDialog(LANSTATUSUI_CONTEXT *pContext, NETCON_PROPERTIES *pProperties)
VOID UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT *pContext)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
struct _PSP * HPROPSHEETPAGE
HPROPSHEETPAGE InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
HINSTANCE netshell_hInstance
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
#define LOCALE_USER_DEFAULT
#define PropSheet_PressButton(d, i)
struct _PROPSHEETHEADERW PROPSHEETHEADERW
struct _PSHNOTIFY * LPPSHNOTIFY
#define FOURTH_IPADDRESS(x)
#define FIRST_IPADDRESS(x)
#define ListView_GetItemCount(hwnd)
#define SECOND_IPADDRESS(x)
#define LVM_INSERTCOLUMNW
#define THIRD_IPADDRESS(x)
#define IsEqualGUID(rguid1, rguid2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
HRESULT ShowNetConnectionProperties(INetConnection *pNetConnect, HWND hwnd)
IP_ADDR_STRING SecondaryWinsServer
IP_ADDR_STRING IpAddressList
BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]
IP_ADDR_STRING DhcpServer
IP_ADDR_STRING GatewayList
struct _IP_ADAPTER_INFO * Next
IP_ADDR_STRING PrimaryWinsServer
IP_ADDRESS_STRING IpAddress
IP_ADDR_STRING DnsServerList
INTERNAL_IF_OPER_STATUS dwOperStatus
struct _SINGLE_LIST_ENTRY * Next
NETCON_MEDIATYPE MediaType
struct tagNotificationItem * pNext
BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW pnid)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
#define ERROR_BUFFER_OVERFLOW
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define LR_COPYFROMRESOURCE
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
#define MAKEINTRESOURCEW(i)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
BOOL WINAPI BringWindowToTop(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
#define IID_PPV_ARG(Itype, ppType)