https://git.reactos.org/?p=reactos.git;a=commitdiff;h=419fb423cef95351497a0…
commit 419fb423cef95351497a08af1caae0fe732cebba
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Wed Jun 12 18:04:50 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Wed Jun 12 18:04:50 2019 +0200
[IPCONFIG] Show the Description and Physical Address for disconnected network
adapters.
---
base/applications/network/ipconfig/ipconfig.c | 29 ++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/base/applications/network/ipconfig/ipconfig.c
b/base/applications/network/ipconfig/ipconfig.c
index 8198e6702db..fe5b7aced62 100644
--- a/base/applications/network/ipconfig/ipconfig.c
+++ b/base/applications/network/ipconfig/ipconfig.c
@@ -480,6 +480,7 @@ VOID ShowInfo(BOOL bAll)
while (pAdapter)
{
LPTSTR IntType, myConType;
+ BOOLEAN bConnected = TRUE;
mibEntry.dwIndex = pAdapter->Index;
GetIfEntry(&mibEntry);
@@ -494,12 +495,13 @@ VOID ShowInfo(BOOL bAll)
/* check if the adapter is connected to the media */
if (mibEntry.dwOperStatus != MIB_IF_OPER_STATUS_CONNECTED &&
mibEntry.dwOperStatus != MIB_IF_OPER_STATUS_OPERATIONAL)
{
+ bConnected = FALSE;
_tprintf(_T("\tMedia State . . . . . . . . . . . : Media
disconnected\n"));
- pAdapter = pAdapter->Next;
- continue;
}
-
- _tprintf(_T("\tConnection-specific DNS Suffix. . : %s\n"),
pFixedInfo->DomainName);
+ else
+ {
+ _tprintf(_T("\tConnection-specific DNS Suffix. . : %s\n"),
pFixedInfo->DomainName);
+ }
if (bAll)
{
@@ -507,11 +509,20 @@ VOID ShowInfo(BOOL bAll)
_tprintf(_T("\tDescription . . . . . . . . . . . : %s\n"),
lpDesc);
HeapFree(ProcessHeap, 0, lpDesc);
_tprintf(_T("\tPhysical Address. . . . . . . . . : %s\n"),
PrintMacAddr(pAdapter->Address));
- if (pAdapter->DhcpEnabled)
- _tprintf(_T("\tDHCP Enabled. . . . . . . . . . . : Yes\n"));
- else
- _tprintf(_T("\tDHCP Enabled. . . . . . . . . . . : No\n"));
- _tprintf(_T("\tAutoconfiguration Enabled . . . . : \n"));
+ if (bConnected)
+ {
+ if (pAdapter->DhcpEnabled)
+ _tprintf(_T("\tDHCP Enabled. . . . . . . . . . . :
Yes\n"));
+ else
+ _tprintf(_T("\tDHCP Enabled. . . . . . . . . . . :
No\n"));
+ _tprintf(_T("\tAutoconfiguration Enabled . . . . : \n"));
+ }
+ }
+
+ if (!bConnected)
+ {
+ pAdapter = pAdapter->Next;
+ continue;
}
_tprintf(_T("\tIP Address. . . . . . . . . . . . : %s\n"),
pAdapter->IpAddressList.IpAddress.String);