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
52ad4d0e
Commit
52ad4d0e
authored
Jun 28, 2017
by
Owen Rudge
Committed by
Alexandre Julliard
Jul 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsdapi: Implement IWSDUdpAddress_Get/SetPort.
Signed-off-by:
Owen Rudge
<
orudge@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d140cd50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
15 deletions
+29
-15
address.c
dlls/wsdapi/address.c
+18
-4
address.c
dlls/wsdapi/tests/address.c
+11
-11
No files found.
dlls/wsdapi/address.c
View file @
52ad4d0e
...
...
@@ -37,6 +37,7 @@ typedef struct IWSDUdpAddressImpl {
SOCKADDR_STORAGE
sockAddr
;
WCHAR
ipv4Address
[
25
];
WCHAR
ipv6Address
[
64
];
WORD
port
;
}
IWSDUdpAddressImpl
;
static
inline
IWSDUdpAddressImpl
*
impl_from_IWSDUdpAddress
(
IWSDUdpAddress
*
iface
)
...
...
@@ -113,14 +114,27 @@ static HRESULT WINAPI IWSDUdpAddressImpl_Deserialize(IWSDUdpAddress *This, LPCWS
static
HRESULT
WINAPI
IWSDUdpAddressImpl_GetPort
(
IWSDUdpAddress
*
This
,
WORD
*
pwPort
)
{
FIXME
(
"(%p, %p)
\n
"
,
This
,
pwPort
);
return
E_NOTIMPL
;
IWSDUdpAddressImpl
*
impl
=
impl_from_IWSDUdpAddress
(
This
);
TRACE
(
"(%p, %p)
\n
"
,
This
,
pwPort
);
if
(
pwPort
==
NULL
)
{
return
E_POINTER
;
}
*
pwPort
=
impl
->
port
;
return
S_OK
;
}
static
HRESULT
WINAPI
IWSDUdpAddressImpl_SetPort
(
IWSDUdpAddress
*
This
,
WORD
wPort
)
{
FIXME
(
"(%p, %d)
\n
"
,
This
,
wPort
);
return
E_NOTIMPL
;
IWSDUdpAddressImpl
*
impl
=
impl_from_IWSDUdpAddress
(
This
);
TRACE
(
"(%p, %d)
\n
"
,
This
,
wPort
);
impl
->
port
=
wPort
;
return
S_OK
;
}
static
HRESULT
WINAPI
IWSDUdpAddressImpl_GetTransportAddressEx
(
IWSDUdpAddress
*
This
,
BOOL
fSafe
,
LPCWSTR
*
ppszAddress
)
...
...
dlls/wsdapi/tests/address.c
View file @
52ad4d0e
...
...
@@ -164,32 +164,32 @@ static void GetSetPort_udp_tests(void)
/* No test for GetPort(NULL) as this causes an access violation exception on Windows */
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
actualPort
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
actualPort
==
0
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
/* Try setting a zero port */
rc
=
IWSDUdpAddress_SetPort
(
udpAddress
,
0
);
todo_wine
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
actualPort
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
actualPort
==
0
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
/* Set a real port */
rc
=
IWSDUdpAddress_SetPort
(
udpAddress
,
expectedPort1
);
todo_wine
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
actualPort
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
todo_wine
ok
(
actualPort
==
expectedPort1
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
actualPort
==
expectedPort1
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
/* Now set a different port */
rc
=
IWSDUdpAddress_SetPort
(
udpAddress
,
expectedPort2
);
todo_wine
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetPort returned unexpected result: %08x
\n
"
,
rc
);
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
actualPort
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
todo_wine
ok
(
actualPort
==
expectedPort2
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
actualPort
==
expectedPort2
,
"GetPort returned unexpected port: %d
\n
"
,
actualPort
);
/* Release the object */
ret
=
IWSDUdpAddress_Release
(
udpAddress
);
...
...
@@ -330,7 +330,7 @@ static void GetSetSockaddr_udp_tests(void)
/* Check that GetPort doesn't return the port set via the socket */
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
port
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
port
==
0
,
"GetPort returned unexpected port: %d
\n
"
,
port
);
/* Try setting an IPv4 address without a port */
...
...
@@ -370,7 +370,7 @@ static void GetSetSockaddr_udp_tests(void)
/* Check that GetPort doesn't return the port set via the socket */
rc
=
IWSDUdpAddress_GetPort
(
udpAddress
,
&
port
);
todo_wine
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"GetPort returned unexpected result: %08x
\n
"
,
rc
);
ok
(
port
==
0
,
"GetPort returned unexpected port: %d
\n
"
,
port
);
/* Try setting an IPv6 address without a port */
...
...
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