Owen Rudge : wsdapi: Write EndPointReference section in Hello message body.

Alexandre Julliard julliard at winehq.org
Tue Apr 24 18:46:08 CDT 2018


Module: wine
Branch: master
Commit: 7a044047974750e0b62c4cb63111ce82bc2e000e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=7a044047974750e0b62c4cb63111ce82bc2e000e

Author: Owen Rudge <orudge at codeweavers.com>
Date:   Mon Apr 23 21:12:01 2018 +0100

wsdapi: Write EndPointReference section in Hello message body.

Signed-off-by: Owen Rudge <orudge at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wsdapi/soap.c            | 21 +++++++++++++++++++--
 dlls/wsdapi/tests/discovery.c |  2 +-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/dlls/wsdapi/soap.c b/dlls/wsdapi/soap.c
index a2a4223..af77604 100644
--- a/dlls/wsdapi/soap.c
+++ b/dlls/wsdapi/soap.c
@@ -75,6 +75,8 @@ static const WCHAR sequenceIdString[] = { 'S','e','q','u','e','n','c','e','I','d
 static const WCHAR emptyString[] = { 0 };
 static const WCHAR bodyString[] = { 'B','o','d','y', 0 };
 static const WCHAR helloString[] = { 'H','e','l','l','o', 0 };
+static const WCHAR endpointReferenceString[] = { 'E','n','d','p','o','i','n','t','R','e','f','e','r','e','n','c','e', 0 };
+static const WCHAR addressString[] = { 'A','d','d','r','e','s','s', 0 };
 
 struct discovered_namespace
 {
@@ -284,7 +286,7 @@ static HRESULT add_child_element(IWSDXMLContext *xml_context, WSDXML_ELEMENT *pa
         return ret;
     }
 
-    *out = element_obj;
+    if (out != NULL) *out = element_obj;
     return ret;
 }
 
@@ -818,7 +820,7 @@ HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR id, ULONGLON
     const WSD_URI_LIST *xaddrs_list, const WSDXML_ELEMENT *hdr_any, const WSDXML_ELEMENT *ref_param_any,
     const WSDXML_ELEMENT *endpoint_ref_any, const WSDXML_ELEMENT *any)
 {
-    WSDXML_ELEMENT *body_element = NULL, *hello_element;
+    WSDXML_ELEMENT *body_element = NULL, *hello_element, *endpoint_reference_element;
     struct list *discoveredNamespaces = NULL;
     WSDXML_NAME *body_name = NULL;
     WSD_SOAP_HEADER soapHeader;
@@ -849,6 +851,21 @@ HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR id, ULONGLON
     ret = add_child_element(impl->xmlContext, body_element, discoveryNsUri, helloString, NULL, &hello_element);
     if (FAILED(ret)) goto cleanup;
 
+    /* <wsa:EndpointReference>, <wsa:Address> */
+    ret = add_child_element(impl->xmlContext, hello_element, addressingNsUri, endpointReferenceString, NULL,
+        &endpoint_reference_element);
+    if (FAILED(ret)) goto cleanup;
+
+    ret = add_child_element(impl->xmlContext, endpoint_reference_element, addressingNsUri, addressString, id, NULL);
+    if (FAILED(ret)) goto cleanup;
+
+    /* Write any endpoint reference headers */
+    if (endpoint_ref_any != NULL)
+    {
+        ret = duplicate_element(endpoint_reference_element, endpoint_ref_any, discoveredNamespaces);
+        if (FAILED(ret)) goto cleanup;
+    }
+
     /* Write any body elements */
     if (any != NULL)
     {
diff --git a/dlls/wsdapi/tests/discovery.c b/dlls/wsdapi/tests/discovery.c
index 608edb5..c7fe8cf 100644
--- a/dlls/wsdapi/tests/discovery.c
+++ b/dlls/wsdapi/tests/discovery.c
@@ -651,7 +651,7 @@ static void Publish_tests(void)
     heap_free(msgStorage);
 
     ok(hello_message_seen == TRUE, "Hello message not received\n");
-    todo_wine ok(endpoint_reference_seen == TRUE, "EndpointReference not received\n");
+    ok(endpoint_reference_seen == TRUE, "EndpointReference not received\n");
     ok(app_sequence_seen == TRUE, "AppSequence not received\n");
     todo_wine ok(metadata_version_seen == TRUE, "MetadataVersion not received\n");
     todo_wine ok(messageOK == TRUE, "Hello message metadata not received\n");




More information about the wine-cvs mailing list