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
4f1dca9d
Commit
4f1dca9d
authored
Jun 26, 2017
by
Owen Rudge
Committed by
Alexandre Julliard
Jun 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsdapi: Implement IWSDUdpAddress_SetTransportAddress.
Signed-off-by:
Owen Rudge
<
orudge@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4373eb30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
10 deletions
+36
-10
Makefile.in
dlls/wsdapi/Makefile.in
+1
-1
address.c
dlls/wsdapi/address.c
+28
-2
address.c
dlls/wsdapi/tests/address.c
+5
-5
msgparams.c
dlls/wsdapi/tests/msgparams.c
+2
-2
No files found.
dlls/wsdapi/Makefile.in
View file @
4f1dca9d
MODULE
=
wsdapi.dll
MODULE
=
wsdapi.dll
IMPORTLIB
=
wsdapi
IMPORTLIB
=
wsdapi
IMPORTS
=
user32
IMPORTS
=
user32
ws2_32
C_SRCS
=
\
C_SRCS
=
\
address.c
\
address.c
\
...
...
dlls/wsdapi/address.c
View file @
4f1dca9d
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
#define COBJMACROS
#define COBJMACROS
#include "winsock2.h"
#include "ws2tcpip.h"
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "wine/debug.h"
#include "wine/debug.h"
...
@@ -32,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wsdapi);
...
@@ -32,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wsdapi);
typedef
struct
IWSDUdpAddressImpl
{
typedef
struct
IWSDUdpAddressImpl
{
IWSDUdpAddress
IWSDUdpAddress_iface
;
IWSDUdpAddress
IWSDUdpAddress_iface
;
LONG
ref
;
LONG
ref
;
SOCKADDR_STORAGE
sockAddr
;
}
IWSDUdpAddressImpl
;
}
IWSDUdpAddressImpl
;
static
inline
IWSDUdpAddressImpl
*
impl_from_IWSDUdpAddress
(
IWSDUdpAddress
*
iface
)
static
inline
IWSDUdpAddressImpl
*
impl_from_IWSDUdpAddress
(
IWSDUdpAddress
*
iface
)
...
@@ -132,8 +135,31 @@ static HRESULT WINAPI IWSDUdpAddressImpl_GetTransportAddressEx(IWSDUdpAddress *T
...
@@ -132,8 +135,31 @@ static HRESULT WINAPI IWSDUdpAddressImpl_GetTransportAddressEx(IWSDUdpAddress *T
static
HRESULT
WINAPI
IWSDUdpAddressImpl_SetTransportAddress
(
IWSDUdpAddress
*
This
,
LPCWSTR
pszAddress
)
static
HRESULT
WINAPI
IWSDUdpAddressImpl_SetTransportAddress
(
IWSDUdpAddress
*
This
,
LPCWSTR
pszAddress
)
{
{
FIXME
(
"(%p, %s)
\n
"
,
This
,
debugstr_w
(
pszAddress
));
IWSDUdpAddressImpl
*
impl
=
impl_from_IWSDUdpAddress
(
This
);
return
E_NOTIMPL
;
ADDRINFOW
*
addrInfo
=
NULL
;
ADDRINFOW
hints
;
int
ret
;
TRACE
(
"(%p, %s)
\n
"
,
impl
,
debugstr_w
(
pszAddress
));
if
(
pszAddress
==
NULL
)
return
E_INVALIDARG
;
ZeroMemory
(
&
hints
,
sizeof
(
hints
));
hints
.
ai_family
=
AF_UNSPEC
;
ret
=
GetAddrInfoW
(
pszAddress
,
NULL
,
&
hints
,
&
addrInfo
);
if
(
ret
==
0
)
{
ZeroMemory
(
&
impl
->
sockAddr
,
sizeof
(
SOCKADDR_STORAGE
));
memcpy
(
&
impl
->
sockAddr
,
addrInfo
->
ai_addr
,
addrInfo
->
ai_addrlen
);
}
if
(
addrInfo
!=
NULL
)
FreeAddrInfoW
(
addrInfo
);
return
HRESULT_FROM_WIN32
(
ret
);
}
}
static
HRESULT
WINAPI
IWSDUdpAddressImpl_SetSockaddr
(
IWSDUdpAddress
*
This
,
const
SOCKADDR_STORAGE
*
pSockAddr
)
static
HRESULT
WINAPI
IWSDUdpAddressImpl_SetSockaddr
(
IWSDUdpAddress
*
This
,
const
SOCKADDR_STORAGE
*
pSockAddr
)
...
...
dlls/wsdapi/tests/address.c
View file @
4f1dca9d
...
@@ -98,15 +98,15 @@ static void GetSetTransportAddress_udp_tests(void)
...
@@ -98,15 +98,15 @@ static void GetSetTransportAddress_udp_tests(void)
/* Try setting a null address */
/* Try setting a null address */
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
NULL
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
NULL
);
todo_wine
ok
(
rc
==
E_INVALIDARG
,
"SetTransportAddress(NULL) returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
E_INVALIDARG
,
"SetTransportAddress(NULL) returned unexpected result: %08x
\n
"
,
rc
);
/* Try setting an invalid address */
/* Try setting an invalid address */
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
invalidAddress
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
invalidAddress
);
todo_wine
ok
(
rc
==
HRESULT_FROM_WIN32
(
WSAHOST_NOT_FOUND
),
"SetTransportAddress(invalidAddress) returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
HRESULT_FROM_WIN32
(
WSAHOST_NOT_FOUND
),
"SetTransportAddress(invalidAddress) returned unexpected result: %08x
\n
"
,
rc
);
/* Try setting an IPv4 address */
/* Try setting an IPv4 address */
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
ipv4Address
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
ipv4Address
);
todo_wine
ok
(
rc
==
S_OK
,
"SetTransportAddress(ipv4Address) failed: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetTransportAddress(ipv4Address) failed: %08x
\n
"
,
rc
);
rc
=
IWSDUdpAddress_GetTransportAddress
(
udpAddress
,
NULL
);
rc
=
IWSDUdpAddress_GetTransportAddress
(
udpAddress
,
NULL
);
todo_wine
ok
(
rc
==
E_POINTER
,
"GetTransportAddress(NULL) returned unexpected result: %08x
\n
"
,
rc
);
todo_wine
ok
(
rc
==
E_POINTER
,
"GetTransportAddress(NULL) returned unexpected result: %08x
\n
"
,
rc
);
...
@@ -118,7 +118,7 @@ static void GetSetTransportAddress_udp_tests(void)
...
@@ -118,7 +118,7 @@ static void GetSetTransportAddress_udp_tests(void)
/* Try setting an IPv6 address */
/* Try setting an IPv6 address */
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
ipv6Address
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
ipv6Address
);
todo_wine
ok
(
rc
==
S_OK
,
"SetTransportAddress(ipv6Address) failed: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetTransportAddress(ipv6Address) failed: %08x
\n
"
,
rc
);
rc
=
IWSDUdpAddress_GetTransportAddress
(
udpAddress
,
&
returnedAddress
);
rc
=
IWSDUdpAddress_GetTransportAddress
(
udpAddress
,
&
returnedAddress
);
todo_wine
ok
(
rc
==
S_OK
,
"GetTransportAddress returned unexpected result: %08x
\n
"
,
rc
);
todo_wine
ok
(
rc
==
S_OK
,
"GetTransportAddress returned unexpected result: %08x
\n
"
,
rc
);
...
@@ -264,7 +264,7 @@ static void GetSetSockaddr_udp_tests(void)
...
@@ -264,7 +264,7 @@ static void GetSetSockaddr_udp_tests(void)
/* Try setting a transport address */
/* Try setting a transport address */
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
expectedIpv6TransportAddr
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
udpAddress
,
expectedIpv6TransportAddr
);
todo_wine
ok
(
rc
==
S_OK
,
"SetTransportAddress failed: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetTransportAddress failed: %08x
\n
"
,
rc
);
/* A socket address should be returned */
/* A socket address should be returned */
rc
=
IWSDUdpAddress_GetSockaddr
(
udpAddress
,
&
returnedStorage
);
rc
=
IWSDUdpAddress_GetSockaddr
(
udpAddress
,
&
returnedStorage
);
...
...
dlls/wsdapi/tests/msgparams.c
View file @
4f1dca9d
...
@@ -96,7 +96,7 @@ static void LocalAddress_tests(void)
...
@@ -96,7 +96,7 @@ static void LocalAddress_tests(void)
ok
(
origUdpAddress
!=
NULL
,
"WSDCreateUdpMessageParameters(NULL, &origUdpAddress) failed: origUdpAddress == NULL
\n
"
);
ok
(
origUdpAddress
!=
NULL
,
"WSDCreateUdpMessageParameters(NULL, &origUdpAddress) failed: origUdpAddress == NULL
\n
"
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
origUdpAddress
,
address
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
origUdpAddress
,
address
);
todo_wine
ok
(
rc
==
S_OK
,
"SetTransportAddress failed: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetTransportAddress failed: %08x
\n
"
,
rc
);
rc
=
IWSDUdpMessageParameters_SetLocalAddress
(
udpMessageParams
,
(
IWSDAddress
*
)
origUdpAddress
);
rc
=
IWSDUdpMessageParameters_SetLocalAddress
(
udpMessageParams
,
(
IWSDAddress
*
)
origUdpAddress
);
ok
(
rc
==
S_OK
,
"SetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetLocalAddress failed: %08x
\n
"
,
rc
);
...
@@ -154,7 +154,7 @@ static void RemoteAddress_tests(void)
...
@@ -154,7 +154,7 @@ static void RemoteAddress_tests(void)
ok
(
origUdpAddress
!=
NULL
,
"WSDCreateUdpMessageParameters(NULL, &origUdpAddress) failed: origUdpAddress == NULL
\n
"
);
ok
(
origUdpAddress
!=
NULL
,
"WSDCreateUdpMessageParameters(NULL, &origUdpAddress) failed: origUdpAddress == NULL
\n
"
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
origUdpAddress
,
address
);
rc
=
IWSDUdpAddress_SetTransportAddress
(
origUdpAddress
,
address
);
todo_wine
ok
(
rc
==
S_OK
,
"SetTransportAddress failed: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetTransportAddress failed: %08x
\n
"
,
rc
);
rc
=
IWSDUdpMessageParameters_SetRemoteAddress
(
udpMessageParams
,
(
IWSDAddress
*
)
origUdpAddress
);
rc
=
IWSDUdpMessageParameters_SetRemoteAddress
(
udpMessageParams
,
(
IWSDAddress
*
)
origUdpAddress
);
ok
(
rc
==
S_OK
,
"SetRemoteAddress failed: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetRemoteAddress failed: %08x
\n
"
,
rc
);
...
...
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