iphlpapi: fix GetAdaptersAddresses return values

Timo Teräs timo.teras at iki.fi
Thu Dec 23 10:14:17 CST 2010


We should return ERROR_BUFFER_OVERFLOW always if the buffer
pointer is NULL (regardless of old buffer length).

Additionally, while strictly not defined, Windows seems to always
return the WCHAR members as valid pointers. This is easily verified
by checking the output of the example code at:
http://msdn.microsoft.com/en-us/library/aa365915%28v=VS.85%29.aspx
In Windows it will not print (null) ever. Some programs seem to
rely on this behaviour.

One test case which does not work at all without these changes is
available from:
http://www.ipv6style.jp/files/ipv6/en/apps/20060320_2/GetAdaptersAddresses-EN.c
---
This is for wine-1.2 branch.

 dlls/iphlpapi/iphlpapi_main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-iphlpapi-fix-GetAdaptersAddresses-return-values.txt
Type: text/x-patch
Size: 934 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20101223/3d25bd5e/attachment.bin>


More information about the wine-patches mailing list