Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
60354102
Commit
60354102
authored
Oct 11, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Oct 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Only return gateway addresses if GAA_FLAG_INCLUDE_ALL_GATEWAYS is specified.
parent
8d3318a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+17
-13
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
60354102
...
@@ -716,7 +716,8 @@ static PMIB_IPFORWARDROW findIPv4Gateway(DWORD index,
...
@@ -716,7 +716,8 @@ static PMIB_IPFORWARDROW findIPv4Gateway(DWORD index,
return
row
;
return
row
;
}
}
static
ULONG
adapterAddressesFromIndex
(
ULONG
family
,
DWORD
index
,
IP_ADAPTER_ADDRESSES
*
aa
,
ULONG
*
size
)
static
ULONG
adapterAddressesFromIndex
(
ULONG
family
,
ULONG
flags
,
DWORD
index
,
IP_ADAPTER_ADDRESSES
*
aa
,
ULONG
*
size
)
{
{
ULONG
ret
,
i
,
num_v4addrs
=
0
,
num_v4_gateways
=
0
,
num_v6addrs
=
0
,
total_size
;
ULONG
ret
,
i
,
num_v4addrs
=
0
,
num_v4_gateways
=
0
,
num_v6addrs
=
0
,
total_size
;
DWORD
*
v4addrs
=
NULL
;
DWORD
*
v4addrs
=
NULL
;
...
@@ -725,26 +726,29 @@ static ULONG adapterAddressesFromIndex(ULONG family, DWORD index, IP_ADAPTER_ADD
...
@@ -725,26 +726,29 @@ static ULONG adapterAddressesFromIndex(ULONG family, DWORD index, IP_ADAPTER_ADD
if
(
family
==
WS_AF_INET
)
if
(
family
==
WS_AF_INET
)
{
{
ret
=
AllocateAndGetIpForwardTableFromStack
(
&
routeTable
,
FALSE
,
ret
=
v4addressesFromIndex
(
index
,
&
v4addrs
,
&
num_v4addrs
);
GetProcessHeap
(),
0
);
if
(
!
ret
&&
flags
&
GAA_FLAG_INCLUDE_ALL_GATEWAYS
)
if
(
!
ret
)
{
{
ret
=
v4addressesFromIndex
(
index
,
&
v4addrs
,
&
num_v4addrs
);
ret
=
AllocateAndGetIpForwardTableFromStack
(
&
routeTable
,
FALSE
,
num_v4_gateways
=
count_v4_gateways
(
index
,
routeTable
);
GetProcessHeap
(),
0
);
if
(
!
ret
)
num_v4_gateways
=
count_v4_gateways
(
index
,
routeTable
);
}
}
}
}
else
if
(
family
==
WS_AF_INET6
)
else
if
(
family
==
WS_AF_INET6
)
ret
=
v6addressesFromIndex
(
index
,
&
v6addrs
,
&
num_v6addrs
);
ret
=
v6addressesFromIndex
(
index
,
&
v6addrs
,
&
num_v6addrs
);
else
if
(
family
==
WS_AF_UNSPEC
)
else
if
(
family
==
WS_AF_UNSPEC
)
{
{
ret
=
AllocateAndGetIpForwardTableFromStack
(
&
routeTable
,
FALSE
,
ret
=
v4addressesFromIndex
(
index
,
&
v4addrs
,
&
num_v4addrs
);
GetProcessHeap
(),
0
);
if
(
!
ret
&&
flags
&
GAA_FLAG_INCLUDE_ALL_GATEWAYS
)
if
(
!
ret
)
{
{
ret
=
v4addressesFromIndex
(
index
,
&
v4addrs
,
&
num_v4addrs
);
ret
=
AllocateAndGetIpForwardTableFromStack
(
&
routeTable
,
FALSE
,
num_v4_gateways
=
count_v4_gateways
(
index
,
routeTable
);
GetProcessHeap
(),
0
);
if
(
!
ret
)
if
(
!
ret
)
{
num_v4_gateways
=
count_v4_gateways
(
index
,
routeTable
);
ret
=
v6addressesFromIndex
(
index
,
&
v6addrs
,
&
num_v6addrs
);
ret
=
v6addressesFromIndex
(
index
,
&
v6addrs
,
&
num_v6addrs
);
}
}
}
}
}
else
else
...
@@ -929,7 +933,7 @@ ULONG WINAPI GetAdaptersAddresses(ULONG family, ULONG flags, PVOID reserved,
...
@@ -929,7 +933,7 @@ ULONG WINAPI GetAdaptersAddresses(ULONG family, ULONG flags, PVOID reserved,
for
(
i
=
0
;
i
<
table
->
numIndexes
;
i
++
)
for
(
i
=
0
;
i
<
table
->
numIndexes
;
i
++
)
{
{
size
=
0
;
size
=
0
;
if
((
ret
=
adapterAddressesFromIndex
(
family
,
table
->
indexes
[
i
],
NULL
,
&
size
)))
if
((
ret
=
adapterAddressesFromIndex
(
family
,
flags
,
table
->
indexes
[
i
],
NULL
,
&
size
)))
{
{
HeapFree
(
GetProcessHeap
(),
0
,
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
return
ret
;
return
ret
;
...
@@ -941,7 +945,7 @@ ULONG WINAPI GetAdaptersAddresses(ULONG family, ULONG flags, PVOID reserved,
...
@@ -941,7 +945,7 @@ ULONG WINAPI GetAdaptersAddresses(ULONG family, ULONG flags, PVOID reserved,
ULONG
bytes_left
=
size
=
total_size
;
ULONG
bytes_left
=
size
=
total_size
;
for
(
i
=
0
;
i
<
table
->
numIndexes
;
i
++
)
for
(
i
=
0
;
i
<
table
->
numIndexes
;
i
++
)
{
{
if
((
ret
=
adapterAddressesFromIndex
(
family
,
table
->
indexes
[
i
],
aa
,
&
size
)))
if
((
ret
=
adapterAddressesFromIndex
(
family
,
flags
,
table
->
indexes
[
i
],
aa
,
&
size
)))
{
{
HeapFree
(
GetProcessHeap
(),
0
,
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
return
ret
;
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment