this patch fixes a few bugs in the network interface query & test code. A+ -- Eric Pouech
Name: if ChangeLog: fixed a few bugs in netword interface handling (code & test) License: X11 GenDate: 2003/06/21 07:25:28 UTC ModifiedFiles: dlls/iphlpapi/iphlpapi_main.c dlls/netapi32/wksta.c dlls/netapi32/tests/wksta.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/iphlpapi/iphlpapi_main.c,v retrieving revision 1.3 diff -u -u -r1.3 iphlpapi_main.c --- dlls/iphlpapi/iphlpapi_main.c 19 May 2003 21:41:00 -0000 1.3 +++ dlls/iphlpapi/iphlpapi_main.c 21 Jun 2003 07:21:02 -0000 @@ -352,7 +352,7 @@ 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; } Index: dlls/netapi32/wksta.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/netapi32/wksta.c,v retrieving revision 1.7 diff -u -u -r1.7 wksta.c --- dlls/netapi32/wksta.c 16 Jun 2003 01:23:20 -0000 1.7 +++ dlls/netapi32/wksta.c 21 Jun 2003 07:22:29 -0000 @@ -156,9 +156,9 @@ 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 Index: dlls/netapi32/tests/wksta.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/netapi32/tests/wksta.c,v retrieving revision 1.5 diff -u -u -r1.5 wksta.c --- dlls/netapi32/tests/wksta.c 30 Apr 2003 00:48:56 -0000 1.5 +++ dlls/netapi32/tests/wksta.c 21 Jun 2003 07:23:23 -0000 @@ -162,7 +162,7 @@ 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); } }