]> granicus.if.org Git - php/commitdiff
list net/interfaces, trying to get the error on windows when possible
authorDavid Carlier <devnexen@gmail.com>
Wed, 22 May 2019 22:04:56 +0000 (00:04 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 24 May 2019 08:22:39 +0000 (10:22 +0200)
ext/standard/net.c

index 6bec7f06b556c20c8a644e398493b618e86c7225..600ef8d0e0e39da4c9e996b0106e361bd252b100 100644 (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;
        }