[TCPIP] Return MIB_IF_TYPE_ETHERNET for WLAN adapter types when compiling ReactOS as NT 5.2 (#8300)

Split Windows Server 2003 and Windows Vista behaviour in two different cases and make them used separately: when ReactOS target version is NT 5.2, use the 1st case, otherwise use the 2nd one instead.
Also, handle NdisPhysicalMediumNative802_11 case only for NT 6.0 and newer, since that's actually supported starting from NDIS 6.0, according to MSDN:
https://learn.microsoft.com/en-us/windows-hardware/drivers/network/oid-gen-physical-medium
while for NDIS 5.1 and newer it's:
https://learn.microsoft.com/en-us/previous-versions/windows/hardware/network/ff560255(v=vs.85)
This fixes:
1. A critical regression with unavailable networking in ReactOS when 3rd-party NT5-compatible Ethernet/Wi-Fi drivers are used (both in VM and on real hardware) caused by commit 3842b59f75 from @EricKohl.
2. Failure to open Network Properties and Network Status from the Network tray icon (caused by the same commit too).
MSDN tells us this is done so for Windows XP and Server 2003 as well, and IF_TYPE_IEEE80211 is returned only in Windows Vista and newer, so the following Microsoft documentation is actually correct in this case:
https://learn.microsoft.com/en-us/windows/win32/api/iptypes/ns-iptypes-ip_adapter_info
(see the information about "IP_ADAPTER_INFO.Type" member below on that page)
!!!Please note that the behaviour of Vista+ case (e. g., when compiling ReactOS targeted as NT 6.0 and newer) remains unchanged after this fix (networking still may not work), so it still requires the proper support of 3rd-party NT6+ compatible network miniport drivers (by handling this case via the Vista/NDIS6-style way) for NT6 target!!!
CORE-20244
This commit is contained in:
Oleg Dubinskiy
2025-08-08 16:10:50 +02:00
committed by GitHub
parent 7b1c15f182
commit 62f9d1ad46

View File

@@ -72,7 +72,12 @@ TDI_STATUS InfoTdiQueryGetInterfaceMIB(TDIEntityID ID,
case NdisPhysicalMediumUnspecified:
#endif
case NdisPhysicalMediumWirelessLan:
/* Win2003: MIB_IF_TYPE_ETHERNET; Vista+: IF_TYPE_IEEE80211 */
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
OutData->if_type = IF_TYPE_IEEE80211;
#else
OutData->if_type = MIB_IF_TYPE_ETHERNET;
#endif
break;
#if 0
case NdisPhysicalMediumCableModem:
@@ -83,9 +88,12 @@ TDI_STATUS InfoTdiQueryGetInterfaceMIB(TDIEntityID ID,
case NdisPhysicalMedium1394:
case NdisPhysicalMediumWirelessWan:
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
/* NDIS 6.0+ (Vista+) */
case NdisPhysicalMediumNative802_11:
OutData->if_type = IF_TYPE_IEEE80211;
break;
#endif
#if 0
case NdisPhysicalMediumBluetooth:
case NdisPhysicalMediumInfiniband: