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
112f8789
Commit
112f8789
authored
Mar 23, 2010
by
Juan Lang
Committed by
Alexandre Julliard
Oct 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Set DNS servers in the IP_PER_ADAPTER_INFO returned for non-loopback addresses.
parent
189cd590
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
5 deletions
+31
-5
ifenum.c
dlls/iphlpapi/ifenum.c
+15
-0
ifenum.h
dlls/iphlpapi/ifenum.h
+1
-0
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+15
-5
No files found.
dlls/iphlpapi/ifenum.c
View file @
112f8789
...
...
@@ -158,6 +158,21 @@ DWORD getInterfaceIndexByName(const char *name, PDWORD index)
return
ret
;
}
BOOL
isIfIndexLoopback
(
ULONG
idx
)
{
BOOL
ret
=
FALSE
;
char
name
[
IFNAMSIZ
];
int
fd
;
getInterfaceNameByIndex
(
idx
,
name
);
fd
=
socket
(
PF_INET
,
SOCK_DGRAM
,
0
);
if
(
fd
!=
-
1
)
{
ret
=
isLoopbackInterface
(
fd
,
name
);
close
(
fd
);
}
return
ret
;
}
DWORD
getNumNonLoopbackInterfaces
(
void
)
{
DWORD
numInterfaces
;
...
...
dlls/iphlpapi/ifenum.h
View file @
112f8789
...
...
@@ -46,6 +46,7 @@
DWORD
getNumInterfaces
(
void
);
DWORD
getNumNonLoopbackInterfaces
(
void
);
BOOL
isIfIndexLoopback
(
ULONG
idx
);
/* A table of interface indexes, see get*InterfaceTable(). */
typedef
struct
_InterfaceIndexTable
{
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
112f8789
...
...
@@ -1688,18 +1688,21 @@ DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
* RETURNS
* Success: NO_ERROR
* Failure: error code from winerror.h
*
* FIXME
* Stub, returns empty IP_PER_ADAPTER_INFO in every case.
*/
DWORD
WINAPI
GetPerAdapterInfo
(
ULONG
IfIndex
,
PIP_PER_ADAPTER_INFO
pPerAdapterInfo
,
PULONG
pOutBufLen
)
{
ULONG
bytesNeeded
=
sizeof
(
IP_PER_ADAPTER_INFO
);
ULONG
bytesNeeded
=
sizeof
(
IP_PER_ADAPTER_INFO
),
serverListSize
=
0
;
DWORD
ret
=
NO_ERROR
;
TRACE
(
"(IfIndex %d, pPerAdapterInfo %p, pOutBufLen %p)
\n
"
,
IfIndex
,
pPerAdapterInfo
,
pOutBufLen
);
if
(
!
pOutBufLen
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
isIfIndexLoopback
(
IfIndex
))
{
get_dns_server_list
(
NULL
,
NULL
,
&
serverListSize
);
if
(
serverListSize
>
sizeof
(
IP_ADDR_STRING
))
bytesNeeded
+=
serverListSize
-
sizeof
(
IP_ADDR_STRING
);
}
if
(
!
pPerAdapterInfo
||
*
pOutBufLen
<
bytesNeeded
)
{
*
pOutBufLen
=
bytesNeeded
;
...
...
@@ -1707,7 +1710,14 @@ DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterIn
}
memset
(
pPerAdapterInfo
,
0
,
bytesNeeded
);
return
NO_ERROR
;
if
(
!
isIfIndexLoopback
(
IfIndex
))
{
ret
=
get_dns_server_list
(
&
pPerAdapterInfo
->
DnsServerList
,
(
PIP_ADDR_STRING
)((
PBYTE
)
pPerAdapterInfo
+
sizeof
(
IP_PER_ADAPTER_INFO
)),
&
serverListSize
);
/* Assume the first DNS server in the list is the "current" DNS server: */
pPerAdapterInfo
->
CurrentDnsServer
=
&
pPerAdapterInfo
->
DnsServerList
;
}
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