From: Owen Rudge Subject: [PATCH 2/7] wsdapi: Add stub implementation of IWSDiscoveryPublisher_PublishEx. Message-Id: Date: Tue, 21 Nov 2017 22:42:43 +0000 Signed-off-by: Owen Rudge --- dlls/wsdapi/Makefile.in | 1 + dlls/wsdapi/discovery.c | 64 ++++++++++++++++++------------------------- dlls/wsdapi/soap.c | 38 +++++++++++++++++++++++++ dlls/wsdapi/wsdapi_internal.h | 24 ++++++++++++++++ 4 files changed, 89 insertions(+), 38 deletions(-) create mode 100644 dlls/wsdapi/soap.c diff --git a/dlls/wsdapi/Makefile.in b/dlls/wsdapi/Makefile.in index 5c953515e2..155d004f4a 100644 --- a/dlls/wsdapi/Makefile.in +++ b/dlls/wsdapi/Makefile.in @@ -8,4 +8,5 @@ C_SRCS = \ main.c \ memory.c \ msgparams.c \ + soap.c \ xml.c diff --git a/dlls/wsdapi/discovery.c b/dlls/wsdapi/discovery.c index 82a1ca0a5a..41cb25a6fd 100644 --- a/dlls/wsdapi/discovery.c +++ b/dlls/wsdapi/discovery.c @@ -23,30 +23,12 @@ #define COBJMACROS #define INITGUID -#include "windef.h" -#include "winbase.h" +#include "wsdapi_internal.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) { return CONTAINING_RECORD(iface, IWSDiscoveryPublisherImpl, IWSDiscoveryPublisher_iface); @@ -196,14 +178,35 @@ static HRESULT WINAPI IWSDiscoveryPublisherImpl_UnRegisterNotificationSink(IWSDi return E_FAIL; } +static HRESULT WINAPI IWSDiscoveryPublisherImpl_PublishEx(IWSDiscoveryPublisher *This, LPCWSTR pszId, ULONGLONG ullMetadataVersion, + ULONGLONG ullInstanceId, ULONGLONG ullMessageNumber, LPCWSTR pszSessionId, + const WSD_NAME_LIST *pTypesList, const WSD_URI_LIST *pScopesList, + const WSD_URI_LIST *pXAddrsList, const WSDXML_ELEMENT *pHeaderAny, + const WSDXML_ELEMENT *pReferenceParameterAny, const WSDXML_ELEMENT *pPolicyAny, + const WSDXML_ELEMENT *pEndpointReferenceAny, const WSDXML_ELEMENT *pAny) +{ + IWSDiscoveryPublisherImpl *impl = impl_from_IWSDiscoveryPublisher(This); + + TRACE("(%p, %s, %s, %s, %s, %s, %p, %p, %p, %p, %p, %p, %p, %p)\n", This, debugstr_w(pszId), wine_dbgstr_longlong(ullMetadataVersion), + wine_dbgstr_longlong(ullInstanceId), wine_dbgstr_longlong(ullMessageNumber), debugstr_w(pszSessionId), pTypesList, pScopesList, pXAddrsList, + pHeaderAny, pReferenceParameterAny, pPolicyAny, pEndpointReferenceAny, pAny); + + if ((!impl->publisherStarted) || (pszId == NULL) || (lstrlenW(pszId) > WSD_MAX_TEXT_LENGTH) || + ((pszSessionId != NULL) && (lstrlenW(pszSessionId) > WSD_MAX_TEXT_LENGTH))) + { + return E_INVALIDARG; + } + + return send_hello_message(impl, pszId, ullMetadataVersion, ullInstanceId, ullMessageNumber, pszSessionId, pTypesList, pScopesList, + pXAddrsList, pHeaderAny, pReferenceParameterAny, pEndpointReferenceAny, pAny); +} + static HRESULT WINAPI IWSDiscoveryPublisherImpl_Publish(IWSDiscoveryPublisher *This, LPCWSTR pszId, ULONGLONG ullMetadataVersion, ULONGLONG ullInstanceId, ULONGLONG ullMessageNumber, LPCWSTR pszSessionId, const WSD_NAME_LIST *pTypesList, const WSD_URI_LIST *pScopesList, const WSD_URI_LIST *pXAddrsList) { - FIXME("(%p, %s, %s, %s, %s, %s, %p, %p, %p)\n", This, debugstr_w(pszId), wine_dbgstr_longlong(ullMetadataVersion), wine_dbgstr_longlong(ullInstanceId), - wine_dbgstr_longlong(ullMessageNumber), debugstr_w(pszSessionId), pTypesList, pScopesList, pXAddrsList); - - return E_NOTIMPL; + return IWSDiscoveryPublisherImpl_PublishEx(This, pszId, ullMetadataVersion, ullInstanceId, ullMessageNumber, pszSessionId, pTypesList, pScopesList, + pXAddrsList, NULL, NULL, NULL, NULL, NULL); } static HRESULT WINAPI IWSDiscoveryPublisherImpl_UnPublish(IWSDiscoveryPublisher *This, LPCWSTR pszId, ULONGLONG ullInstanceId, ULONGLONG ullMessageNumber, @@ -241,21 +244,6 @@ static HRESULT WINAPI IWSDiscoveryPublisherImpl_MatchResolve(IWSDiscoveryPublish return E_NOTIMPL; } -static HRESULT WINAPI IWSDiscoveryPublisherImpl_PublishEx(IWSDiscoveryPublisher *This, LPCWSTR pszId, ULONGLONG ullMetadataVersion, - ULONGLONG ullInstanceId, ULONGLONG ullMessageNumber, LPCWSTR pszSessionId, - const WSD_NAME_LIST *pTypesList, const WSD_URI_LIST *pScopesList, - const WSD_URI_LIST *pXAddrsList, const WSDXML_ELEMENT *pHeaderAny, - const WSDXML_ELEMENT *pReferenceParameterAny, const WSDXML_ELEMENT *pPolicyAny, - const WSDXML_ELEMENT *pEndpointReferenceAny, const WSDXML_ELEMENT *pAny) -{ - FIXME("(%p, %s, %s, %s, %s, %s, %p, %p, %p, %p, %p, %p, %p, %p)\n", This, debugstr_w(pszId), wine_dbgstr_longlong(ullMetadataVersion), - wine_dbgstr_longlong(ullInstanceId), wine_dbgstr_longlong(ullMessageNumber), debugstr_w(pszSessionId), pTypesList, pScopesList, pXAddrsList, - pHeaderAny, pReferenceParameterAny, pPolicyAny, pEndpointReferenceAny, pAny); - - return E_NOTIMPL; -} - - static HRESULT WINAPI IWSDiscoveryPublisherImpl_MatchProbeEx(IWSDiscoveryPublisher *This, const WSD_SOAP_MESSAGE *pProbeMessage, IWSDMessageParameters *pMessageParameters, LPCWSTR pszId, ULONGLONG ullMetadataVersion, ULONGLONG ullInstanceId, ULONGLONG ullMessageNumber, LPCWSTR pszSessionId, diff --git a/dlls/wsdapi/soap.c b/dlls/wsdapi/soap.c new file mode 100644 index 0000000000..8a7a8f5226 --- /dev/null +++ b/dlls/wsdapi/soap.c @@ -0,0 +1,38 @@ +/* + * Web Services on Devices + * + * Copyright 2017 Owen Rudge for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#define COBJMACROS + +#include "wsdapi_internal.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wsdapi); + +HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR pszId, ULONGLONG ullMetadataVersion, ULONGLONG ullInstanceId, + ULONGLONG ullMessageNumber, LPCWSTR pszSessionId, const WSD_NAME_LIST *pTypesList, const WSD_URI_LIST *pScopesList, + const WSD_URI_LIST *pXAddrsList, const WSDXML_ELEMENT *pHeaderAny, const WSDXML_ELEMENT *pReferenceParameterAny, + const WSDXML_ELEMENT *pEndpointReferenceAny, const WSDXML_ELEMENT *pAny) +{ + FIXME("stub\n"); + return E_NOTIMPL; +} diff --git a/dlls/wsdapi/wsdapi_internal.h b/dlls/wsdapi/wsdapi_internal.h index e032a85766..3dedc43ece 100644 --- a/dlls/wsdapi/wsdapi_internal.h +++ b/dlls/wsdapi/wsdapi_internal.h @@ -32,4 +32,28 @@ #define WSD_MAX_TEXT_LENGTH 8192 +/* discovery.c */ + +struct notificationSink +{ + struct list entry; + IWSDiscoveryPublisherNotify *notificationSink; +}; + +typedef struct IWSDiscoveryPublisherImpl { + IWSDiscoveryPublisher IWSDiscoveryPublisher_iface; + LONG ref; + IWSDXMLContext *xmlContext; + DWORD addressFamily; + struct list notificationSinks; + BOOL publisherStarted; +} IWSDiscoveryPublisherImpl; + +/* soap.c */ + +HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR pszId, ULONGLONG ullMetadataVersion, ULONGLONG ullInstanceId, + ULONGLONG ullMessageNumber, LPCWSTR pszSessionId, const WSD_NAME_LIST *pTypesList, const WSD_URI_LIST *pScopesList, + const WSD_URI_LIST *pXAddrsList, const WSDXML_ELEMENT *pHeaderAny, const WSDXML_ELEMENT *pReferenceParameterAny, + const WSDXML_ELEMENT *pEndpointReferenceAny, const WSDXML_ELEMENT *pAny); + #endif