https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fc882c48de225ec3e83f31ad25bda3331b58bf16

commit fc882c48de225ec3e83f31ad25bda3331b58bf16
Author:     Eric Kohl <[email protected]>
AuthorDate: Sun Apr 19 22:05:24 2020 +0200
Commit:     Eric Kohl <[email protected]>
CommitDate: Sun Apr 19 22:06:12 2020 +0200

    [NETSHELL] Show DHCP and WINS information in the network connection details 
dialog
---
 dll/shellext/netshell/lanstatusui.cpp | 43 ++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 6 deletions(-)

diff --git a/dll/shellext/netshell/lanstatusui.cpp 
b/dll/shellext/netshell/lanstatusui.cpp
index 08ade893e56..033ff13ac47 100644
--- a/dll/shellext/netshell/lanstatusui.cpp
+++ b/dll/shellext/netshell/lanstatusui.cpp
@@ -439,13 +439,39 @@ LANStatusUiDetailsDlg(
                     if (MultiByteToWideChar(CP_ACP, 0, 
pCurAdapter->GatewayList.IpAddress.String, -1, szBuffer, 
sizeof(szBuffer)/sizeof(WCHAR)))
                         SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
                 }
-#if 0
+
+                li.iItem = InsertItemToListView(hDlgCtrl, IDS_DHCP_SERVER);
+                if (li.iItem >= 0 && 
pCurAdapter->DhcpServer.IpAddress.String[0] != '0')
+                {
+                    if (MultiByteToWideChar(CP_ACP, 0, 
pCurAdapter->DhcpServer.IpAddress.String, -1, szBuffer, 
sizeof(szBuffer)/sizeof(WCHAR)))
+                        SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
+                }
+
                 li.iItem = InsertItemToListView(hDlgCtrl, IDS_LEASE_OBTAINED);
+                if (li.iItem >= 0 && pCurAdapter->LeaseObtained != NULL)
+                {
+                    struct tm *leaseOptained;
+
+                    leaseOptained = localtime(&pCurAdapter->LeaseObtained);
+
+                    if (wcsftime(szBuffer, 100, L"%m/%d/%Y %H:%M:%S %p", 
leaseOptained) != 0)
+                        SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
+                }
+
                 li.iItem = InsertItemToListView(hDlgCtrl, IDS_LEASE_EXPIRES);
-#endif
+                if (li.iItem >= 0 && pCurAdapter->LeaseExpires != NULL)
+                {
+                    struct tm *leaseExpire;
+
+                    leaseExpire = localtime(&pCurAdapter->LeaseExpires);
+
+                    if (wcsftime(szBuffer, 100, L"%m/%d/%Y %H:%M:%S %p", 
leaseExpire) != 0)
+                        SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
+                }
             }
 
             dwSize = 0;
+            li.iItem = InsertItemToListView(hDlgCtrl, IDS_DNS_SERVERS);
             if (GetPerAdapterInfo(pContext->dwAdapterIndex, NULL, &dwSize) == 
ERROR_BUFFER_OVERFLOW)
             {
                 pPerAdapter = 
static_cast<PIP_PER_ADAPTER_INFO>(CoTaskMemAlloc(dwSize));
@@ -460,16 +486,20 @@ LANStatusUiDetailsDlg(
                     CoTaskMemFree(pPerAdapter);
                 }
             }
-#if 0
+
             if (pCurAdapter)
             {
                 li.iItem = InsertItemToListView(hDlgCtrl, IDS_WINS_SERVERS);
-                AddIPAddressToListView(hDlgCtrl, 
&pCurAdapter->PrimaryWinsServer, li.iItem);
-                AddIPAddressToListView(hDlgCtrl, 
&pCurAdapter->SecondaryWinsServer, li.iItem+1);
+                if (pCurAdapter->HaveWins)
+                {
+                    AddIPAddressToListView(hDlgCtrl, 
&pCurAdapter->PrimaryWinsServer, li.iItem);
+                    AddIPAddressToListView(hDlgCtrl, 
&pCurAdapter->SecondaryWinsServer, li.iItem+1);
+                }
             }
-#endif
+
             CoTaskMemFree(pAdapterInfo);
             break;
+
         case WM_COMMAND:
             if (LOWORD(wParam) == IDC_CLOSE)
             {
@@ -477,6 +507,7 @@ LANStatusUiDetailsDlg(
                 break;
             }
     }
+
     return FALSE;
 }
 

Reply via email to