Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
208eae73
Commit
208eae73
authored
11 years ago
by
Huw Davies
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
iphlpapi: Add a version of get_dns_servers for Android.
parent
c7dd313d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+2
-0
2 additions, 0 deletions
configure
configure.ac
+2
-0
2 additions, 0 deletions
configure.ac
dlls/iphlpapi/iphlpapi_main.c
+49
-0
49 additions, 0 deletions
dlls/iphlpapi/iphlpapi_main.c
include/config.h.in
+6
-0
6 additions, 0 deletions
include/config.h.in
with
59 additions
and
0 deletions
configure
+
2
−
0
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 \
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
2
−
0
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 \
...
...
This diff is collapsed.
Click to expand it.
dlls/iphlpapi/iphlpapi_main.c
+
49
−
0
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
"
);
...
...
This diff is collapsed.
Click to expand it.
include/config.h.in
+
6
−
0
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment