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
2d3b1c12
Commit
2d3b1c12
authored
Feb 16, 2021
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Use RtlIpv4AddressToStringA instead of inet_ntoa.
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
be8729c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
32 deletions
+7
-32
ifenum.c
dlls/iphlpapi/ifenum.c
+0
-20
ifenum.h
dlls/iphlpapi/ifenum.h
+0
-5
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+7
-7
No files found.
dlls/iphlpapi/ifenum.c
View file @
2d3b1c12
...
@@ -35,14 +35,6 @@
...
@@ -35,14 +35,6 @@
#include <sys/socket.h>
#include <sys/socket.h>
#endif
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_NET_IF_H
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#include <net/if.h>
#endif
#endif
...
@@ -1106,15 +1098,3 @@ ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_ad
...
@@ -1106,15 +1098,3 @@ ULONG v6addressesFromIndex(IF_INDEX index, SOCKET_ADDRESS **addrs, ULONG *num_ad
}
}
#endif
#endif
char
*
toIPAddressString
(
unsigned
int
addr
,
char
string
[
16
])
{
if
(
string
)
{
struct
in_addr
iAddr
;
iAddr
.
s_addr
=
addr
;
/* extra-anal, just to make auditors happy */
lstrcpynA
(
string
,
inet_ntoa
(
iAddr
),
16
);
}
return
string
;
}
dlls/iphlpapi/ifenum.h
View file @
2d3b1c12
...
@@ -109,11 +109,6 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
...
@@ -109,11 +109,6 @@ DWORD getIPAddrTable(PMIB_IPADDRTABLE *ppIpAddrTable, HANDLE heap, DWORD flags)
ULONG
v6addressesFromIndex
(
IF_INDEX
index
,
SOCKET_ADDRESS
**
addrs
,
ULONG
*
num_addrs
,
ULONG
v6addressesFromIndex
(
IF_INDEX
index
,
SOCKET_ADDRESS
**
addrs
,
ULONG
*
num_addrs
,
SOCKET_ADDRESS
**
masks
)
DECLSPEC_HIDDEN
;
SOCKET_ADDRESS
**
masks
)
DECLSPEC_HIDDEN
;
/* Converts the network-order bytes in addr to a printable string. Returns
* string.
*/
char
*
toIPAddressString
(
unsigned
int
addr
,
char
string
[
16
])
DECLSPEC_HIDDEN
;
DWORD
getInterfaceMtuByName
(
const
char
*
name
,
PDWORD
mtu
)
DECLSPEC_HIDDEN
;
DWORD
getInterfaceMtuByName
(
const
char
*
name
,
PDWORD
mtu
)
DECLSPEC_HIDDEN
;
DWORD
getInterfaceStatusByName
(
const
char
*
name
,
INTERNAL_IF_OPER_STATUS
*
status
)
DECLSPEC_HIDDEN
;
DWORD
getInterfaceStatusByName
(
const
char
*
name
,
INTERNAL_IF_OPER_STATUS
*
status
)
DECLSPEC_HIDDEN
;
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
2d3b1c12
...
@@ -717,18 +717,18 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
...
@@ -717,18 +717,18 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
for
(
i
=
0
;
i
<
ipAddrTable
->
dwNumEntries
;
i
++
)
{
for
(
i
=
0
;
i
<
ipAddrTable
->
dwNumEntries
;
i
++
)
{
if
(
ipAddrTable
->
table
[
i
].
dwIndex
==
ptr
->
Index
)
{
if
(
ipAddrTable
->
table
[
i
].
dwIndex
==
ptr
->
Index
)
{
if
(
firstIPAddr
)
{
if
(
firstIPAddr
)
{
toIPAddressString
(
ipAddrTable
->
table
[
i
].
dwAddr
,
RtlIpv4AddressToStringA
((
IN_ADDR
*
)
&
ipAddrTable
->
table
[
i
].
dwAddr
,
ptr
->
IpAddressList
.
IpAddress
.
String
);
ptr
->
IpAddressList
.
IpAddress
.
String
);
toIPAddressString
(
ipAddrTable
->
table
[
i
].
dwMask
,
RtlIpv4AddressToStringA
((
IN_ADDR
*
)
&
ipAddrTable
->
table
[
i
].
dwMask
,
ptr
->
IpAddressList
.
IpMask
.
String
);
ptr
->
IpAddressList
.
IpMask
.
String
);
firstIPAddr
=
FALSE
;
firstIPAddr
=
FALSE
;
}
}
else
{
else
{
currentIPAddr
->
Next
=
nextIPAddr
;
currentIPAddr
->
Next
=
nextIPAddr
;
currentIPAddr
=
nextIPAddr
;
currentIPAddr
=
nextIPAddr
;
toIPAddressString
(
ipAddrTable
->
table
[
i
].
dwAddr
,
RtlIpv4AddressToStringA
((
IN_ADDR
*
)
&
ipAddrTable
->
table
[
i
].
dwAddr
,
currentIPAddr
->
IpAddress
.
String
);
currentIPAddr
->
IpAddress
.
String
);
toIPAddressString
(
ipAddrTable
->
table
[
i
].
dwMask
,
RtlIpv4AddressToStringA
((
IN_ADDR
*
)
&
ipAddrTable
->
table
[
i
].
dwMask
,
currentIPAddr
->
IpMask
.
String
);
currentIPAddr
->
IpMask
.
String
);
nextIPAddr
++
;
nextIPAddr
++
;
}
}
...
@@ -749,9 +749,9 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
...
@@ -749,9 +749,9 @@ DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
&&
routeTable
->
table
[
i
].
u1
.
ForwardType
==
&&
routeTable
->
table
[
i
].
u1
.
ForwardType
==
MIB_IPROUTE_TYPE_INDIRECT
)
MIB_IPROUTE_TYPE_INDIRECT
)
{
{
toIPAddressString
(
routeTable
->
table
[
i
].
dwForwardNextHop
,
RtlIpv4AddressToStringA
((
IN_ADDR
*
)
&
routeTable
->
table
[
i
].
dwForwardNextHop
,
ptr
->
GatewayList
.
IpAddress
.
String
);
ptr
->
GatewayList
.
IpAddress
.
String
);
toIPAddressString
(
routeTable
->
table
[
i
].
dwForwardMask
,
RtlIpv4AddressToStringA
((
IN_ADDR
*
)
&
routeTable
->
table
[
i
].
dwForwardMask
,
ptr
->
GatewayList
.
IpMask
.
String
);
ptr
->
GatewayList
.
IpMask
.
String
);
}
}
if
(
winsEnabled
)
{
if
(
winsEnabled
)
{
...
@@ -2224,7 +2224,7 @@ static DWORD get_dns_server_list(PIP_ADDR_STRING list,
...
@@ -2224,7 +2224,7 @@ static DWORD get_dns_server_list(PIP_ADDR_STRING list,
get_dns_servers
(
addr
,
num
,
TRUE
);
get_dns_servers
(
addr
,
num
,
TRUE
);
for
(
i
=
0
,
ptr
=
list
;
i
<
num
;
i
++
,
ptr
=
ptr
->
Next
)
{
for
(
i
=
0
,
ptr
=
list
;
i
<
num
;
i
++
,
ptr
=
ptr
->
Next
)
{
toIPAddressString
(
((
struct
sockaddr_in
*
)(
addr
+
i
))
->
sin_addr
.
s_addr
,
RtlIpv4AddressToStringA
((
IN_ADDR
*
)
&
((
struct
sockaddr_in
*
)(
addr
+
i
))
->
sin_addr
.
s_addr
,
ptr
->
IpAddress
.
String
);
ptr
->
IpAddress
.
String
);
if
(
i
==
num
-
1
)
if
(
i
==
num
-
1
)
ptr
->
Next
=
NULL
;
ptr
->
Next
=
NULL
;
...
...
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