mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
[IPHLPAPI]
Fix GetAdaptersAdresses operational status. ReactOS is now seen online. CORE-9178 #resolve Please retest apps with connectivity problems. svn path=/trunk/; revision=69791
This commit is contained in:
parent
3f041d1de6
commit
dc2365a661
3 changed files with 33 additions and 27 deletions
|
@ -6,6 +6,7 @@ include_directories(
|
||||||
|
|
||||||
spec2def(iphlpapi.dll iphlpapi.spec ADD_IMPORTLIB)
|
spec2def(iphlpapi.dll iphlpapi.spec ADD_IMPORTLIB)
|
||||||
|
|
||||||
|
add_definitions(-DGetAdaptersAddressesV2)
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
address.c
|
address.c
|
||||||
dhcp_reactos.c
|
dhcp_reactos.c
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "iphlpapi_private.h"
|
#include "iphlpapi_private.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
|
WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
|
||||||
#if 1
|
#ifdef GetAdaptersAddressesV2
|
||||||
/* Helper for GetAdaptersAddresses:
|
/* Helper for GetAdaptersAddresses:
|
||||||
* Retrieves the list of network adapters from tcpip.sys */
|
* Retrieves the list of network adapters from tcpip.sys */
|
||||||
static
|
static
|
||||||
|
@ -422,7 +422,11 @@ GetAdaptersAddresses(
|
||||||
CurrentAA->Flags = 0; // FIXME!
|
CurrentAA->Flags = 0; // FIXME!
|
||||||
CurrentAA->Mtu = Entry->if_mtu;
|
CurrentAA->Mtu = Entry->if_mtu;
|
||||||
CurrentAA->IfType = Entry->if_type;
|
CurrentAA->IfType = Entry->if_type;
|
||||||
CurrentAA->OperStatus = Entry->if_operstatus;
|
if(Entry->if_operstatus >= IF_OPER_STATUS_CONNECTING)
|
||||||
|
CurrentAA->OperStatus = IfOperStatusUp;
|
||||||
|
else
|
||||||
|
CurrentAA->OperStatus = IfOperStatusDown;
|
||||||
|
|
||||||
/* Next items */
|
/* Next items */
|
||||||
Ptr = (BYTE*)(CurrentAA + 1);
|
Ptr = (BYTE*)(CurrentAA + 1);
|
||||||
|
|
||||||
|
|
|
@ -1517,22 +1517,6 @@ DWORD WINAPI GetOwnerModuleFromTcpEntry( PMIB_TCPROW_OWNER_MODULE pTcpEntry, TCP
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************
|
|
||||||
* GetPerAdapterInfo (IPHLPAPI.@)
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* PARAMS
|
|
||||||
*
|
|
||||||
* IfIndex [In]
|
|
||||||
* pPerAdapterInfo [In/Out]
|
|
||||||
* pOutBufLen [In/Out]
|
|
||||||
*
|
|
||||||
* RETURNS
|
|
||||||
*
|
|
||||||
* DWORD
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static void CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server, PVOID Data)
|
static void CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server, PVOID Data)
|
||||||
{
|
{
|
||||||
IP_ADDR_STRING *pNext;
|
IP_ADDR_STRING *pNext;
|
||||||
|
@ -1563,6 +1547,21 @@ static void CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server,
|
||||||
Context->NumServers++;
|
Context->NumServers++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************
|
||||||
|
* GetPerAdapterInfo (IPHLPAPI.@)
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* PARAMS
|
||||||
|
*
|
||||||
|
* IfIndex [In]
|
||||||
|
* pPerAdapterInfo [In/Out]
|
||||||
|
* pOutBufLen [In/Out]
|
||||||
|
*
|
||||||
|
* RETURNS
|
||||||
|
*
|
||||||
|
* DWORD
|
||||||
|
*
|
||||||
|
*/
|
||||||
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
|
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
|
||||||
{
|
{
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
|
@ -2294,7 +2293,7 @@ PIP_ADAPTER_ORDER_MAP WINAPI GetAdapterOrderMap(VOID)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
#if 0
|
#ifdef GetAdaptersAddressesV1
|
||||||
DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVOID Reserved,PIP_ADAPTER_ADDRESSES pAdapterAddresses,PULONG pOutBufLen)
|
DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVOID Reserved,PIP_ADAPTER_ADDRESSES pAdapterAddresses,PULONG pOutBufLen)
|
||||||
{
|
{
|
||||||
InterfaceIndexTable *indexTable;
|
InterfaceIndexTable *indexTable;
|
||||||
|
@ -2308,7 +2307,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO
|
||||||
if (!pOutBufLen) return ERROR_INVALID_PARAMETER;
|
if (!pOutBufLen) return ERROR_INVALID_PARAMETER;
|
||||||
if (Reserved) return ERROR_INVALID_PARAMETER;
|
if (Reserved) return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
indexTable = getNonLoopbackInterfaceIndexTable(); //I think we want non-loopback here
|
indexTable = getInterfaceIndexTable();
|
||||||
if (!indexTable)
|
if (!indexTable)
|
||||||
return ERROR_NOT_ENOUGH_MEMORY;
|
return ERROR_NOT_ENOUGH_MEMORY;
|
||||||
|
|
||||||
|
@ -2345,8 +2344,8 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO
|
||||||
/* We're only going to implement what's required for XP SP0 */
|
/* We're only going to implement what's required for XP SP0 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
TRACE("size: %d, requiredSize: %d\n", *pOutBufLen, requiredSize);
|
||||||
if (*pOutBufLen < requiredSize)
|
if (!pAdapterAddresses || *pOutBufLen < requiredSize)
|
||||||
{
|
{
|
||||||
*pOutBufLen = requiredSize;
|
*pOutBufLen = requiredSize;
|
||||||
closeTcpFile(tcpFile);
|
closeTcpFile(tcpFile);
|
||||||
|
@ -2397,6 +2396,9 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO
|
||||||
currentLocation += sizeof(WCHAR);
|
currentLocation += sizeof(WCHAR);
|
||||||
|
|
||||||
currentAddress->Next = (PVOID)currentLocation;
|
currentAddress->Next = (PVOID)currentLocation;
|
||||||
|
/* Terminate the last address correctly */
|
||||||
|
if(i==0)
|
||||||
|
currentAddress->Next = NULL;
|
||||||
|
|
||||||
/* We're only going to implement what's required for XP SP0 */
|
/* We're only going to implement what's required for XP SP0 */
|
||||||
|
|
||||||
|
@ -2404,10 +2406,6 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Terminate the last address correctly */
|
|
||||||
if (currentAddress)
|
|
||||||
currentAddress->Next = NULL;
|
|
||||||
|
|
||||||
/* Now again, for real this time */
|
/* Now again, for real this time */
|
||||||
|
|
||||||
currentAddress = pAdapterAddresses;
|
currentAddress = pAdapterAddresses;
|
||||||
|
@ -2470,7 +2468,10 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO
|
||||||
currentAddress->IfType = ifInfo.if_info.ent.if_type;
|
currentAddress->IfType = ifInfo.if_info.ent.if_type;
|
||||||
|
|
||||||
/* Operational status */
|
/* Operational status */
|
||||||
currentAddress->OperStatus = ifInfo.if_info.ent.if_operstatus;
|
if(ifInfo.if_info.ent.if_operstatus >= IF_OPER_STATUS_CONNECTING)
|
||||||
|
currentAddress->OperStatus = IfOperStatusUp;
|
||||||
|
else
|
||||||
|
currentAddress->OperStatus = IfOperStatusDown;
|
||||||
|
|
||||||
/* We're only going to implement what's required for XP SP0 */
|
/* We're only going to implement what's required for XP SP0 */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue