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
208eae73
Commit
208eae73
authored
Sep 17, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Sep 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Add a version of get_dns_servers for Android.
parent
c7dd313d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
0 deletions
+59
-0
configure
configure
+2
-0
configure.ac
configure.ac
+2
-0
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+49
-0
config.h.in
include/config.h.in
+6
-0
No files found.
configure
View file @
208eae73
...
...
@@ -13370,6 +13370,8 @@ esac
ac_save_CFLAGS
=
"
$CFLAGS
"
CFLAGS
=
"
$CFLAGS
$BUILTINFLAG
"
for
ac_func
in
\
__res_get_state
\
__res_getservers
\
_finite
\
_isnan
\
_pclose
\
...
...
configure.ac
View file @
208eae73
...
...
@@ -1997,6 +1997,8 @@ dnl **** Check for functions ****
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $BUILTINFLAG"
AC_CHECK_FUNCS(\
__res_get_state \
__res_getservers \
_finite \
_isnan \
_pclose \
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
208eae73
...
...
@@ -978,7 +978,56 @@ static int get_dns_servers( SOCKADDR_STORAGE *servers, int num, BOOL ip4_only )
}
return
addr
-
servers
;
}
#elif defined(HAVE___RES_GET_STATE) && defined(HAVE___RES_GETSERVERS)
static
int
get_dns_servers
(
SOCKADDR_STORAGE
*
servers
,
int
num
,
BOOL
ip4_only
)
{
extern
struct
res_state
*
__res_get_state
(
void
);
extern
int
__res_getservers
(
struct
res_state
*
,
struct
sockaddr_storage
*
,
int
);
struct
res_state
*
state
=
__res_get_state
();
int
i
,
found
=
0
,
total
=
__res_getservers
(
state
,
NULL
,
0
);
SOCKADDR_STORAGE
*
addr
=
servers
;
struct
sockaddr_storage
*
buf
;
if
((
!
servers
||
!
num
)
&&
!
ip4_only
)
return
total
;
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
struct
sockaddr_storage
)
);
total
=
__res_getservers
(
state
,
buf
,
total
);
for
(
i
=
0
;
i
<
total
;
i
++
)
{
if
(
buf
[
i
].
ss_family
==
AF_INET6
&&
ip4_only
)
continue
;
if
(
buf
[
i
].
ss_family
!=
AF_INET
&&
buf
[
i
].
ss_family
!=
AF_INET6
)
continue
;
found
++
;
if
(
!
servers
||
!
num
)
continue
;
if
(
buf
[
i
].
ss_family
==
AF_INET6
)
{
SOCKADDR_IN6
*
s
=
(
SOCKADDR_IN6
*
)
addr
;
struct
sockaddr_in6
*
ptr
=
(
struct
sockaddr_in6
*
)(
buf
+
i
);
s
->
sin6_family
=
WS_AF_INET6
;
s
->
sin6_port
=
ptr
->
sin6_port
;
s
->
sin6_flowinfo
=
ptr
->
sin6_flowinfo
;
memcpy
(
&
s
->
sin6_addr
,
&
ptr
->
sin6_addr
,
sizeof
(
IN6_ADDR
)
);
s
->
sin6_scope_id
=
ptr
->
sin6_scope_id
;
memset
(
(
char
*
)
s
+
sizeof
(
SOCKADDR_IN6
),
0
,
sizeof
(
SOCKADDR_STORAGE
)
-
sizeof
(
SOCKADDR_IN6
)
);
}
else
{
*
(
struct
sockaddr_in
*
)
addr
=
*
(
struct
sockaddr_in
*
)(
buf
+
i
);
memset
(
(
char
*
)
addr
+
sizeof
(
struct
sockaddr_in
),
0
,
sizeof
(
SOCKADDR_STORAGE
)
-
sizeof
(
struct
sockaddr_in
)
);
}
if
(
++
addr
>=
servers
+
num
)
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
return
found
;
}
#else
static
int
get_dns_servers
(
SOCKADDR_STORAGE
*
servers
,
int
num
,
BOOL
ip4_only
)
{
FIXME
(
"Unimplemented on this system
\n
"
);
...
...
include/config.h.in
View file @
208eae73
...
...
@@ -1233,6 +1233,12 @@
/* Define to 1 if you have the `_vsnprintf' function. */
#undef HAVE__VSNPRINTF
/* Define to 1 if you have the `__res_getservers' function. */
#undef HAVE___RES_GETSERVERS
/* Define to 1 if you have the `__res_get_state' function. */
#undef HAVE___RES_GET_STATE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
...
...
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