[PATCH 4/5] msxml3: Do not depend on libxml2 for msxwriter object.

Nikolay Sivov nsivov at codeweavers.com
Mon Aug 16 03:52:21 CDT 2021


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/msxml3/msxml_dispex.h  | 31 +++++++++++++++++++++++++++++++
 dlls/msxml3/msxml_private.h | 28 ----------------------------
 dlls/msxml3/mxwriter.c      | 12 ++++--------
 3 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/dlls/msxml3/msxml_dispex.h b/dlls/msxml3/msxml_dispex.h
index c9dbc29ddc5..ec3860c2754 100644
--- a/dlls/msxml3/msxml_dispex.h
+++ b/dlls/msxml3/msxml_dispex.h
@@ -113,4 +113,35 @@ void release_dispex(DispatchEx*) DECLSPEC_HIDDEN;
 BOOL dispex_query_interface(DispatchEx*,REFIID,void**) DECLSPEC_HIDDEN;
 const IID *get_riid_from_tid(enum tid_t tid) DECLSPEC_HIDDEN;
 
+static inline HRESULT return_bstr(const WCHAR *value, BSTR *p)
+{
+    if (!p)
+        return E_INVALIDARG;
+
+    if (value)
+    {
+        *p = SysAllocString(value);
+        if (!*p)
+            return E_OUTOFMEMORY;
+    }
+    else
+        *p = NULL;
+
+    return S_OK;
+}
+
+static inline HRESULT return_bstrn(const WCHAR *value, int len, BSTR *p)
+{
+    if (value)
+    {
+        *p = SysAllocStringLen(value, len);
+        if (!*p)
+            return E_OUTOFMEMORY;
+    }
+    else
+        *p = NULL;
+
+    return S_OK;
+}
+
 #endif /* __MSXML_DISPEX__ */
diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
index 41e16e4406c..43c6de6454e 100644
--- a/dlls/msxml3/msxml_private.h
+++ b/dlls/msxml3/msxml_private.h
@@ -340,34 +340,6 @@ static inline xmlChar *heap_strdupxmlChar(const xmlChar *str)
 
 #endif
 
-static inline HRESULT return_bstr(const WCHAR *value, BSTR *p)
-{
-    if(!p)
-        return E_INVALIDARG;
-
-    if(value) {
-        *p = SysAllocString(value);
-        if(!*p)
-            return E_OUTOFMEMORY;
-    }else {
-        *p = NULL;
-    }
-
-    return S_OK;
-}
-
-static inline HRESULT return_bstrn(const WCHAR *value, int len, BSTR *p)
-{
-    if(value) {
-        *p = SysAllocStringLen(value, len);
-        if(!*p)
-            return E_OUTOFMEMORY;
-    }else
-        *p = NULL;
-
-    return S_OK;
-}
-
 static inline HRESULT return_null_node(IXMLDOMNode **p)
 {
     if(!p)
diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c
index b1ca5a0ca41..a7eae112fb4 100644
--- a/dlls/msxml3/mxwriter.c
+++ b/dlls/msxml3/mxwriter.c
@@ -20,12 +20,8 @@
  */
 
 #define COBJMACROS
-#include "config.h"
 
 #include <stdarg.h>
-#ifdef HAVE_LIBXML2
-# include <libxml/parser.h>
-#endif
 
 #include "windef.h"
 #include "winbase.h"
@@ -34,9 +30,9 @@
 #include "msxml6.h"
 
 #include "wine/debug.h"
-#include "wine/list.h"
+#include "wine/unicode.h"
 
-#include "msxml_private.h"
+#include "msxml_dispex.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
 
@@ -258,7 +254,7 @@ static xml_encoding parse_encoding_name(const WCHAR *encoding)
     {
         n = (min+max)/2;
 
-        c = strcmpiW(xml_encoding_map[n].encoding, encoding);
+        c = lstrcmpiW(xml_encoding_map[n].encoding, encoding);
         if (!c)
             return xml_encoding_map[n].enc;
 
@@ -347,7 +343,7 @@ static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len)
     if (!len || !*data)
         return S_OK;
 
-    src_len = len == -1 ? strlenW(data) : len;
+    src_len = len == -1 ? lstrlenW(data) : len;
     if (writer->dest)
     {
         buff = &buffer->encoded;
-- 
2.32.0




More information about the wine-devel mailing list