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
4d4819d8
Commit
4d4819d8
authored
Apr 25, 2009
by
Jeff Latimer
Committed by
Alexandre Julliard
Apr 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Make inet_ntop conform to msdn definition.
parent
0cdd0d80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
socket.c
dlls/ws2_32/socket.c
+7
-5
sock.c
dlls/ws2_32/tests/sock.c
+3
-3
No files found.
dlls/ws2_32/socket.c
View file @
4d4819d8
...
...
@@ -4698,16 +4698,18 @@ int WINAPI WSARemoveServiceClass(LPGUID info)
PCSTR
WINAPI
WS_inet_ntop
(
INT
family
,
PVOID
addr
,
PSTR
buffer
,
size_t
len
)
{
#ifdef HAVE_INET_NTOP
union
generic_unix_sockaddr
unix_addr
;
struct
WS_in6_addr
*
in6
;
struct
WS_in_addr
*
in
;
TRACE
(
"family %d, addr (%p), buffer (%p), len %d
\n
"
,
family
,
addr
,
buffer
,
len
);
switch
(
family
)
{
case
WS_AF_INET
:
ws_sockaddr_ws2u
(
addr
,
sizeof
(
struct
WS_sockaddr_in
),
&
unix_addr
)
;
return
inet_ntop
(
AF_INET
,
&
unix
_addr
,
buffer
,
len
);
in
=
addr
;
return
inet_ntop
(
AF_INET
,
&
in
->
WS_s
_addr
,
buffer
,
len
);
case
WS_AF_INET6
:
ws_sockaddr_ws2u
(
addr
,
sizeof
(
struct
WS_sockaddr_in6
),
&
unix_addr
)
;
return
inet_ntop
(
AF_INET6
,
&
unix
_addr
,
buffer
,
len
);
in6
=
addr
;
return
inet_ntop
(
AF_INET6
,
in6
->
WS_s6
_addr
,
buffer
,
len
);
}
#else
FIXME
(
"not supported on this platform
\n
"
);
...
...
dlls/ws2_32/tests/sock.c
View file @
4d4819d8
...
...
@@ -2040,7 +2040,7 @@ static void test_addr_to_print(void)
pdst
=
pInetNtop
(
AF_INET
,(
void
*
)
&
in
.
s_addr
,
dst
,
sizeof
(
dst
));
ok
(
pdst
!=
NULL
,
"InetNtop failed %s
\n
"
,
dst
);
todo_wine
ok
(
!
strcmp
(
pdst
,
addr1_Str
),
"Address %s != %s
\n
"
,
pdst
,
addr1_Str
);
ok
(
!
strcmp
(
pdst
,
addr1_Str
),
"Address %s != %s
\n
"
,
pdst
,
addr1_Str
);
/* Test invalid parm conditions */
pdst
=
pInetNtop
(
1
,
(
void
*
)
&
in
.
s_addr
,
dst
,
sizeof
(
dst
));
...
...
@@ -2051,13 +2051,13 @@ static void test_addr_to_print(void)
memcpy
(
in6
.
u
.
Byte
,
addr2_Num
,
sizeof
(
addr2_Num
));
pdst
=
pInetNtop
(
AF_INET6
,(
void
*
)
&
in6
.
s6_addr
,
dst6
,
sizeof
(
dst6
));
ok
(
pdst
!=
NULL
,
"InetNtop failed %s
\n
"
,
dst6
);
todo_wine
ok
(
!
strcmp
(
pdst
,
addr2_Str
),
"Address %s != %s
\n
"
,
pdst
,
addr2_Str
);
ok
(
!
strcmp
(
pdst
,
addr2_Str
),
"Address %s != %s
\n
"
,
pdst
,
addr2_Str
);
/* Test an zero suffixed IPV6 address */
memcpy
(
in6
.
s6_addr
,
addr3_Num
,
sizeof
(
addr3_Num
));
pdst
=
pInetNtop
(
AF_INET6
,(
void
*
)
&
in6
.
s6_addr
,
dst6
,
sizeof
(
dst6
));
ok
(
pdst
!=
NULL
,
"InetNtop failed %s
\n
"
,
dst6
);
todo_wine
ok
(
!
strcmp
(
pdst
,
addr3_Str
),
"Address %s != %s
\n
"
,
pdst
,
addr3_Str
);
ok
(
!
strcmp
(
pdst
,
addr3_Str
),
"Address %s != %s
\n
"
,
pdst
,
addr3_Str
);
}
static
void
test_ioctlsocket
(
void
)
...
...
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