Fix getInterfaceInfoSet so GetInterfaceInfo returns only non-loopback
adapters, however, we still return some incorrect info.
Silenced a DPRINT.
Modified: trunk/reactos/lib/iphlpapi/ifenum_reactos.c
Modified: trunk/reactos/lib/iphlpapi/iphlpapi_main.c
_____
Modified: trunk/reactos/lib/iphlpapi/ifenum_reactos.c
--- trunk/reactos/lib/iphlpapi/ifenum_reactos.c 2005-09-25 00:35:13 UTC
(rev 18040)
+++ trunk/reactos/lib/iphlpapi/ifenum_reactos.c 2005-09-25 04:55:16 UTC
(rev 18041)
@@ -363,6 +363,7 @@
if( infoSetInt ) {
for( i = 0; i < numEntities; i++ ) {
if( isInterface( &entIDSet[i] ) ) {
+ infoSetInt[curInterf].entity_id = entIDSet[i];
status = tdiGetMibForIfEntity
( tcpFile,
&entIDSet[i],
@@ -769,7 +770,7 @@
sizeof(info.if_info) );
}
- DPRINT1("entry->bDescr = %s\n", entry->bDescr);
+ DPRINT("entry->bDescr = %s\n", entry->bDescr);
closeTcpFile( tcpFile );
}
_____
Modified: trunk/reactos/lib/iphlpapi/iphlpapi_main.c
--- trunk/reactos/lib/iphlpapi/iphlpapi_main.c 2005-09-25 00:35:13 UTC
(rev 18040)
+++ trunk/reactos/lib/iphlpapi/iphlpapi_main.c 2005-09-25 04:55:16 UTC
(rev 18041)
@@ -935,8 +935,9 @@
if (!dwOutBufLen)
ret = ERROR_INVALID_PARAMETER;
else {
- DWORD numInterfaces = getNumInterfaces();
- ULONG size = sizeof(IP_INTERFACE_INFO) + (numInterfaces - 1) *
+ DWORD numNonLoopbackInterfaces = getNumNonLoopbackInterfaces();
+ DPRINT("numNonLoopbackInterfaces == 0x%x\n",
numNonLoopbackInterfaces);
+ ULONG size = sizeof(IP_INTERFACE_INFO) + (numNonLoopbackInterfaces)
*
sizeof(IP_ADAPTER_INDEX_MAP);
if (!pIfTable || *dwOutBufLen < size) {
@@ -944,10 +945,11 @@
ret = ERROR_INSUFFICIENT_BUFFER;
}
else {
- InterfaceIndexTable *table = getInterfaceIndexTable();
+ InterfaceIndexTable *table = getNonLoopbackInterfaceIndexTable();
+ DPRINT("table->numIndexes == 0x%x\n", table->numIndexes);
if (table) {
- size = sizeof(IP_INTERFACE_INFO) + (table->numIndexes - 1) *
+ size = sizeof(IP_INTERFACE_INFO) + (table->numIndexes) *
sizeof(IP_ADAPTER_INDEX_MAP);
if (*dwOutBufLen < size) {
*dwOutBufLen = size;
Show replies by date