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
9ce9d734
Commit
9ce9d734
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 Get/SetLocalAddress.
Signed-off-by:
Owen Rudge
<
orudge@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
524c632a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
11 deletions
+49
-11
msgparams.c
dlls/wsdapi/msgparams.c
+43
-5
msgparams.c
dlls/wsdapi/tests/msgparams.c
+6
-6
No files found.
dlls/wsdapi/msgparams.c
View file @
9ce9d734
...
...
@@ -32,6 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wsdapi);
typedef
struct
IWSDMessageParametersImpl
{
IWSDMessageParameters
IWSDMessageParameters_iface
;
LONG
ref
;
IWSDAddress
*
localAddress
;
}
IWSDMessageParametersImpl
;
typedef
struct
IWSDUdpMessageParametersImpl
{
...
...
@@ -68,6 +69,11 @@ static ULONG WINAPI IWSDMessageParametersImpl_Release(IWSDMessageParameters *ifa
if
(
ref
==
0
)
{
if
(
This
->
localAddress
!=
NULL
)
{
IWSDAddress_Release
(
This
->
localAddress
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -76,14 +82,46 @@ static ULONG WINAPI IWSDMessageParametersImpl_Release(IWSDMessageParameters *ifa
static
HRESULT
WINAPI
IWSDMessageParametersImpl_GetLocalAddress
(
IWSDMessageParameters
*
This
,
IWSDAddress
**
ppAddress
)
{
FIXME
(
"(%p, %p)
\n
"
,
This
,
ppAddress
);
return
E_NOTIMPL
;
IWSDMessageParametersImpl
*
impl
=
impl_from_IWSDMessageParameters
(
This
);
TRACE
(
"(%p, %p)
\n
"
,
impl
,
ppAddress
);
if
(
ppAddress
==
NULL
)
{
return
E_POINTER
;
}
if
(
impl
->
localAddress
==
NULL
)
{
return
E_ABORT
;
}
*
ppAddress
=
impl
->
localAddress
;
IWSDAddress_AddRef
(
*
ppAddress
);
return
S_OK
;
}
static
HRESULT
WINAPI
IWSDMessageParametersImpl_SetLocalAddress
(
IWSDMessageParameters
*
This
,
IWSDAddress
*
pAddress
)
{
FIXME
(
"(%p, %p)
\n
"
,
This
,
pAddress
);
return
E_NOTIMPL
;
IWSDMessageParametersImpl
*
impl
=
impl_from_IWSDMessageParameters
(
This
);
TRACE
(
"(%p, %p)
\n
"
,
impl
,
pAddress
);
if
(
pAddress
==
NULL
)
{
return
E_POINTER
;
}
if
(
impl
->
localAddress
!=
NULL
)
{
IWSDAddress_Release
(
impl
->
localAddress
);
}
impl
->
localAddress
=
pAddress
;
IWSDAddress_AddRef
(
pAddress
);
return
S_OK
;
}
static
HRESULT
WINAPI
IWSDMessageParametersImpl_GetRemoteAddress
(
IWSDMessageParameters
*
This
,
IWSDAddress
**
ppAddress
)
...
...
@@ -215,7 +253,7 @@ HRESULT WINAPI WSDCreateUdpMessageParameters(IWSDUdpMessageParameters **ppTxPara
*
ppTxParams
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
obj
));
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
if
(
!
obj
)
return
E_OUTOFMEMORY
;
obj
->
base
.
IWSDMessageParameters_iface
.
lpVtbl
=
(
IWSDMessageParametersVtbl
*
)
&
udpMsgParamsVtbl
;
...
...
dlls/wsdapi/tests/msgparams.c
View file @
9ce9d734
...
...
@@ -84,11 +84,11 @@ static void LocalAddress_tests(void)
ok
(
udpMessageParams
!=
NULL
,
"WSDCreateUdpMessageParameters(NULL, &udpMessageParams) failed: udpMessageParams == NULL
\n
"
);
rc
=
IWSDUdpMessageParameters_GetLocalAddress
(
udpMessageParams
,
NULL
);
todo_wine
ok
(
rc
==
E_POINTER
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
rc
==
E_POINTER
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
returnedAddress
==
NULL
,
"GetLocalAddress returned %p
\n
"
,
returnedAddress
);
rc
=
IWSDUdpMessageParameters_GetLocalAddress
(
udpMessageParams
,
&
returnedAddress
);
todo_wine
ok
(
rc
==
E_ABORT
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
rc
==
E_ABORT
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
returnedAddress
==
NULL
,
"GetLocalAddress returned %p
\n
"
,
returnedAddress
);
rc
=
WSDCreateUdpAddress
(
&
origUdpAddress
);
...
...
@@ -99,14 +99,14 @@ static void LocalAddress_tests(void)
todo_wine
ok
(
rc
==
S_OK
,
"SetTransportAddress failed: %08x
\n
"
,
rc
);
rc
=
IWSDUdpMessageParameters_SetLocalAddress
(
udpMessageParams
,
(
IWSDAddress
*
)
origUdpAddress
);
todo_wine
ok
(
rc
==
S_OK
,
"SetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
rc
==
S_OK
,
"SetLocalAddress failed: %08x
\n
"
,
rc
);
rc
=
IWSDUdpMessageParameters_GetLocalAddress
(
udpMessageParams
,
&
returnedAddress
);
todo_wine
ok
(
rc
==
S_OK
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
todo_wine
ok
(
returnedAddress
!=
NULL
,
"GetLocalAddress returned NULL
\n
"
);
ok
(
rc
==
S_OK
,
"GetLocalAddress failed: %08x
\n
"
,
rc
);
ok
(
returnedAddress
!=
NULL
,
"GetLocalAddress returned NULL
\n
"
);
/* Check if GetLocalAddress returns the same object */
todo_wine
ok
(
returnedAddress
==
(
IWSDAddress
*
)
origUdpAddress
,
"returnedAddress != origUdpAddress
\n
"
);
ok
(
returnedAddress
==
(
IWSDAddress
*
)
origUdpAddress
,
"returnedAddress != origUdpAddress
\n
"
);
ret
=
IWSDUdpMessageParameters_Release
(
udpMessageParams
);
ok
(
ret
==
0
,
"IWSDUdpMessageParameters_Release() has %d references, should have 0
\n
"
,
ret
);
...
...
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