* functions into iphlpv6.c (arty)
*/
#include "iphlpapi_private.h"
-#include "ifenum.h"
-#include <assert.h>
WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
}
}
+ tdiFreeThingSet(entIDSet);
+
if (NT_SUCCESS(status)) {
*infoSet = infoSetInt;
*numInterfaces = curInterf;
TRACE("Index %d is entity #%d - %04x:%08x\n", index, i,
entitySet[i].tei_entity, entitySet[i].tei_instance );
+ tdiFreeThingSet( entitySet );
+
if( numInterfaces == index && i < numEntities ) {
memcpy( ent, &entitySet[i], sizeof(*ent) );
- tdiFreeThingSet( entitySet );
return STATUS_SUCCESS;
} else {
- tdiFreeThingSet( entitySet );
return STATUS_UNSUCCESSFUL;
}
}
int i;
if( NT_SUCCESS(status) )
+ {
for( i = 0; i < numInterfaces; i++ ) {
if( ifInfo[i].if_info.ent.if_index == index ) {
memcpy( info, &ifInfo[i], sizeof(*info) );
}
}
- if( NT_SUCCESS(status) )
+ HeapFree(GetProcessHeap(), 0, ifInfo);
+
return i < numInterfaces ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
- else
- return status;
+ }
+
+ return status;
}
NTSTATUS getInterfaceInfoByName( HANDLE tcpFile, char *name, IFInfo *info ) {
NTSTATUS status = getInterfaceInfoSet( tcpFile, &ifInfo, &numInterfaces );
if( NT_SUCCESS(status) )
+ {
for( i = 0; i < numInterfaces; i++ ) {
if( !strcmp((PCHAR)ifInfo[i].if_info.ent.if_descr, name) ) {
memcpy( info, &ifInfo[i], sizeof(*info) );
}
}
- if( NT_SUCCESS(status) )
+ HeapFree(GetProcessHeap(), 0,ifInfo);
+
return i < numInterfaces ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
- else
- return status;
+ }
+
+ return status;
}
/* Note that the result of this operation must be freed later */