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
44048e06
Commit
44048e06
authored
Apr 18, 2017
by
Owen Rudge
Committed by
Alexandre Julliard
Apr 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsdapi: Implement RegisterNotificationSink and UnRegisterNotificationSink.
Signed-off-by:
Owen Rudge
<
orudge@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
49da36a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
4 deletions
+67
-4
discovery.c
dlls/wsdapi/discovery.c
+67
-4
No files found.
dlls/wsdapi/discovery.c
View file @
44048e06
...
...
@@ -26,17 +26,25 @@
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "objbase.h"
#include "guiddef.h"
#include "wsdapi.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wsdapi
);
struct
notificationSink
{
struct
list
entry
;
IWSDiscoveryPublisherNotify
*
notificationSink
;
};
typedef
struct
IWSDiscoveryPublisherImpl
{
IWSDiscoveryPublisher
IWSDiscoveryPublisher_iface
;
LONG
ref
;
IWSDXMLContext
*
xmlContext
;
DWORD
addressFamily
;
struct
list
notificationSinks
;
}
IWSDiscoveryPublisherImpl
;
static
inline
IWSDiscoveryPublisherImpl
*
impl_from_IWSDiscoveryPublisher
(
IWSDiscoveryPublisher
*
iface
)
...
...
@@ -86,6 +94,7 @@ static ULONG WINAPI IWSDiscoveryPublisherImpl_Release(IWSDiscoveryPublisher *ifa
{
IWSDiscoveryPublisherImpl
*
This
=
impl_from_IWSDiscoveryPublisher
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
notificationSink
*
sink
,
*
cursor
;
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
...
...
@@ -95,6 +104,15 @@ static ULONG WINAPI IWSDiscoveryPublisherImpl_Release(IWSDiscoveryPublisher *ifa
{
IWSDXMLContext_Release
(
This
->
xmlContext
);
}
LIST_FOR_EACH_ENTRY_SAFE
(
sink
,
cursor
,
&
This
->
notificationSinks
,
struct
notificationSink
,
entry
)
{
IWSDiscoveryPublisherNotify_Release
(
sink
->
notificationSink
);
list_remove
(
&
sink
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
sink
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
...
...
@@ -125,14 +143,57 @@ static HRESULT WINAPI IWSDiscoveryPublisherImpl_SetAddressFamily(IWSDiscoveryPub
static
HRESULT
WINAPI
IWSDiscoveryPublisherImpl_RegisterNotificationSink
(
IWSDiscoveryPublisher
*
This
,
IWSDiscoveryPublisherNotify
*
pSink
)
{
FIXME
(
"(%p, %p)
\n
"
,
This
,
pSink
);
return
E_NOTIMPL
;
IWSDiscoveryPublisherImpl
*
impl
=
impl_from_IWSDiscoveryPublisher
(
This
);
struct
notificationSink
*
sink
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
pSink
);
if
(
pSink
==
NULL
)
{
return
E_INVALIDARG
;
}
sink
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
sink
));
if
(
!
sink
)
{
return
E_OUTOFMEMORY
;
}
sink
->
notificationSink
=
pSink
;
IWSDiscoveryPublisherNotify_AddRef
(
pSink
);
list_add_tail
(
&
impl
->
notificationSinks
,
&
sink
->
entry
);
return
S_OK
;
}
static
HRESULT
WINAPI
IWSDiscoveryPublisherImpl_UnRegisterNotificationSink
(
IWSDiscoveryPublisher
*
This
,
IWSDiscoveryPublisherNotify
*
pSink
)
{
FIXME
(
"(%p, %p)
\n
"
,
This
,
pSink
);
return
E_NOTIMPL
;
IWSDiscoveryPublisherImpl
*
impl
=
impl_from_IWSDiscoveryPublisher
(
This
);
struct
notificationSink
*
sink
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
pSink
);
if
(
pSink
==
NULL
)
{
return
E_INVALIDARG
;
}
LIST_FOR_EACH_ENTRY
(
sink
,
&
impl
->
notificationSinks
,
struct
notificationSink
,
entry
)
{
if
(
sink
->
notificationSink
==
pSink
)
{
IWSDiscoveryPublisherNotify_Release
(
pSink
);
list_remove
(
&
sink
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
sink
);
return
S_OK
;
}
}
/* Notification sink is not registered */
return
E_FAIL
;
}
static
HRESULT
WINAPI
IWSDiscoveryPublisherImpl_Publish
(
IWSDiscoveryPublisher
*
This
,
LPCWSTR
pszId
,
ULONGLONG
ullMetadataVersion
,
ULONGLONG
ullInstanceId
,
...
...
@@ -306,6 +367,8 @@ HRESULT WINAPI WSDCreateDiscoveryPublisher(IWSDXMLContext *pContext, IWSDiscover
IWSDXMLContext_AddRef
(
pContext
);
}
list_init
(
&
obj
->
notificationSinks
);
*
ppPublisher
=
&
obj
->
IWSDiscoveryPublisher_iface
;
TRACE
(
"Returning iface %p
\n
"
,
*
ppPublisher
);
...
...
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