Commit 926fa5bd authored by Pekka Pessi's avatar Pekka Pessi
Browse files

su_localinfo.c: convert GetAdaptersAddresses error code ERROR_NO_DATA to ELI_NOADDRESS

darcs-hash:20070226202518-55b16-331cd75ce2ea1dd2c49b766a3a9b86b66cd2c904.gz
parent cfba1b8f
......@@ -1220,7 +1220,25 @@ int win_localinfo(su_localinfo_t const hints[1], su_localinfo_t **rresult)
error = GetAdaptersAddresses(hints->li_family, flags, NULL, iaa0, &iaa_size);
}
if (error) {
SU_DEBUG_1(("su_localinfo: GetAdaptersAddresses failed: %d\n", error));
char const *empty = "";
LPTSTR msg = empty;
if (error == ERROR_NO_DATA) {
error = ELI_NOADDRESS;
goto err;
}
if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
msg, 0, NULL))
msg = empty;
SU_DEBUG_1(("su_localinfo: GetAdaptersAddresses: %s (%d)\n", msg, error));
if (msg != empty) LocalFree((LPVOID)msg);
error = ELI_SYSTEM;
goto err;
}
......
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