Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9c20f9bc
Commit
9c20f9bc
authored
Apr 16, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Apr 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Stub more IP_ADAPTER_UNICAST_ADDRESS fields in GetAdaptersAddresses.
parent
708ab4ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+34
-6
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+0
-3
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
9c20f9bc
...
...
@@ -784,6 +784,31 @@ static PMIB_IPFORWARDROW findIPv4Gateway(DWORD index,
return
row
;
}
static
void
fill_unicast_addr_data
(
IP_ADAPTER_ADDRESSES
*
aa
,
IP_ADAPTER_UNICAST_ADDRESS
*
ua
)
{
/* Actually this information should be read somewhere from the system
* but it doesn't matter much for the bugs found so far.
* This information is required for DirectPlay8 games. */
if
(
aa
->
IfType
!=
IF_TYPE_SOFTWARE_LOOPBACK
)
{
ua
->
PrefixOrigin
=
IpPrefixOriginDhcp
;
ua
->
SuffixOrigin
=
IpSuffixOriginDhcp
;
}
else
{
ua
->
PrefixOrigin
=
IpPrefixOriginManual
;
ua
->
SuffixOrigin
=
IpSuffixOriginManual
;
}
/* The address is not duplicated in the network */
ua
->
DadState
=
IpDadStatePreferred
;
/* Some address life time values, required even for non-dhcp addresses */
ua
->
ValidLifetime
=
60000
;
ua
->
PreferredLifetime
=
60000
;
ua
->
LeaseLifetime
=
60000
;
}
static
ULONG
adapterAddressesFromIndex
(
ULONG
family
,
ULONG
flags
,
IF_INDEX
index
,
IP_ADAPTER_ADDRESSES
*
aa
,
ULONG
*
size
)
{
...
...
@@ -884,6 +909,13 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
TRACE
(
"%s: %d IPv4 addresses, %d IPv6 addresses:
\n
"
,
name
,
num_v4addrs
,
num_v6addrs
);
buflen
=
MAX_INTERFACE_PHYSADDR
;
getInterfacePhysicalByIndex
(
index
,
&
buflen
,
aa
->
PhysicalAddress
,
&
type
);
aa
->
PhysicalAddressLength
=
buflen
;
aa
->
IfType
=
typeFromMibType
(
type
);
aa
->
ConnectionType
=
connectionTypeFromMibType
(
type
);
if
(
num_v4_gateways
)
{
PMIB_IPFORWARDROW
adapterRow
;
...
...
@@ -930,6 +962,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
sa
->
sin_port
=
0
;
TRACE
(
"IPv4 %d/%d: %s
\n
"
,
i
+
1
,
num_v4addrs
,
debugstr_ipv4
(
&
sa
->
sin_addr
.
S_un
.
S_addr
,
addr_buf
));
fill_unicast_addr_data
(
aa
,
ua
);
ptr
+=
ua
->
u
.
s
.
Length
+
ua
->
Address
.
iSockaddrLength
;
if
(
i
<
num_v4addrs
-
1
)
...
...
@@ -967,6 +1000,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
memcpy
(
sa
,
v6addrs
[
i
].
lpSockaddr
,
sizeof
(
*
sa
));
TRACE
(
"IPv6 %d/%d: %s
\n
"
,
i
+
1
,
num_v6addrs
,
debugstr_ipv6
(
sa
,
addr_buf
));
fill_unicast_addr_data
(
aa
,
ua
);
ptr
+=
ua
->
u
.
s
.
Length
+
ua
->
Address
.
iSockaddrLength
;
if
(
i
<
num_v6addrs
-
1
)
...
...
@@ -1071,12 +1105,6 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
}
}
buflen
=
MAX_INTERFACE_PHYSADDR
;
getInterfacePhysicalByIndex
(
index
,
&
buflen
,
aa
->
PhysicalAddress
,
&
type
);
aa
->
PhysicalAddressLength
=
buflen
;
aa
->
IfType
=
typeFromMibType
(
type
);
aa
->
ConnectionType
=
connectionTypeFromMibType
(
type
);
getInterfaceMtuByName
(
name
,
&
aa
->
Mtu
);
getInterfaceStatusByName
(
name
,
&
status
);
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
9c20f9bc
...
...
@@ -1360,10 +1360,8 @@ static void test_GetAdaptersAddresses(void)
ua
=
aa
->
FirstUnicastAddress
;
while
(
ua
)
{
todo_wine
ok
(
ua
->
PrefixOrigin
!=
IpPrefixOriginOther
,
"bad address config value %d
\n
"
,
ua
->
PrefixOrigin
);
todo_wine
ok
(
ua
->
SuffixOrigin
!=
IpSuffixOriginOther
,
"bad address config value %d
\n
"
,
ua
->
PrefixOrigin
);
/* Address configured manually or from DHCP server? */
...
...
@@ -1375,7 +1373,6 @@ todo_wine
ok
(
ua
->
LeaseLifetime
,
"expected non-zero
\n
"
);
}
/* Is the address ok in the network (not duplicated)? */
todo_wine
ok
(
ua
->
DadState
!=
IpDadStateInvalid
&&
ua
->
DadState
!=
IpDadStateDuplicate
,
"bad address duplication value %d
\n
"
,
ua
->
DadState
);
trace
(
"
\t
Length: %u
\n
"
,
S
(
U
(
*
ua
)).
Length
);
...
...
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