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
037e6010
Commit
037e6010
authored
Aug 01, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Return ADDRINFOEXW type from WS_getaddrinfoW.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
001a8a4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
socket.c
dlls/ws2_32/socket.c
+26
-9
No files found.
dlls/ws2_32/socket.c
View file @
037e6010
...
...
@@ -6733,11 +6733,11 @@ outofmem:
#endif
}
static
struct
WS_addrinfo
W
*
addrinfo_AtoW
(
const
struct
WS_addrinfo
*
ai
)
static
ADDRINFOEX
W
*
addrinfo_AtoW
(
const
struct
WS_addrinfo
*
ai
)
{
struct
WS_addrinfo
W
*
ret
;
ADDRINFOEX
W
*
ret
;
if
(
!
(
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
WS_addrinfo
W
))))
return
NULL
;
if
(
!
(
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ADDRINFOEX
W
))))
return
NULL
;
ret
->
ai_flags
=
ai
->
ai_flags
;
ret
->
ai_family
=
ai
->
ai_family
;
ret
->
ai_socktype
=
ai
->
ai_socktype
;
...
...
@@ -6745,6 +6745,9 @@ static struct WS_addrinfoW *addrinfo_AtoW(const struct WS_addrinfo *ai)
ret
->
ai_addrlen
=
ai
->
ai_addrlen
;
ret
->
ai_canonname
=
NULL
;
ret
->
ai_addr
=
NULL
;
ret
->
ai_blob
=
NULL
;
ret
->
ai_bloblen
=
0
;
ret
->
ai_provider
=
NULL
;
ret
->
ai_next
=
NULL
;
if
(
ai
->
ai_canonname
)
{
...
...
@@ -6769,16 +6772,16 @@ static struct WS_addrinfoW *addrinfo_AtoW(const struct WS_addrinfo *ai)
return
ret
;
}
static
struct
WS_addrinfo
W
*
addrinfo_list_AtoW
(
const
struct
WS_addrinfo
*
info
)
static
ADDRINFOEX
W
*
addrinfo_list_AtoW
(
const
struct
WS_addrinfo
*
info
)
{
struct
WS_addrinfo
W
*
ret
,
*
infoW
;
ADDRINFOEX
W
*
ret
,
*
infoW
;
if
(
!
(
ret
=
infoW
=
addrinfo_AtoW
(
info
)))
return
NULL
;
while
(
info
->
ai_next
)
{
if
(
!
(
infoW
->
ai_next
=
addrinfo_AtoW
(
info
->
ai_next
)))
{
FreeAddrInfoW
(
ret
);
FreeAddrInfo
Ex
W
(
ret
);
return
NULL
;
}
infoW
=
infoW
->
ai_next
;
...
...
@@ -6823,7 +6826,7 @@ static struct WS_addrinfo *addrinfo_WtoA(const struct WS_addrinfoW *ai)
return
ret
;
}
static
int
WS_getaddrinfoW
(
const
WCHAR
*
nodename
,
const
WCHAR
*
servname
,
const
struct
WS_addrinfo
*
hints
,
PADDRINFOW
*
res
)
static
int
WS_getaddrinfoW
(
const
WCHAR
*
nodename
,
const
WCHAR
*
servname
,
const
struct
WS_addrinfo
*
hints
,
ADDRINFOEXW
*
*
res
)
{
int
ret
=
EAI_MEMORY
,
len
,
i
;
char
*
nodenameA
=
NULL
,
*
servnameA
=
NULL
;
...
...
@@ -6927,15 +6930,29 @@ int WINAPI GetAddrInfoExCancel(HANDLE *handle)
int
WINAPI
GetAddrInfoW
(
LPCWSTR
nodename
,
LPCWSTR
servname
,
const
ADDRINFOW
*
hints
,
PADDRINFOW
*
res
)
{
struct
WS_addrinfo
*
hintsA
=
NULL
;
ADDRINFOEXW
*
resex
;
int
ret
=
EAI_MEMORY
;
TRACE
(
"nodename %s, servname %s, hints %p, result %p
\n
"
,
debugstr_w
(
nodename
),
debugstr_w
(
servname
),
hints
,
res
);
*
res
=
NULL
;
if
(
hints
)
hintsA
=
addrinfo_WtoA
(
hints
);
ret
=
WS_getaddrinfoW
(
nodename
,
servname
,
hintsA
,
res
);
ret
=
WS_getaddrinfoW
(
nodename
,
servname
,
hintsA
,
&
resex
);
WS_freeaddrinfo
(
hintsA
);
return
ret
;
if
(
ret
)
return
ret
;
if
(
resex
)
{
/* ADDRINFOEXW has layout compatible with ADDRINFOW except for ai_next field,
* so we may convert it in place */
*
res
=
(
ADDRINFOW
*
)
resex
;
do
{
((
ADDRINFOW
*
)
resex
)
->
ai_next
=
(
ADDRINFOW
*
)
resex
->
ai_next
;
resex
=
resex
->
ai_next
;
}
while
(
resex
);
}
return
0
;
}
/***********************************************************************
...
...
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