iphlpapi: fix GetAdaptersAddresses return values

Timo Teräs timo.teras at iki.fi
Thu Dec 23 10:13:49 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:
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:
 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: 766 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20101223/fb9f601d/attachment.bin>

More information about the wine-patches mailing list