[MSXML3] Sync with Wine Staging 4.18. CORE-16441
[reactos.git] / dll / win32 / msxml3 / selection.c
index eeb7203..31be4d8 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-
 #define COBJMACROS
 
-#include <config.h>
+#include "config.h"
 
-//#include <stdarg.h>
+#include <stdarg.h>
 #ifdef HAVE_LIBXML2
-//# include <libxml/parser.h>
-//# include <libxml/xmlerror.h>
-//# include <libxml/xpath.h>
+# include <libxml/parser.h>
+# include <libxml/xmlerror.h>
+# include <libxml/xpath.h>
 # include <libxml/xpathInternals.h>
 #endif
 
-#include <windef.h>
-#include <winbase.h>
-//#include "winuser.h"
-#include <ole2.h>
-#include <msxml6.h>
-#include <msxml2did.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "msxml6.h"
+#include "msxml2did.h"
 
 #include "msxml_private.h"
 
-#include <wine/debug.h>
+#include "wine/debug.h"
 
 /* This file implements the object returned by a XPath query. Note that this is
  * not the IXMLDOMNodeList returned by childNodes - it's implemented in nodelist.c.
  *
  */
 
-WINE_DEFAULT_DEBUG_CHANNEL(msxml);
-
 #ifdef HAVE_LIBXML2
 
+WINE_DEFAULT_DEBUG_CHANNEL(msxml);
+
 int registerNamespaces(xmlXPathContextPtr ctxt);
 xmlChar* XSLPattern_to_XPath(xmlXPathContextPtr ctxt, xmlChar const* xslpat_str);
 
@@ -180,7 +177,6 @@ static ULONG WINAPI domselection_Release(
         xmlXPathFreeObject(This->result);
         xmldoc_release(This->node->doc);
         if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant);
-        release_dispex(&This->dispex);
         heap_free(This);
     }
 
@@ -835,7 +831,7 @@ HRESULT create_selection(xmlNodePtr node, xmlChar* query, IXMLDOMNodeList **out)
     TRACE("found %d matches\n", xmlXPathNodeSetGetLength(This->result->nodesetval));
 
 cleanup:
-    if (This && FAILED(hr))
+    if (FAILED(hr))
         IXMLDOMSelection_Release( &This->IXMLDOMSelection_iface );
     xmlXPathFreeContext(ctxt);
     return hr;