2 * Web Services on Devices
5 * Copyright 2017-2018 Owen Rudge for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #ifndef _WINE_WSDAPI_INTERNAL_H
23 #define _WINE_WSDAPI_INTERNAL_H
31 #include "wine/list.h"
33 #define WSD_MAX_TEXT_LENGTH 8192
37 struct notificationSink
40 IWSDiscoveryPublisherNotify
*notificationSink
;
49 #define MAX_WSD_THREADS 20
51 typedef struct IWSDiscoveryPublisherImpl
{
52 IWSDiscoveryPublisher IWSDiscoveryPublisher_iface
;
54 IWSDXMLContext
*xmlContext
;
56 struct list notificationSinks
;
57 CRITICAL_SECTION notification_sink_critical_section
;
58 BOOL publisherStarted
;
59 HANDLE thread_handles
[MAX_WSD_THREADS
];
60 int num_thread_handles
;
61 struct list message_ids
;
62 CRITICAL_SECTION message_ids_critical_section
;
63 } IWSDiscoveryPublisherImpl
;
67 BOOL
init_networking(IWSDiscoveryPublisherImpl
*impl
);
68 void terminate_networking(IWSDiscoveryPublisherImpl
*impl
);
69 BOOL
send_udp_multicast(IWSDiscoveryPublisherImpl
*impl
, char *data
, int length
, int max_initial_delay
);
70 HRESULT
send_udp_unicast(char *data
, int length
, IWSDUdpAddress
*remote_addr
, int max_initial_delay
);
74 HRESULT
send_hello_message(IWSDiscoveryPublisherImpl
*impl
, LPCWSTR id
, ULONGLONG metadata_ver
, ULONGLONG instance_id
,
75 ULONGLONG msg_num
, LPCWSTR session_id
, const WSD_NAME_LIST
*types_list
, const WSD_URI_LIST
*scopes_list
,
76 const WSD_URI_LIST
*xaddrs_list
, const WSDXML_ELEMENT
*hdr_any
, const WSDXML_ELEMENT
*ref_param_any
,
77 const WSDXML_ELEMENT
*endpoint_ref_any
, const WSDXML_ELEMENT
*any
);
79 HRESULT
send_bye_message(IWSDiscoveryPublisherImpl
*impl
, LPCWSTR id
, ULONGLONG instance_id
, ULONGLONG msg_num
,
80 LPCWSTR session_id
, const WSDXML_ELEMENT
*any
);
82 HRESULT
send_probe_matches_message(IWSDiscoveryPublisherImpl
*impl
, const WSD_SOAP_MESSAGE
*probe_msg
,
83 IWSDMessageParameters
*message_params
, LPCWSTR id
, ULONGLONG metadata_ver
, ULONGLONG instance_id
,
84 ULONGLONG msg_num
, LPCWSTR session_id
, const WSD_NAME_LIST
*types_list
, const WSD_URI_LIST
*scopes_list
,
85 const WSD_URI_LIST
*xaddrs_list
, const WSDXML_ELEMENT
*header_any
, const WSDXML_ELEMENT
*ref_param_any
,
86 const WSDXML_ELEMENT
*endpoint_ref_any
, const WSDXML_ELEMENT
*any
);
88 HRESULT
register_namespaces(IWSDXMLContext
*xml_context
);
90 HRESULT
read_message(IWSDiscoveryPublisherImpl
*impl
, const char *xml
, int xml_length
, WSD_SOAP_MESSAGE
**out_msg
,
93 #define MSGTYPE_UNKNOWN 0
94 #define MSGTYPE_PROBE 1
98 LPWSTR
duplicate_string(void *parentMemoryBlock
, LPCWSTR value
);
99 WSDXML_NAME
*duplicate_name(void *parentMemoryBlock
, WSDXML_NAME
*name
);
100 WSDXML_NAMESPACE
*xml_context_find_namespace_by_prefix(IWSDXMLContext
*context
, LPCWSTR prefix
);