[XMLLITE] Sync with Wine Staging 1.7.55. CORE-10536
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 20 Nov 2015 10:10:53 +0000 (10:10 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 20 Nov 2015 10:10:53 +0000 (10:10 +0000)
svn path=/trunk/; revision=69947

reactos/dll/win32/xmllite/reader.c
reactos/dll/win32/xmllite/writer.c
reactos/dll/win32/xmllite/xmllite.spec
reactos/dll/win32/xmllite/xmllite_private.h
reactos/media/doc/README.WINE

index 3ef5f9b..df4cec0 100644 (file)
@@ -150,6 +150,16 @@ const WCHAR *get_encoding_name(xml_encoding encoding)
     return xml_encoding_map[encoding].name;
 }
 
+xml_encoding get_encoding_from_codepage(UINT codepage)
+{
+    int i;
+    for (i = 0; i < sizeof(xml_encoding_map)/sizeof(xml_encoding_map[0]); i++)
+    {
+        if (xml_encoding_map[i].cp == codepage) return xml_encoding_map[i].enc;
+    }
+    return XmlEncoding_Unknown;
+}
+
 typedef struct
 {
     char *data;
@@ -2835,7 +2845,7 @@ static HRESULT WINAPI xmlreader_GetDepth(IXmlReader* iface, UINT *depth)
 static BOOL WINAPI xmlreader_IsEOF(IXmlReader* iface)
 {
     FIXME("(%p): stub\n", iface);
-    return E_NOTIMPL;
+    return FALSE;
 }
 
 static const struct IXmlReaderVtbl xmlreader_vtbl =
index dc02e21..d9c3cdd 100644 (file)
@@ -1075,19 +1075,12 @@ HRESULT WINAPI CreateXmlWriter(REFIID riid, void **obj, IMalloc *imalloc)
     return S_OK;
 }
 
-HRESULT WINAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream,
-                                                     IMalloc *imalloc,
-                                                     LPCWSTR encoding,
-                                                     IXmlWriterOutput **output)
+static HRESULT create_writer(IUnknown *stream, IMalloc *imalloc, xml_encoding encoding,
+                             IXmlWriterOutput **output)
 {
-    static const WCHAR utf8W[] = {'U','T','F','-','8',0};
     xmlwriteroutput *writeroutput;
     HRESULT hr;
 
-    TRACE("%p %p %s %p\n", stream, imalloc, debugstr_w(encoding), output);
-
-    if (!stream || !output) return E_INVALIDARG;
-
     *output = NULL;
 
     if (imalloc)
@@ -1100,7 +1093,7 @@ HRESULT WINAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream,
     writeroutput->ref = 1;
     writeroutput->imalloc = imalloc;
     if (imalloc) IMalloc_AddRef(imalloc);
-    writeroutput->encoding = parse_encoding_name(encoding ? encoding : utf8W, -1);
+    writeroutput->encoding = encoding;
     writeroutput->stream = NULL;
     hr = init_output_buffer(writeroutput);
     if (FAILED(hr)) {
@@ -1116,3 +1109,34 @@ HRESULT WINAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream,
 
     return S_OK;
 }
+
+HRESULT WINAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream,
+                                                     IMalloc *imalloc,
+                                                     LPCWSTR encoding,
+                                                     IXmlWriterOutput **output)
+{
+    static const WCHAR utf8W[] = {'U','T','F','-','8',0};
+    xml_encoding xml_enc;
+
+    TRACE("%p %p %s %p\n", stream, imalloc, debugstr_w(encoding), output);
+
+    if (!stream || !output) return E_INVALIDARG;
+
+    xml_enc = parse_encoding_name(encoding ? encoding : utf8W, -1);
+    return create_writer(stream, imalloc, xml_enc, output);
+}
+
+HRESULT WINAPI CreateXmlWriterOutputWithEncodingCodePage(IUnknown *stream,
+                                                         IMalloc *imalloc,
+                                                         UINT codepage,
+                                                         IXmlWriterOutput **output)
+{
+    xml_encoding xml_enc;
+
+    TRACE("%p %p %u %p\n", stream, imalloc, codepage, output);
+
+    if (!stream || !output) return E_INVALIDARG;
+
+    xml_enc = get_encoding_from_codepage(codepage);
+    return create_writer(stream, imalloc, xml_enc, output);
+}
index 295bff6..d6ee017 100644 (file)
@@ -2,5 +2,5 @@
 @ stub CreateXmlReaderInputWithEncodingCodePage
 @ stdcall CreateXmlReaderInputWithEncodingName(ptr ptr ptr long ptr ptr)
 @ stdcall CreateXmlWriter(ptr ptr ptr)
-@ stub CreateXmlWriterOutputWithEncodingCodePage
+@ stdcall CreateXmlWriterOutputWithEncodingCodePage(ptr ptr long ptr)
 @ stdcall CreateXmlWriterOutputWithEncodingName(ptr ptr wstr ptr)
index b2c5e71..d06e49e 100644 (file)
@@ -89,5 +89,6 @@ typedef enum
 xml_encoding parse_encoding_name(const WCHAR*,int) DECLSPEC_HIDDEN;
 HRESULT get_code_page(xml_encoding,UINT*) DECLSPEC_HIDDEN;
 const WCHAR *get_encoding_name(xml_encoding) DECLSPEC_HIDDEN;
+xml_encoding get_encoding_from_codepage(UINT) DECLSPEC_HIDDEN;
 
 #endif /* __XMLLITE_PRIVATE__ */
index 521d49b..322c0b6 100644 (file)
@@ -223,7 +223,7 @@ reactos/dll/win32/xinput1_1           # Synced to WineStaging-1.7.47
 reactos/dll/win32/xinput1_2           # Synced to WineStaging-1.7.47
 reactos/dll/win32/xinput1_3           # Synced to WineStaging-1.7.47
 reactos/dll/win32/xinput9_1_0         # Synced to WineStaging-1.7.47
-reactos/dll/win32/xmllite             # Synced to WineStaging-1.7.47
+reactos/dll/win32/xmllite             # Synced to WineStaging-1.7.55
 
 reactos/dll/cpl/inetcpl               # Synced to WineStaging-1.7.47