Commit graph

547 commits

Author SHA1 Message Date
Paul Gofman 9a11957bab nsiproxy.sys: Add static ARP entries which are always present on Windows.
Some apps (Roon or SCP: Secret Laboratory are examples) depend on ARP
table always containing some entries if there is a network adapter present.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53175
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
2022-06-27 10:34:12 +02:00
Zebediah Figura 23d85e6e9a dnsapi: Return a double-null-terminated string from DnsQueryConfig(DnsConfigSearchList).
DNS_TEXT_DATA contains pointers and is thus not WoW64 compatible. Since the API
is internal to Wine, use a simpler format instead of fixing our WoW64
translation.

The problem was found by Brendan Shanks; this solution was suggested by Hans Leidekker.
2022-06-27 10:32:41 +02:00
Huw Davies aa48b656dc iphlpapi: Don't allocate the IO status block on the stack.
Signed-off-by: Huw Davies <huw@codeweavers.com>
2022-06-23 22:46:13 +02:00
Paul Gofman bfd7b9bcf8 iphlpapi: Sort by adapter index first in GetIpNetTable().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
2022-06-21 18:53:18 +02:00
Paul Gofman fae847adcf iphlpapi: Correctly index dynamic data array.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
2022-06-21 18:53:18 +02:00
Jinoh Kang d36e785784 iphlpapi/tests: Add more tests for interface identifier conversion failure.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
2022-06-21 18:53:18 +02:00
Jinoh Kang f30ee1e0d6 iphlpapi/tests: Factor out interface identifier conversion with invalid parameters.
These tests call conversion functions with fixed parameter, and thus can
be taken out of the adapter enumeration loop.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
2022-06-21 18:53:18 +02:00
Jinoh Kang 59d281ee7c iphlpapi/tests: Add tests for GetBestInterfaceEx.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
2022-06-21 18:53:18 +02:00
Jinoh Kang ac9842bc9a iphlpapi/tests: Add tests for GetBestRoute.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
2022-06-21 18:53:18 +02:00
Jinoh Kang 3282d7abf2 iphlpapi/tests: Add tests for GetBestInterface.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
2022-06-21 18:53:18 +02:00
Huw Davies 1c83efac77 iphlpapi/tests: Allow the route's age to differ by one second.
Signed-off-by: Huw Davies <huw@codeweavers.com>
2022-06-21 18:53:18 +02:00
Paul Gofman 910d58520a iphlpapi: Return ERROR_NO_DATA from GetIpNetTable() if no entries are found.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
2022-06-15 11:51:45 +02:00
Paul Gofman 1a782a5215 iphlpapi: Don't request unused dynamic interface data.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-17 16:49:17 +02:00
Eric Pouech 7f6adab1bd iphlpapi: Don't cast SIZE_T to DWORD in trace, use %I instead.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-07 10:43:48 +02:00
Paul Gofman 3c19c54aa0 iphlpapi: Don't request redundant static data in get_extended_tcp_table().
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-23 18:42:13 +01:00
Eric Pouech 0c25cf0a08 iphlpapi/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 10:32:28 +01:00
Francois Gouget ed4a566f12 iphlpapi: Fix the IPv4 address network order for comparisons.
ipaddrrow_cmp() and ipforward_row_cmp() must perform byte-swapping in
order for the rows to be sorted as expected.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 22:05:33 +01:00
Francois Gouget 3aa18cc5d0 iphlpapi: Fix ULONG comparisons, most notably for IPv4 addresses.
The difference between two ULONGs may not fit in an int, causing sorting
errors.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 22:05:33 +01:00
Eric Pouech 61becab487 iphlpapi: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-11 11:21:27 +01:00
Eric Pouech bb1fc33570 include/msvcrt: Add attribute((format)) to printf and scanf -like APIs.
Fix a bunch of warnings generated by this patch and the migration of
GUID.Data1 to long in ae2693e2c4

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 18:38:55 +01:00
Gerald Pfeifer 56b26e1d66 iphlpapi: Zero-init prefix_len to avoid a compiler warning.
Signed-off-by: Gerald Pfeifer <gerald@pfeifer.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-28 21:10:21 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Alexandre Julliard ae2693e2c4 include: Use long type by default in GUID definition.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 17:56:07 +01:00
Huw Davies c1bbfe17a5 iphlpapi: Always populate the friendly name.
The GAA_FLAG_SKIP_FRIENDLY_NAME flag is essentially ignored.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48084
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-05 17:16:18 +01:00
André Zwing 6893f515d6 iphlpapi: Fix some spec file entries.
Signed-off-by: André Zwing <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:19:10 +01:00
Gabriel Ivăncescu 5cc085975f iphlpapi: Implement async requests for IcmpSendEcho2Ex.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 11:58:07 +01:00
Gabriel Ivăncescu 215c9275a8 nsiproxy: Fill the reply with the exact ICMP_ECHO_REPLY in the output buffer.
Because iphlpapi has no opportunity to convert the reply in async mode.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 11:57:59 +01:00
Huw Davies 8f73b8e15f iphlpapi: Use wide character string literals.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Huw Davies 3aa7c46229 iphlpapi: Build with nameless structs and unions.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Huw Davies 36cd04aed3 iphlpapi: Build with msvcrt.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Huw Davies 7156d2b1e4 iphlpapi: Implement IcmpSendEcho2Ex() using nsiproxy.
This results in a small change in behaviour reflected by the change to
the tests: previously IcmpCreateFile() would fail if neither a
SOCK_RAW nor a SOCK_DGRAM socket were available.  With this patch, that
failure is delayed until IcmpSendEcho2Ex().  There's no evidence that
the original behaviour matches Windows; it's likely the tests were
written this way to match Wine's implementation.  If there does turn
out to be an app that depends on the old behaviour, it would be
possible to send an ioctl during IcmpCreateFile() to probe for this.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Huw Davies 9d8abb1ee5 iphlpapi: Move the Icmp6 stubs to iphlpapi_main.c.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Huw Davies f6ca752201 iphlpapi: Implement IcmpParseReplies().
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Huw Davies da81d63f6f iphlpapi: Stop using USE_WS_PREFIX.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-06 20:29:34 +02:00
Alexandre Julliard 6ba7773121 makefiles: Add a -mcygwin flag to specify the inverse of -mno-cygwin.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Francois Gouget 9d82cda245 iphlpapi: Make the adapters_addresses_*() functions static.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-31 15:51:45 +02:00
Huw Davies 9521640aa7 iphlpapi: Return early on error.
This prevents using err uninitialized.  Spotted by Fabian Maurer.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51655
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-25 10:40:30 +02:00
Francois Gouget 8188b1ac84 iphlpapi: Fix an ASCII / ANSI mixup in a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-24 12:14:21 +02:00
Huw Davies 6460f72db4 iphlpapi: Use the correct physical address.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51642
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-23 11:54:28 +02:00
Huw Davies 773c585193 iphlpapi: Don't truncate 64-bit ptrs.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51620
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51626
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-23 11:54:25 +02:00
Huw Davies e39d5967c7 iphlpapi: Remove no longer needed libraries.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 11:16:49 +02:00
Huw Davies 7992178df5 iphlpapi: Use the ANSI codepage for the convert interface name functions.
The name in these functions is now not the Unix interface name.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 11:16:40 +02:00
Huw Davies 502fd1a4ba iphlpapi: Implement GetAdapterIndex() by parsing the GUID from the name.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 11:16:36 +02:00
Huw Davies 8d7720b0ed iphlpapi: Don't enumerate loopback interfaces in GetInterfaceInfo().
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 11:16:34 +02:00
Huw Davies 203350e030 iphlpapi: Implement GetInterfaceInfo() on top of nsi.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-19 11:16:31 +02:00
Huw Davies e91b19bf38 iphlpapi: Implement GetUdpStatisticsEx() on top of nsi.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 11:07:41 +02:00
Huw Davies ec0cf43497 iphlpapi: Implement AllocateAndGetUdpTableFromStack() on top of nsi.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 11:07:36 +02:00
Huw Davies 566079d4f6 iphlpapi: Implement GetExtendedUdpTable() on top of nsi.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 11:07:29 +02:00
Huw Davies 7341bee1dc iphlpapi: Implement AllocateAndGetTcp(Ex)TableFromStack() on top of nsi.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 11:43:28 +02:00
Huw Davies f535ab7197 iphlpapi: Implement GetTcpTable2() and GetTcp6Table2().
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 11:43:26 +02:00