mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Properly return status in iphplapi, and don't close the file handle before we use it in getNumInterfacesInt.
svn path=/trunk/; revision=17994
This commit is contained in:
parent
b64b3f38a0
commit
1e482c105d
1 changed files with 16 additions and 12 deletions
|
@ -166,8 +166,10 @@ NTSTATUS tdiGetSetOfThings( HANDLE tcpFile,
|
||||||
&allocationSizeForEntityArray,
|
&allocationSizeForEntityArray,
|
||||||
NULL );
|
NULL );
|
||||||
|
|
||||||
if( !NT_SUCCESS(status) ) {
|
if(!status)
|
||||||
return status;
|
{
|
||||||
|
DPRINT("IOCTL Failed\n");
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
arraySize = allocationSizeForEntityArray;
|
arraySize = allocationSizeForEntityArray;
|
||||||
|
@ -195,9 +197,10 @@ NTSTATUS tdiGetSetOfThings( HANDLE tcpFile,
|
||||||
HeapFree( GetProcessHeap(), 0, entitySet );
|
HeapFree( GetProcessHeap(), 0, entitySet );
|
||||||
entitySet = 0;
|
entitySet = 0;
|
||||||
|
|
||||||
if( !NT_SUCCESS(status) ) {
|
if(!status)
|
||||||
DPRINT("TdiGetSetOfThings() => %08x\n", (int)status);
|
{
|
||||||
return status;
|
DPRINT("IOCTL Failed\n");
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("TdiGetSetOfThings(): Array changed size: %d -> %d.\n",
|
DPRINT("TdiGetSetOfThings(): Array changed size: %d -> %d.\n",
|
||||||
|
@ -241,10 +244,11 @@ NTSTATUS tdiGetMibForIfEntity
|
||||||
&returnSize,
|
&returnSize,
|
||||||
NULL );
|
NULL );
|
||||||
|
|
||||||
if( !NT_SUCCESS(status) ) {
|
if(!status)
|
||||||
TRACE("failure: %08x\n", status);
|
{
|
||||||
return status;
|
DPRINT("IOCTL Failed\n");
|
||||||
} else TRACE("Success.\n");
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
|
||||||
DPRINT("TdiGetMibForIfEntity() => {\n"
|
DPRINT("TdiGetMibForIfEntity() => {\n"
|
||||||
" if_index ....................... %x\n"
|
" if_index ....................... %x\n"
|
||||||
|
@ -339,7 +343,7 @@ NTSTATUS tdiGetEntityType( HANDLE tcpFile, TDIEntityID *ent, PULONG type ) {
|
||||||
|
|
||||||
DPRINT("TdiGetEntityType() => %08x %08x\n", *type, status);
|
DPRINT("TdiGetEntityType() => %08x %08x\n", *type, status);
|
||||||
|
|
||||||
return status;
|
return (status ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS getInterfaceInfoSet( HANDLE tcpFile,
|
static NTSTATUS getInterfaceInfoSet( HANDLE tcpFile,
|
||||||
|
@ -425,8 +429,6 @@ static DWORD getNumInterfacesInt(BOOL onlyNonLoopback)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
closeTcpFile( tcpFile );
|
|
||||||
|
|
||||||
for( i = 0; i < numEntities; i++ ) {
|
for( i = 0; i < numEntities; i++ ) {
|
||||||
if( isInterface( &entitySet[i] ) &&
|
if( isInterface( &entitySet[i] ) &&
|
||||||
(!onlyNonLoopback ||
|
(!onlyNonLoopback ||
|
||||||
|
@ -437,6 +439,8 @@ static DWORD getNumInterfacesInt(BOOL onlyNonLoopback)
|
||||||
DPRINT("getNumInterfaces: success: %d %d %08x\n",
|
DPRINT("getNumInterfaces: success: %d %d %08x\n",
|
||||||
onlyNonLoopback, numInterfaces, status );
|
onlyNonLoopback, numInterfaces, status );
|
||||||
|
|
||||||
|
closeTcpFile( tcpFile );
|
||||||
|
|
||||||
tdiFreeThingSet( entitySet );
|
tdiFreeThingSet( entitySet );
|
||||||
|
|
||||||
return numInterfaces;
|
return numInterfaces;
|
||||||
|
|
Loading…
Reference in a new issue