[XMLLITE] Sync with Wine Staging 1.7.55. CORE-10536

svn path=/trunk/; revision=69947
This commit is contained in:
Amine Khaldi 2015-11-20 10:10:53 +00:00
parent 13484670a2
commit b9cb1aabf1
5 changed files with 48 additions and 13 deletions

View 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 =

View 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);
}

View 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)

View 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__ */

View 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