From d1cca9ae4213326fb8c948d6b79d03b77816eaf5 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 25 Jul 2010 03:02:01 +0000 Subject: [PATCH] [IPCONFIG] - Fix the media detection code in ipconfig svn path=/trunk/; revision=48240 --- reactos/base/applications/network/ipconfig/ipconfig.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reactos/base/applications/network/ipconfig/ipconfig.c b/reactos/base/applications/network/ipconfig/ipconfig.c index 5bb2d95fc25..3d9de7d8e19 100644 --- a/reactos/base/applications/network/ipconfig/ipconfig.c +++ b/reactos/base/applications/network/ipconfig/ipconfig.c @@ -359,6 +359,7 @@ CLEANUP: VOID ShowInfo(BOOL bAll) { + MIB_IFROW mibEntry; PIP_ADAPTER_INFO pAdapterInfo = NULL; PIP_ADAPTER_INFO pAdapter = NULL; ULONG adaptOutBufLen = 0; @@ -441,6 +442,9 @@ VOID ShowInfo(BOOL bAll) { LPTSTR IntType, myConType; + mibEntry.dwIndex = pAdapter->Index; + GetIfEntry(&mibEntry); + IntType = GetInterfaceTypeName(pAdapter->Type); myConType = GetConnectionType(pAdapter->AdapterName); @@ -449,7 +453,7 @@ VOID ShowInfo(BOOL bAll) if (myConType != NULL) HeapFree(ProcessHeap, 0, myConType); /* check if the adapter is connected to the media */ - if (_tcscmp(pAdapter->IpAddressList.IpAddress.String, "0.0.0.0") == 0) + if (mibEntry.dwOperStatus != MIB_IF_OPER_STATUS_CONNECTED && mibEntry.dwOperStatus != MIB_IF_OPER_STATUS_OPERATIONAL) { _tprintf(_T("\tMedia State . . . . . . . . . . . : Media disconnected\n")); pAdapter = pAdapter->Next;