From ce05418d8e1ca0ae67e0b73f6341df1134b4d72a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 4 Oct 2016 12:33:43 +0200 Subject: [PATCH] Both XML selection namespaces (eap-metadata and eaphostconfig) are configured now --- EAPMethods/src/Main_UI.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/EAPMethods/src/Main_UI.cpp b/EAPMethods/src/Main_UI.cpp index dd5407a..aba2414 100644 --- a/EAPMethods/src/Main_UI.cpp +++ b/EAPMethods/src/Main_UI.cpp @@ -130,8 +130,10 @@ DWORD WINAPI EapPeerConfigXml2Blob( else if (!pdwConnectionDataOutSize) g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" pdwConnectionDataOutSize is NULL."))); else { + // Configure XML selection namespaces used. + pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\" xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\"")); + // - pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\"")); com_obj pXmlElConfig; if (FAILED(eapxml::select_element(pConfigDoc, bstr(L"//eaphostconfig:Config"), pXmlElConfig))) { g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_INVALID_PARAMETER, _T(__FUNCTION__) _T(" Error reading element."))); @@ -139,7 +141,6 @@ DWORD WINAPI EapPeerConfigXml2Blob( } // Load configuration. - pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\"")); try { g_peer.config_xml2blob(dwFlags, pXmlElConfig, pConnectionDataOut, pdwConnectionDataOutSize); } catch (std::exception &err) { @@ -212,9 +213,11 @@ DWORD WINAPI EapPeerConfigBlob2Xml( return dwResult; } + // Configure XML selection namespaces used. + pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eap-metadata=\"urn:ietf:params:xml:ns:yang:ietf-eap-metadata\" xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\"")); + // Select node. com_obj pXmlElConfig; - pConfigDoc->setProperty(bstr(L"SelectionNamespaces"), variant(L"xmlns:eaphostconfig=\"http://www.microsoft.com/provisioning/EapHostConfig\"")); if (FAILED(eapxml::select_node(pConfigDoc, bstr(L"eaphostconfig:Config"), pXmlElConfig))) { g_peer.log_error(*ppEapError = g_peer.make_error(dwResult = ERROR_NOT_FOUND, _T(__FUNCTION__) _T(" Error selecting element."))); return dwResult;