mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 12:29:56 +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)
|
||||
|
||||
add_definitions(-DGetAdaptersAddressesV2)
|
||||
list(APPEND SOURCE
|
||||
address.c
|
||||
dhcp_reactos.c
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "iphlpapi_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
|
||||
#if 1
|
||||
#ifdef GetAdaptersAddressesV2
|
||||
/* Helper for GetAdaptersAddresses:
|
||||
* Retrieves the list of network adapters from tcpip.sys */
|
||||
static
|
||||
|
@ -422,7 +422,11 @@ GetAdaptersAddresses(
|
|||
CurrentAA->Flags = 0; // FIXME!
|
||||
CurrentAA->Mtu = Entry->if_mtu;
|
||||
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 */
|
||||
Ptr = (BYTE*)(CurrentAA + 1);
|
||||
|
||||
|
|
|
@ -1517,22 +1517,6 @@ DWORD WINAPI GetOwnerModuleFromTcpEntry( PMIB_TCPROW_OWNER_MODULE pTcpEntry, TCP
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetPerAdapterInfo (IPHLPAPI.@)
|
||||
*
|
||||
*
|
||||
* PARAMS
|
||||
*
|
||||
* IfIndex [In]
|
||||
* pPerAdapterInfo [In/Out]
|
||||
* pOutBufLen [In/Out]
|
||||
*
|
||||
* RETURNS
|
||||
*
|
||||
* DWORD
|
||||
*
|
||||
*/
|
||||
static void CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server, PVOID Data)
|
||||
{
|
||||
IP_ADDR_STRING *pNext;
|
||||
|
@ -1563,6 +1547,21 @@ static void CreateNameServerListEnumNamesFunc( PWCHAR Interface, PWCHAR Server,
|
|||
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)
|
||||
{
|
||||
HKEY hkey;
|
||||
|
@ -2294,7 +2293,7 @@ PIP_ADAPTER_ORDER_MAP WINAPI GetAdapterOrderMap(VOID)
|
|||
/*
|
||||
* @implemented
|
||||
*/
|
||||
#if 0
|
||||
#ifdef GetAdaptersAddressesV1
|
||||
DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVOID Reserved,PIP_ADAPTER_ADDRESSES pAdapterAddresses,PULONG pOutBufLen)
|
||||
{
|
||||
InterfaceIndexTable *indexTable;
|
||||
|
@ -2308,7 +2307,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO
|
|||
if (!pOutBufLen) return ERROR_INVALID_PARAMETER;
|
||||
if (Reserved) return ERROR_INVALID_PARAMETER;
|
||||
|
||||
indexTable = getNonLoopbackInterfaceIndexTable(); //I think we want non-loopback here
|
||||
indexTable = getInterfaceIndexTable();
|
||||
if (!indexTable)
|
||||
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 */
|
||||
}
|
||||
}
|
||||
|
||||
if (*pOutBufLen < requiredSize)
|
||||
TRACE("size: %d, requiredSize: %d\n", *pOutBufLen, requiredSize);
|
||||
if (!pAdapterAddresses || *pOutBufLen < requiredSize)
|
||||
{
|
||||
*pOutBufLen = requiredSize;
|
||||
closeTcpFile(tcpFile);
|
||||
|
@ -2397,6 +2396,9 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO
|
|||
currentLocation += sizeof(WCHAR);
|
||||
|
||||
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 */
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
currentAddress = pAdapterAddresses;
|
||||
|
@ -2470,7 +2468,10 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVO
|
|||
currentAddress->IfType = ifInfo.if_info.ent.if_type;
|
||||
|
||||
/* 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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue