list net/interfaces, trying to get the error on windows when possible

This commit is contained in:
David Carlier 2019-05-23 00:04:56 +02:00 committed by Christoph M. Becker
parent 49a3b03e9f
commit d9747c23a2

View file

@ -177,7 +177,9 @@ PHP_FUNCTION(net_get_interfaces) {
dwRetVal = GetAdaptersAddresses(family, flags, NULL, pAddresses, &outBufLen);
if (NO_ERROR != dwRetVal) {
/* TODO check GetLastError() */
char *buf = php_win32_error_to_msg(GetLastError());
zend_error(E_WARNING, "GetAdaptersAddresses failed: %s", buf);
php_win32_error_msg_free(buf);
FREE(pAddresses);
RETURN_FALSE;
}