[IPCONFIG]

- Fix the media detection code in ipconfig

svn path=/trunk/; revision=48240
This commit is contained in:
Cameron Gutman 2010-07-25 03:02:01 +00:00
parent fbdc7009aa
commit d1cca9ae42

View file

@ -359,6 +359,7 @@ CLEANUP:
VOID ShowInfo(BOOL bAll) VOID ShowInfo(BOOL bAll)
{ {
MIB_IFROW mibEntry;
PIP_ADAPTER_INFO pAdapterInfo = NULL; PIP_ADAPTER_INFO pAdapterInfo = NULL;
PIP_ADAPTER_INFO pAdapter = NULL; PIP_ADAPTER_INFO pAdapter = NULL;
ULONG adaptOutBufLen = 0; ULONG adaptOutBufLen = 0;
@ -441,6 +442,9 @@ VOID ShowInfo(BOOL bAll)
{ {
LPTSTR IntType, myConType; LPTSTR IntType, myConType;
mibEntry.dwIndex = pAdapter->Index;
GetIfEntry(&mibEntry);
IntType = GetInterfaceTypeName(pAdapter->Type); IntType = GetInterfaceTypeName(pAdapter->Type);
myConType = GetConnectionType(pAdapter->AdapterName); myConType = GetConnectionType(pAdapter->AdapterName);
@ -449,7 +453,7 @@ VOID ShowInfo(BOOL bAll)
if (myConType != NULL) HeapFree(ProcessHeap, 0, myConType); if (myConType != NULL) HeapFree(ProcessHeap, 0, myConType);
/* check if the adapter is connected to the media */ /* 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")); _tprintf(_T("\tMedia State . . . . . . . . . . . : Media disconnected\n"));
pAdapter = pAdapter->Next; pAdapter = pAdapter->Next;