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
317fd11e
Commit
317fd11e
authored
Jan 15, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Jan 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Set 0.0.0.0 as the IP and mask of disconnected interfaces.
parent
aa808571
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+6
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+9
-1
No files found.
dlls/iphlpapi/iphlpapi_main.c
View file @
317fd11e
...
...
@@ -604,6 +604,12 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
}
}
}
/* If no IP was found it probably means that the interface is not
* configured. In this case we have to return a zeroed IP and mask. */
if
(
firstIPAddr
)
{
strcpy
(
ptr
->
IpAddressList
.
IpAddress
.
String
,
"0.0.0.0"
);
strcpy
(
ptr
->
IpAddressList
.
IpMask
.
String
,
"0.0.0.0"
);
}
/* Find first router through this interface, which we'll assume
* is the default gateway for this adapter */
for
(
i
=
0
;
i
<
routeTable
->
dwNumEntries
;
i
++
)
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
317fd11e
...
...
@@ -1118,12 +1118,20 @@ static void testGetAdaptersInfo(void)
if
(
apiReturn
==
ERROR_NO_DATA
)
;
/* no adapter's, that's okay */
else
if
(
apiReturn
==
ERROR_BUFFER_OVERFLOW
)
{
PIP_ADAPTER_INFO
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
PIP_ADAPTER_INFO
ptr
,
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
apiReturn
=
pGetAdaptersInfo
(
buf
,
&
len
);
ok
(
apiReturn
==
NO_ERROR
,
"GetAdaptersInfo(buf, &dwSize) returned %d, expected NO_ERROR
\n
"
,
apiReturn
);
ptr
=
buf
;
while
(
ptr
)
{
ok
(
ptr
->
IpAddressList
.
IpAddress
.
String
[
0
],
"A valid IP must be present
\n
"
);
ok
(
ptr
->
IpAddressList
.
IpMask
.
String
[
0
],
"A valid mask must be present
\n
"
);
trace
(
"Adapter '%s', IP %s, Mask %s
\n
"
,
ptr
->
AdapterName
,
ptr
->
IpAddressList
.
IpAddress
.
String
,
ptr
->
IpAddressList
.
IpMask
.
String
);
ptr
=
ptr
->
Next
;
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
...
...
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