Commit 9b5cde85 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed a few bugs in network interface handling (code & test).

parent 412d37f6
......@@ -352,7 +352,7 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
toIPAddressString(getInterfaceMaskByIndex(table->indexes[ndx]),
ptr->IpAddressList.IpMask.String);
if (ndx < table->numIndexes + 1)
ptr->Next = &pAdapterInfo[ndx + 1];
ptr->Next = (ndx == table->numIndexes - 1) ? NULL : &pAdapterInfo[ndx + 1];
}
ret = NO_ERROR;
}
......
......@@ -162,7 +162,7 @@ static void run_wkstatransportenum_tests(void)
ok(bufPtr != NULL, "got data back");
ok(entriesRead > 0, "read at least one transport");
ok(totalEntries > 0, "at least one transport");
NetApiBufferFree(bufPtr);
pNetApiBufferFree(bufPtr);
}
}
......
......@@ -156,9 +156,9 @@ NetWkstaTransportEnum(LPCWSTR ServerName, DWORD level, LPBYTE* pbuf,
for (n_adapt = 0, ptr = info; ptr; ptr = ptr->Next)
n_adapt++;
size_needed = n_adapt * (sizeof(WKSTA_TRANSPORT_INFO_0)
size_needed = n_adapt * sizeof(WKSTA_TRANSPORT_INFO_0)
+ n_adapt * TRANSPORT_NAME_LEN * sizeof (WCHAR)
+ n_adapt * 13 * sizeof (WCHAR));
+ n_adapt * 13 * sizeof (WCHAR);
if (prefmaxlen == MAX_PREFERRED_LENGTH)
NetApiBufferAllocate( size_needed, (LPVOID *) pbuf);
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment