ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2016
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
228 discussions
Start a n
N
ew thread
[akhaldi] 71577: [MSXML3_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jun 7 10:30:15 2016 New Revision: 71577 URL:
http://svn.reactos.org/svn/reactos?rev=71577&view=rev
Log: [MSXML3_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/rostests/winetests/msxml3/domdoc.c trunk/rostests/winetests/msxml3/httpreq.c trunk/rostests/winetests/msxml3/saxreader.c trunk/rostests/winetests/msxml3/schema.c trunk/rostests/winetests/msxml3/xmldoc.c Modified: trunk/rostests/winetests/msxml3/domdoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/domdoc.c…
============================================================================== --- trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/domdoc.c [iso-8859-1] Tue Jun 7 10:30:15 2016 @@ -6742,9 +6742,9 @@ BSTR sPart1 = _bstr_(szBasicTransformSSXMLPart1); BSTR sPart2 = _bstr_(szBasicTransformSSXMLPart2); BSTR sFileName = _bstr_(lpPathBuffer); - int nLegnth = lstrlenW(sPart1) + lstrlenW(sPart2) + lstrlenW(sFileName) + 1; - - sXSL = SysAllocStringLen(NULL, nLegnth); + int nLength = lstrlenW(sPart1) + lstrlenW(sPart2) + lstrlenW(sFileName) + 1; + + sXSL = SysAllocStringLen(NULL, nLength); lstrcpyW(sXSL, sPart1); lstrcatW(sXSL, sFileName); lstrcatW(sXSL, sPart2); @@ -9297,10 +9297,12 @@ { const get_attributes_t *entry = get_attributes; IXMLDOMNamedNodeMap *map; - IXMLDOMDocument *doc; + IXMLDOMDocument *doc, *doc2; IXMLDOMNode *node, *node2; + IXMLDOMElement *elem; VARIANT_BOOL b; HRESULT hr; + VARIANT v; BSTR str; LONG length; @@ -9469,6 +9471,39 @@ ok(hr == S_OK, "got %08x\n", hr); EXPECT_REF(node2, 1); IXMLDOMNode_Release(node2); + + IXMLDOMNamedNodeMap_Release(map); + + /* append created element a different document, map still works */ + hr = IXMLDOMDocument_createElement(doc, _bstr_("test"), &elem); + ok(hr == S_OK, "createElement failed: %08x\n", hr); + + V_VT(&v) = VT_I4; + V_I4(&v) = 1; + hr = IXMLDOMElement_setAttribute(elem, _bstr_("testattr"), v); + ok(hr == S_OK, "setAttribute failed: %08x\n", hr); + + hr = IXMLDOMElement_get_attributes(elem, &map); + ok(hr == S_OK, "get_attributes failed: %08x\n", hr); + + length = 0; + hr = IXMLDOMNamedNodeMap_get_length(map, &length); + ok(hr == S_OK, "got %08x\n", hr); + ok(length == 1, "got %d\n", length); + + doc2 = create_document(&IID_IXMLDOMDocument); + + hr = IXMLDOMDocument_appendChild(doc2, (IXMLDOMNode*)elem, &node); + ok(hr == S_OK, "appendChild failed: %08x\n", hr); + ok(node == (IXMLDOMNode*)elem, "node != elem\n"); + IXMLDOMNode_Release(node); + IXMLDOMElement_Release(elem); + IXMLDOMDocument_Release(doc2); + + length = 0; + hr = IXMLDOMNamedNodeMap_get_length(map, &length); + ok(hr == S_OK, "got %08x\n", hr); + ok(length == 1, "got %d\n", length); IXMLDOMNamedNodeMap_Release(map); Modified: trunk/rostests/winetests/msxml3/httpreq.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/httpreq.…
============================================================================== --- trunk/rostests/winetests/msxml3/httpreq.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/httpreq.c [iso-8859-1] Tue Jun 7 10:30:15 2016 @@ -49,9 +49,10 @@ #define EXPECT_REF(node,ref) _expect_ref((IUnknown*)node, ref, __LINE__) static void _expect_ref(IUnknown* obj, ULONG ref, int line) { - ULONG rc = IUnknown_AddRef(obj); - IUnknown_Release(obj); - ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); + ULONG rc; + IUnknown_AddRef(obj); + rc = IUnknown_Release(obj); + ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); } DEFINE_GUID(SID_SContainerDispatch, 0xb722be00, 0x4e68, 0x101b, 0xa2, 0xbc, 0x00, 0xaa, 0x00, 0x40, 0x47, 0x70); Modified: trunk/rostests/winetests/msxml3/saxreader.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/saxreade…
============================================================================== --- trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/saxreader.c [iso-8859-1] Tue Jun 7 10:30:15 2016 @@ -47,9 +47,10 @@ #define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__) static void _expect_ref(IUnknown* obj, ULONG ref, int line) { - ULONG rc = IUnknown_AddRef(obj); - IUnknown_Release(obj); - ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); + ULONG rc; + IUnknown_AddRef(obj); + rc = IUnknown_Release(obj); + ok_(__FILE__, line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); } static LONG get_refcount(void *iface) @@ -2931,7 +2932,6 @@ ok(hr == S_OK, "%s, expected S_OK, got %08x\n", wine_dbgstr_guid(riids[i]), hr); ok(writer2 == writer, "got %p, expected %p\n", writer2, writer); EXPECT_REF(writer, 3); - EXPECT_REF(writer2, 3); IMXWriter_Release(writer2); IUnknown_Release(handler); } @@ -3309,7 +3309,6 @@ pos2.QuadPart = 0; hr = IStream_Seek(stream, pos, STREAM_SEEK_CUR, &pos2); EXPECT_HR(hr, S_OK); -todo_wine ok(pos2.QuadPart != 0, "unexpected stream beginning\n"); hr = IMXWriter_get_output(writer, NULL); @@ -4150,7 +4149,6 @@ V_UNKNOWN(&dest) = (IUnknown*)&mxstream; hr = IMXWriter_put_output(writer, dest); ok(hr == S_OK, "put_output failed with %08x on test %d\n", hr, current_stream_test_index); - VariantClear(&dest); hr = IMXWriter_put_byteOrderMark(writer, test->bom); ok(hr == S_OK, "put_byteOrderMark failed with %08x on test %d\n", hr, current_stream_test_index); @@ -4795,6 +4793,7 @@ ISAXLexicalHandler *lexical; IVBSAXDeclHandler *vbdecl; ISAXDeclHandler *decl; + ISAXDTDHandler *dtd; IMXWriter *writer; VARIANT dest; HRESULT hr; @@ -4993,19 +4992,70 @@ hr = IVBSAXDeclHandler_externalEntityDecl(vbdecl, NULL, NULL, NULL); ok(hr == E_POINTER, "got 0x%08x\n", hr); + hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), 0, NULL, 0, NULL, 0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), -1, NULL, 0, NULL, 0); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), _bstr_("sysid"), strlen("sysid")); ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), NULL, 0, _bstr_("sysid"), strlen("sysid")); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), + NULL, 0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); V_VT(&dest) = VT_EMPTY; hr = IMXWriter_get_output(writer, &dest); ok(hr == S_OK, "got 0x%08x\n", hr); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); - ok(!lstrcmpW(_bstr_("<!ENTITY name PUBLIC \"pubid\" \"sysid\">\r\n"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + ok(!lstrcmpW(_bstr_( + "<!ENTITY name PUBLIC \"pubid\" \"sysid\">\r\n" + "<!ENTITY name SYSTEM \"sysid\">\r\n"), + V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + /* notation declaration */ + hr = IMXWriter_QueryInterface(writer, &IID_ISAXDTDHandler, (void**)&dtd); + ok(hr == S_OK, "got 0x%08x\n", hr); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_put_output(writer, dest); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ISAXDTDHandler_notationDecl(dtd, NULL, 0, NULL, 0, NULL, 0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"), strlen("name"), NULL, 0, NULL, 0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), NULL, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), _bstr_("sysid"), strlen("sysid")); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ISAXDTDHandler_notationDecl(dtd, _bstr_("name"), strlen("name"), NULL, 0, _bstr_("sysid"), strlen("sysid")); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IMXWriter_get_output(writer, &dest); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_( + "<!NOTATION name" + "<!NOTATION name PUBLIC \"pubid\">\r\n" + "<!NOTATION name PUBLIC \"pubid\" \"sysid\">\r\n" + "<!NOTATION name SYSTEM \"sysid\">\r\n"), + V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + + VariantClear(&dest); + + ISAXDTDHandler_Release(dtd); ISAXContentHandler_Release(content); ISAXLexicalHandler_Release(lexical); @@ -5586,7 +5636,7 @@ if(FAILED(hr)) { - skip("Failed to create SAXXMLReader instance\n"); + win_skip("Failed to create SAXXMLReader instance\n"); CoUninitialize(); return; } @@ -5636,7 +5686,7 @@ test_mxattr_dispex(); } else - skip("SAXAttributes not supported\n"); + win_skip("SAXAttributes not supported\n"); CoUninitialize(); } Modified: trunk/rostests/winetests/msxml3/schema.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/schema.c…
============================================================================== --- trunk/rostests/winetests/msxml3/schema.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/schema.c [iso-8859-1] Tue Jun 7 10:30:15 2016 @@ -514,6 +514,7 @@ VARIANT_BOOL b; BSTR str; LONG len; + HRESULT hr; doc = create_document(&IID_IXMLDOMDocument2); if (!doc) @@ -563,6 +564,24 @@ ole_check(IXMLDOMSchemaCollection_remove(cache, NULL)); len = -1; ole_check(IXMLDOMSchemaCollection_get_length(cache, &len)); + ok(len == 0, "got %d\n", len); + + /* same, but with VT_UNKNOWN type */ + V_VT(&v) = VT_UNKNOWN; + V_UNKNOWN(&v) = (IUnknown*)doc; + hr = IXMLDOMSchemaCollection_add(cache, NULL, v); + ok(hr == S_OK, "got 0x%08x\n", hr); + + len = -1; + hr = IXMLDOMSchemaCollection_get_length(cache, &len); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(len == 1, "got %d\n", len); + + hr = IXMLDOMSchemaCollection_remove(cache, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + len = -1; + hr = IXMLDOMSchemaCollection_get_length(cache, &len); + ok(hr == S_OK, "got 0x%08x\n", hr); ok(len == 0, "got %d\n", len); str = SysAllocString(xdr_schema_uri); @@ -1638,6 +1657,24 @@ free_bstrs(); } +static void test_ifaces(void) +{ + IXMLDOMSchemaCollection2 *cache; + IUnknown *unk; + HRESULT hr; + + cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection2); + if (!cache) return; + + /* CLSID_XMLSchemaCache60 is returned as an interface (the same as IXMLDOMSchemaCollection2). */ + hr = IXMLDOMSchemaCollection2_QueryInterface(cache, &CLSID_XMLSchemaCache60, (void**)&unk); + ok (hr == S_OK, "Could not get CLSID_XMLSchemaCache60 iface: %08x\n", hr); + ok (unk == (IUnknown*)cache, "unk != cache\n"); + + IUnknown_Release(unk); + IXMLDOMSchemaCollection2_Release(cache); +} + START_TEST(schema) { HRESULT r; @@ -1655,6 +1692,7 @@ test_dispex(); test_get(); test_remove(); + test_ifaces(); CoUninitialize(); } Modified: trunk/rostests/winetests/msxml3/xmldoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/xmldoc.c…
============================================================================== --- trunk/rostests/winetests/msxml3/xmldoc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msxml3/xmldoc.c [iso-8859-1] Tue Jun 7 10:30:15 2016 @@ -520,7 +520,7 @@ &IID_IXMLDocument, (LPVOID*)&doc); if (FAILED(hr)) { - skip("Failed to create XMLDocument instance\n"); + win_skip("Failed to create XMLDocument instance\n"); return FALSE; }
8 years, 7 months
1
0
0
0
[akhaldi] 71576: [MSXML3] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jun 7 10:29:11 2016 New Revision: 71576 URL:
http://svn.reactos.org/svn/reactos?rev=71576&view=rev
Log: [MSXML3] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/msxml3/msxml_private.h trunk/reactos/dll/win32/msxml3/mxwriter.c trunk/reactos/dll/win32/msxml3/node.c trunk/reactos/dll/win32/msxml3/nodemap.c trunk/reactos/dll/win32/msxml3/saxreader.c trunk/reactos/dll/win32/msxml3/schema.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msxml3/msxml_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/msxml_pri…
============================================================================== --- trunk/reactos/dll/win32/msxml3/msxml_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/msxml_private.h [iso-8859-1] Tue Jun 7 10:29:11 2016 @@ -296,6 +296,8 @@ extern LONG xmldoc_release( xmlDocPtr doc ) DECLSPEC_HIDDEN; extern LONG xmldoc_add_refs( xmlDocPtr doc, LONG refs ) DECLSPEC_HIDDEN; extern LONG xmldoc_release_refs ( xmlDocPtr doc, LONG refs ) DECLSPEC_HIDDEN; +extern void xmlnode_add_ref(xmlNodePtr node) DECLSPEC_HIDDEN; +extern void xmlnode_release(xmlNodePtr node) DECLSPEC_HIDDEN; extern int xmlnode_get_inst_cnt( xmlnode *node ) DECLSPEC_HIDDEN; extern HRESULT xmldoc_add_orphan( xmlDocPtr doc, xmlNodePtr node ) DECLSPEC_HIDDEN; extern HRESULT xmldoc_remove_orphan( xmlDocPtr doc, xmlNodePtr node ) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/msxml3/mxwriter.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/mxwriter.…
============================================================================== --- trunk/reactos/dll/win32/msxml3/mxwriter.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/mxwriter.c [iso-8859-1] Tue Jun 7 10:29:11 2016 @@ -1,7 +1,7 @@ /* * MXWriter implementation * - * Copyright 2011-2014 Nikolay Sivov for CodeWeavers + * Copyright 2011-2014, 2016 Nikolay Sivov for CodeWeavers * Copyright 2011 Thomas Mullaly * * This library is free software; you can redistribute it and/or @@ -27,6 +27,8 @@ static const WCHAR closetagW[] = {'>','\r','\n'}; static const WCHAR crlfW[] = {'\r','\n'}; static const WCHAR entityW[] = {'<','!','E','N','T','I','T','Y',' '}; +static const WCHAR publicW[] = {'P','U','B','L','I','C',' '}; +static const WCHAR systemW[] = {'S','Y','S','T','E','M',' '}; /* should be ordered as encoding names are sorted */ typedef enum @@ -80,13 +82,6 @@ typedef enum { - OutputBuffer_Native = 0x001, - OutputBuffer_Encoded = 0x010, - OutputBuffer_Both = 0x100 -} output_mode; - -typedef enum -{ MXWriter_BOM = 0, MXWriter_DisableEscaping, MXWriter_Indent, @@ -103,6 +98,7 @@ typedef struct { + struct list entry; char *data; unsigned int allocated; unsigned int written; @@ -110,9 +106,10 @@ typedef struct { - encoded_buffer utf16; encoded_buffer encoded; UINT code_page; + UINT utf16_total; /* total number of bytes written since last buffer reinitialization */ + struct list blocks; /* only used when output was not set, for BSTR case */ } output_buffer; typedef struct @@ -151,9 +148,8 @@ BSTR element; IStream *dest; - ULONG dest_written; - - output_buffer *buffer; + + output_buffer buffer; } mxwriter; typedef struct @@ -231,7 +227,7 @@ static HRESULT init_encoded_buffer(encoded_buffer *buffer) { - const int initial_len = 0x2000; + const int initial_len = 0x1000; buffer->data = heap_alloc(initial_len); if (!buffer->data) return E_OUTOFMEMORY; @@ -263,121 +259,202 @@ return S_OK; } -static HRESULT alloc_output_buffer(xml_encoding encoding, output_buffer **buffer) -{ - output_buffer *ret; +static HRESULT init_output_buffer(xml_encoding encoding, output_buffer *buffer) +{ HRESULT hr; - ret = heap_alloc(sizeof(*ret)); - if (!ret) return E_OUTOFMEMORY; - - hr = get_code_page(encoding, &ret->code_page); - if (hr != S_OK) { - heap_free(ret); + hr = get_code_page(encoding, &buffer->code_page); + if (hr != S_OK) return hr; - } - - hr = init_encoded_buffer(&ret->utf16); - if (hr != S_OK) { - heap_free(ret); + + hr = init_encoded_buffer(&buffer->encoded); + if (hr != S_OK) return hr; - } - - /* currently we always create a default output buffer that is UTF-16 only, - but it's possible to allocate with specific encoding too */ - if (encoding != XmlEncoding_UTF16) { - hr = init_encoded_buffer(&ret->encoded); - if (hr != S_OK) { - free_encoded_buffer(&ret->utf16); - heap_free(ret); - return hr; + + list_init(&buffer->blocks); + buffer->utf16_total = 0; + + return S_OK; +} + +static void free_output_buffer(output_buffer *buffer) +{ + encoded_buffer *cur, *cur2; + + free_encoded_buffer(&buffer->encoded); + + LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &buffer->blocks, encoded_buffer, entry) + { + list_remove(&cur->entry); + free_encoded_buffer(cur); + heap_free(cur); + } +} + +static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len) +{ + output_buffer *buffer = &writer->buffer; + encoded_buffer *buff; + unsigned int written; + int src_len; + + if (!len || !*data) + return S_OK; + + src_len = len == -1 ? strlenW(data) : len; + if (writer->dest) + { + buff = &buffer->encoded; + + if (buffer->code_page == ~0) + { + unsigned int avail = buff->allocated - buff->written; + + src_len *= sizeof(WCHAR); + written = min(avail, src_len); + + /* fill internal buffer first */ + if (avail) + { + memcpy(buff->data + buff->written, data, written); + data += written / sizeof(WCHAR); + buff->written += written; + avail -= written; + src_len -= written; + } + + if (!avail) + { + IStream_Write(writer->dest, buff->data, buff->written, &written); + buff->written = 0; + if (src_len >= buff->allocated) + IStream_Write(writer->dest, data, src_len, &written); + else if (src_len) + { + memcpy(buff->data, data, src_len); + buff->written += src_len; + } + } } - } + else + { + unsigned int avail = buff->allocated - buff->written; + int length; + + length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, NULL, 0, NULL, NULL); + if (avail >= length) + { + length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, buff->data + buff->written, length, NULL, NULL); + buff->written += length; + } + else + { + /* drain what we go so far */ + if (buff->written) + { + IStream_Write(writer->dest, buff->data, buff->written, &written); + buff->written = 0; + avail = buff->allocated; + } + + if (avail >= length) + { + length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, buff->data + buff->written, length, NULL, NULL); + buff->written += length; + } + else + { + char *mb; + + /* if current chunk is larger than total buffer size, convert it at once using temporary allocated buffer */ + mb = heap_alloc(length); + if (!mb) + return E_OUTOFMEMORY; + + length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, mb, length, NULL, NULL); + IStream_Write(writer->dest, mb, length, &written); + heap_free(mb); + } + } + } + } + /* When writer has no output set we have to accumulate everything to return it later in a form of BSTR. + To achieve that: + + - fill a buffer already allocated as part of output buffer; + - when current buffer is full, allocate another one and switch to it; buffers themselves never grow, + but are linked together, with head pointing to first allocated buffer after initial one got filled; + - later during get_output() contents are concatenated by copying one after another to destination BSTR buffer, + that's returned to the client. */ else - memset(&ret->encoded, 0, sizeof(ret->encoded)); - - *buffer = ret; - - return S_OK; -} - -static void free_output_buffer(output_buffer *buffer) -{ - free_encoded_buffer(&buffer->encoded); - free_encoded_buffer(&buffer->utf16); - heap_free(buffer); -} - -static void grow_buffer(encoded_buffer *buffer, int length) -{ - /* grow if needed, plus 4 bytes to be sure null terminator will fit in */ - if (buffer->allocated < buffer->written + length + 4) - { - int grown_size = max(2*buffer->allocated, buffer->allocated + length); - buffer->data = heap_realloc(buffer->data, grown_size); - buffer->allocated = grown_size; - } -} - -static HRESULT write_output_buffer_mode(output_buffer *buffer, output_mode mode, const WCHAR *data, int len) -{ - int length; - char *ptr; - - if (mode & (OutputBuffer_Encoded | OutputBuffer_Both)) { - if (buffer->code_page != ~0) + { + /* select last used block */ + if (list_empty(&buffer->blocks)) + buff = &buffer->encoded; + else + buff = LIST_ENTRY(list_tail(&buffer->blocks), encoded_buffer, entry); + + src_len *= sizeof(WCHAR); + while (src_len) { - length = WideCharToMultiByte(buffer->code_page, 0, data, len, NULL, 0, NULL, NULL); - grow_buffer(&buffer->encoded, length); - ptr = buffer->encoded.data + buffer->encoded.written; - length = WideCharToMultiByte(buffer->code_page, 0, data, len, ptr, length, NULL, NULL); - buffer->encoded.written += len == -1 ? length-1 : length; + unsigned int avail = buff->allocated - buff->written; + unsigned int written = min(avail, src_len); + + if (avail) + { + memcpy(buff->data + buff->written, data, written); + buff->written += written; + buffer->utf16_total += written; + src_len -= written; + } + + /* alloc new block if needed and retry */ + if (src_len) + { + encoded_buffer *next = heap_alloc(sizeof(*next)); + HRESULT hr; + + if (FAILED(hr = init_encoded_buffer(next))) { + heap_free(next); + return hr; + } + + list_add_tail(&buffer->blocks, &next->entry); + buff = next; + } } } - if (mode & (OutputBuffer_Native | OutputBuffer_Both)) { - /* WCHAR data just copied */ - length = len == -1 ? strlenW(data) : len; - if (length) - { - length *= sizeof(WCHAR); - - grow_buffer(&buffer->utf16, length); - ptr = buffer->utf16.data + buffer->utf16.written; - - memcpy(ptr, data, length); - buffer->utf16.written += length; - ptr += length; - /* null termination */ - memset(ptr, 0, sizeof(WCHAR)); - } - } - - return S_OK; -} - -static HRESULT write_output_buffer(output_buffer *buffer, const WCHAR *data, int len) -{ - return write_output_buffer_mode(buffer, OutputBuffer_Both, data, len); -} - -static HRESULT write_output_buffer_quoted(output_buffer *buffer, const WCHAR *data, int len) -{ - write_output_buffer(buffer, quotW, 1); - write_output_buffer(buffer, data, len); - write_output_buffer(buffer, quotW, 1); + return S_OK; +} + +static HRESULT write_output_buffer_quoted(mxwriter *writer, const WCHAR *data, int len) +{ + write_output_buffer(writer, quotW, 1); + write_output_buffer(writer, data, len); + write_output_buffer(writer, quotW, 1); return S_OK; } /* frees buffer data, reallocates with a default lengths */ -static void close_output_buffer(mxwriter *This) -{ - heap_free(This->buffer->utf16.data); - heap_free(This->buffer->encoded.data); - init_encoded_buffer(&This->buffer->utf16); - init_encoded_buffer(&This->buffer->encoded); - get_code_page(This->xml_enc, &This->buffer->code_page); +static void close_output_buffer(mxwriter *writer) +{ + encoded_buffer *cur, *cur2; + + heap_free(writer->buffer.encoded.data); + + LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &writer->buffer.blocks, encoded_buffer, entry) + { + list_remove(&cur->entry); + free_encoded_buffer(cur); + heap_free(cur); + } + + init_encoded_buffer(&writer->buffer.encoded); + get_code_page(writer->xml_enc, &writer->buffer.code_page); + writer->buffer.utf16_total = 0; + list_init(&writer->buffer.blocks); } /* Escapes special characters like: @@ -452,7 +529,7 @@ return ret; } -static void write_prolog_buffer(mxwriter *This) +static void write_prolog_buffer(mxwriter *writer) { static const WCHAR versionW[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','='}; static const WCHAR encodingW[] = {' ','e','n','c','o','d','i','n','g','=','\"'}; @@ -461,99 +538,83 @@ static const WCHAR noW[] = {'n','o','\"','?','>'}; /* version */ - write_output_buffer(This->buffer, versionW, sizeof(versionW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, This->version, -1); + write_output_buffer(writer, versionW, sizeof(versionW)/sizeof(WCHAR)); + write_output_buffer_quoted(writer, writer->version, -1); /* encoding */ - write_output_buffer(This->buffer, encodingW, sizeof(encodingW)/sizeof(WCHAR)); - - /* always write UTF-16 to WCHAR buffer */ - write_output_buffer_mode(This->buffer, OutputBuffer_Native, utf16W, sizeof(utf16W)/sizeof(WCHAR) - 1); - write_output_buffer_mode(This->buffer, OutputBuffer_Encoded, This->encoding, -1); - write_output_buffer(This->buffer, quotW, 1); + write_output_buffer(writer, encodingW, sizeof(encodingW)/sizeof(WCHAR)); + + if (writer->dest) + write_output_buffer(writer, writer->encoding, -1); + else + write_output_buffer(writer, utf16W, sizeof(utf16W)/sizeof(WCHAR) - 1); + write_output_buffer(writer, quotW, 1); /* standalone */ - write_output_buffer(This->buffer, standaloneW, sizeof(standaloneW)/sizeof(WCHAR)); - if (This->props[MXWriter_Standalone] == VARIANT_TRUE) - write_output_buffer(This->buffer, yesW, sizeof(yesW)/sizeof(WCHAR)); + write_output_buffer(writer, standaloneW, sizeof(standaloneW)/sizeof(WCHAR)); + if (writer->props[MXWriter_Standalone] == VARIANT_TRUE) + write_output_buffer(writer, yesW, sizeof(yesW)/sizeof(WCHAR)); else - write_output_buffer(This->buffer, noW, sizeof(noW)/sizeof(WCHAR)); - - write_output_buffer(This->buffer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); - This->newline = TRUE; + write_output_buffer(writer, noW, sizeof(noW)/sizeof(WCHAR)); + + write_output_buffer(writer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); + writer->newline = TRUE; } /* Attempts to the write data from the mxwriter's buffer to * the destination stream (if there is one). */ -static HRESULT write_data_to_stream(mxwriter *This) -{ - encoded_buffer *buffer; +static HRESULT write_data_to_stream(mxwriter *writer) +{ + encoded_buffer *buffer = &writer->buffer.encoded; ULONG written = 0; - HRESULT hr; - - if (!This->dest) + + if (!writer->dest) return S_OK; - if (This->xml_enc != XmlEncoding_UTF16) - buffer = &This->buffer->encoded; + if (buffer->written == 0) + { + if (writer->xml_enc == XmlEncoding_UTF8) + IStream_Write(writer->dest, buffer->data, 0, &written); + } else - buffer = &This->buffer->utf16; - - if (This->dest_written > buffer->written) { - ERR("Failed sanity check! Not sure what to do... (%d > %d)\n", This->dest_written, buffer->written); - return E_FAIL; - } else if (This->dest_written == buffer->written && This->xml_enc != XmlEncoding_UTF8) - /* Windows seems to make an empty write call when the encoding is UTF-8 and - * all the data has been written to the stream. It doesn't seem make this call - * for any other encodings. - */ - return S_OK; - - /* Write the current content from the output buffer into 'dest'. - * TODO: Check what Windows does if the IStream doesn't write all of - * the data we give it at once. - */ - hr = IStream_Write(This->dest, buffer->data+This->dest_written, - buffer->written-This->dest_written, &written); - if (FAILED(hr)) { - WARN("Failed to write data to IStream (0x%08x)\n", hr); - return hr; - } - - This->dest_written += written; - return hr; + { + IStream_Write(writer->dest, buffer->data, buffer->written, &written); + buffer->written = 0; + } + + return S_OK; } /* Newly added element start tag left unclosed cause for empty elements we have to close it differently. */ -static void close_element_starttag(const mxwriter *This) +static void close_element_starttag(mxwriter *writer) { static const WCHAR gtW[] = {'>'}; - if (!This->element) return; - write_output_buffer(This->buffer, gtW, 1); -} - -static void write_node_indent(mxwriter *This) + if (!writer->element) return; + write_output_buffer(writer, gtW, 1); +} + +static void write_node_indent(mxwriter *writer) { static const WCHAR tabW[] = {'\t'}; - int indent = This->indent; - - if (!This->props[MXWriter_Indent] || This->text) - { - This->text = FALSE; + int indent = writer->indent; + + if (!writer->props[MXWriter_Indent] || writer->text) + { + writer->text = FALSE; return; } /* This is to workaround PI output logic that always puts newline chars, document prolog PI does that too. */ - if (!This->newline) - write_output_buffer(This->buffer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); + if (!writer->newline) + write_output_buffer(writer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); while (indent--) - write_output_buffer(This->buffer, tabW, 1); - - This->newline = FALSE; - This->text = FALSE; + write_output_buffer(writer, tabW, 1); + + writer->newline = FALSE; + writer->text = FALSE; } static inline void writer_inc_indent(mxwriter *This) @@ -592,7 +653,6 @@ static inline void reset_output_buffer(mxwriter *This) { close_output_buffer(This); - This->dest_written = 0; } static HRESULT writer_set_property(mxwriter *writer, mxwriter_prop property, VARIANT_BOOL value) @@ -754,7 +814,7 @@ { /* Windows flushes the buffer when the interface is destroyed. */ flush_output_buffer(This); - free_output_buffer(This->buffer); + free_output_buffer(&This->buffer); if (This->dest) IStream_Release(This->dest); SysFreeString(This->version); @@ -858,22 +918,43 @@ if (!dest) return E_POINTER; - if (!This->dest) - { - HRESULT hr = flush_output_buffer(This); + if (This->dest) + { + /* we only support IStream output so far */ + V_VT(dest) = VT_UNKNOWN; + V_UNKNOWN(dest) = (IUnknown*)This->dest; + IStream_AddRef(This->dest); + } + else + { + encoded_buffer *buff; + char *dest_ptr; + HRESULT hr; + + hr = flush_output_buffer(This); if (FAILED(hr)) return hr; V_VT(dest) = VT_BSTR; - V_BSTR(dest) = SysAllocString((WCHAR*)This->buffer->utf16.data); - - return S_OK; - } - - /* we only support IStream output so far */ - V_VT(dest) = VT_UNKNOWN; - V_UNKNOWN(dest) = (IUnknown*)This->dest; - IStream_AddRef(This->dest); + V_BSTR(dest) = SysAllocStringLen(NULL, This->buffer.utf16_total / sizeof(WCHAR)); + if (!V_BSTR(dest)) + return E_OUTOFMEMORY; + + dest_ptr = (char*)V_BSTR(dest); + buff = &This->buffer.encoded; + + if (buff->written) + { + memcpy(dest_ptr, buff->data, buff->written); + dest_ptr += buff->written; + } + + LIST_FOR_EACH_ENTRY(buff, &This->buffer.blocks, encoded_buffer, entry) + { + memcpy(dest_ptr, buff->data, buff->written); + dest_ptr += buff->written; + } + } return S_OK; } @@ -1159,18 +1240,18 @@ static const WCHAR eqW[] = {'='}; /* space separator in front of every attribute */ - write_output_buffer(writer->buffer, spaceW, 1); - write_output_buffer(writer->buffer, qname, qname_len); - write_output_buffer(writer->buffer, eqW, 1); + write_output_buffer(writer, spaceW, 1); + write_output_buffer(writer, qname, qname_len); + write_output_buffer(writer, eqW, 1); if (escape) { WCHAR *escaped = get_escaped_string(value, EscapeValue, &value_len); - write_output_buffer_quoted(writer->buffer, escaped, value_len); + write_output_buffer_quoted(writer, escaped, value_len); heap_free(escaped); } else - write_output_buffer_quoted(writer->buffer, value, value_len); + write_output_buffer_quoted(writer, value, value_len); } static void mxwriter_write_starttag(mxwriter *writer, const WCHAR *qname, int len) @@ -1182,8 +1263,8 @@ write_node_indent(writer); - write_output_buffer(writer->buffer, ltW, 1); - write_output_buffer(writer->buffer, qname ? qname : emptyW, qname ? len : 0); + write_output_buffer(writer, ltW, 1); + write_output_buffer(writer, qname ? qname : emptyW, qname ? len : 0); writer_inc_indent(writer); } @@ -1260,7 +1341,7 @@ if (This->element) { static const WCHAR closeW[] = {'/','>'}; - write_output_buffer(This->buffer, closeW, 2); + write_output_buffer(This, closeW, 2); } else { @@ -1268,9 +1349,9 @@ static const WCHAR gtW[] = {'>'}; write_node_indent(This); - write_output_buffer(This->buffer, closetagW, 2); - write_output_buffer(This->buffer, QName, nQName); - write_output_buffer(This->buffer, gtW, 1); + write_output_buffer(This, closetagW, 2); + write_output_buffer(This, QName, nQName); + write_output_buffer(This, gtW, 1); } set_element_name(This, NULL, 0); @@ -1298,14 +1379,14 @@ if (nchars) { if (This->cdata || This->props[MXWriter_DisableEscaping] == VARIANT_TRUE) - write_output_buffer(This->buffer, chars, nchars); + write_output_buffer(This, chars, nchars); else { int len = nchars; WCHAR *escaped; escaped = get_escaped_string(chars, EscapeText, &len); - write_output_buffer(This->buffer, escaped, len); + write_output_buffer(This, escaped, len); heap_free(escaped); } } @@ -1324,7 +1405,7 @@ if (!chars) return E_INVALIDARG; - write_output_buffer(This->buffer, chars, nchars); + write_output_buffer(This, chars, nchars); return S_OK; } @@ -1345,18 +1426,18 @@ if (!target) return E_INVALIDARG; write_node_indent(This); - write_output_buffer(This->buffer, openpiW, sizeof(openpiW)/sizeof(WCHAR)); + write_output_buffer(This, openpiW, sizeof(openpiW)/sizeof(WCHAR)); if (*target) - write_output_buffer(This->buffer, target, ntarget); + write_output_buffer(This, target, ntarget); if (data && *data && ndata) { - write_output_buffer(This->buffer, spaceW, 1); - write_output_buffer(This->buffer, data, ndata); - } - - write_output_buffer(This->buffer, closepiW, sizeof(closepiW)/sizeof(WCHAR)); + write_output_buffer(This, spaceW, 1); + write_output_buffer(This, data, ndata); + } + + write_output_buffer(This, closepiW, sizeof(closepiW)/sizeof(WCHAR)); This->newline = TRUE; return S_OK; @@ -1424,42 +1505,38 @@ if (!name) return E_INVALIDARG; - write_output_buffer(This->buffer, doctypeW, sizeof(doctypeW)/sizeof(WCHAR)); + write_output_buffer(This, doctypeW, sizeof(doctypeW)/sizeof(WCHAR)); if (*name) { - write_output_buffer(This->buffer, name, name_len); - write_output_buffer(This->buffer, spaceW, 1); + write_output_buffer(This, name, name_len); + write_output_buffer(This, spaceW, 1); } if (publicId) { - static const WCHAR publicW[] = {'P','U','B','L','I','C',' '}; - - write_output_buffer(This->buffer, publicW, sizeof(publicW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, publicId, publicId_len); + write_output_buffer(This, publicW, sizeof(publicW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, publicId, publicId_len); if (!systemId) return E_INVALIDARG; if (*publicId) - write_output_buffer(This->buffer, spaceW, 1); - - write_output_buffer_quoted(This->buffer, systemId, systemId_len); + write_output_buffer(This, spaceW, 1); + + write_output_buffer_quoted(This, systemId, systemId_len); if (*systemId) - write_output_buffer(This->buffer, spaceW, 1); + write_output_buffer(This, spaceW, 1); } else if (systemId) { - static const WCHAR systemW[] = {'S','Y','S','T','E','M',' '}; - - write_output_buffer(This->buffer, systemW, sizeof(systemW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, systemId, systemId_len); + write_output_buffer(This, systemW, sizeof(systemW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, systemId, systemId_len); if (*systemId) - write_output_buffer(This->buffer, spaceW, 1); - } - - write_output_buffer(This->buffer, openintW, sizeof(openintW)/sizeof(WCHAR)); + write_output_buffer(This, spaceW, 1); + } + + write_output_buffer(This, openintW, sizeof(openintW)/sizeof(WCHAR)); return S_OK; } @@ -1471,7 +1548,7 @@ TRACE("(%p)\n", This); - write_output_buffer(This->buffer, closedtdW, sizeof(closedtdW)/sizeof(WCHAR)); + write_output_buffer(This, closedtdW, sizeof(closedtdW)/sizeof(WCHAR)); return S_OK; } @@ -1498,7 +1575,7 @@ TRACE("(%p)\n", This); write_node_indent(This); - write_output_buffer(This->buffer, scdataW, sizeof(scdataW)/sizeof(WCHAR)); + write_output_buffer(This, scdataW, sizeof(scdataW)/sizeof(WCHAR)); This->cdata = TRUE; return S_OK; @@ -1511,7 +1588,7 @@ TRACE("(%p)\n", This); - write_output_buffer(This->buffer, ecdataW, sizeof(ecdataW)/sizeof(WCHAR)); + write_output_buffer(This, ecdataW, sizeof(ecdataW)/sizeof(WCHAR)); This->cdata = FALSE; return S_OK; @@ -1530,10 +1607,10 @@ close_element_starttag(This); write_node_indent(This); - write_output_buffer(This->buffer, copenW, sizeof(copenW)/sizeof(WCHAR)); + write_output_buffer(This, copenW, sizeof(copenW)/sizeof(WCHAR)); if (nchars) - write_output_buffer(This->buffer, chars, nchars); - write_output_buffer(This->buffer, ccloseW, sizeof(ccloseW)/sizeof(WCHAR)); + write_output_buffer(This, chars, nchars); + write_output_buffer(This, ccloseW, sizeof(ccloseW)/sizeof(WCHAR)); return S_OK; } @@ -1583,14 +1660,14 @@ if (!name || !model) return E_INVALIDARG; - write_output_buffer(This->buffer, elementW, sizeof(elementW)/sizeof(WCHAR)); + write_output_buffer(This, elementW, sizeof(elementW)/sizeof(WCHAR)); if (n_name) { - write_output_buffer(This->buffer, name, n_name); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, name, n_name); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_model) - write_output_buffer(This->buffer, model, n_model); - write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + write_output_buffer(This, model, n_model); + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); return S_OK; } @@ -1608,31 +1685,31 @@ debugstr_wn(attr, n_attr), n_attr, debugstr_wn(type, n_type), n_type, debugstr_wn(Default, n_default), n_default, debugstr_wn(value, n_value), n_value); - write_output_buffer(This->buffer, attlistW, sizeof(attlistW)/sizeof(WCHAR)); + write_output_buffer(This, attlistW, sizeof(attlistW)/sizeof(WCHAR)); if (n_element) { - write_output_buffer(This->buffer, element, n_element); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, element, n_element); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_attr) { - write_output_buffer(This->buffer, attr, n_attr); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, attr, n_attr); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_type) { - write_output_buffer(This->buffer, type, n_type); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, type, n_type); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_default) { - write_output_buffer(This->buffer, Default, n_default); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, Default, n_default); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_value) - write_output_buffer_quoted(This->buffer, value, n_value); - - write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, value, n_value); + + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); return S_OK; } @@ -1647,16 +1724,16 @@ if (!name || !value) return E_INVALIDARG; - write_output_buffer(This->buffer, entityW, sizeof(entityW)/sizeof(WCHAR)); + write_output_buffer(This, entityW, sizeof(entityW)/sizeof(WCHAR)); if (n_name) { - write_output_buffer(This->buffer, name, n_name); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, name, n_name); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_value) - write_output_buffer_quoted(This->buffer, value, n_value); - - write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, value, n_value); + + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); return S_OK; } @@ -1665,37 +1742,33 @@ const WCHAR *name, int n_name, const WCHAR *publicId, int n_publicId, const WCHAR *systemId, int n_systemId) { - static const WCHAR publicW[] = {'P','U','B','L','I','C',' '}; - static const WCHAR systemW[] = {'S','Y','S','T','E','M',' '}; mxwriter *This = impl_from_ISAXDeclHandler( iface ); TRACE("(%p)->(%s:%d %s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name, debugstr_wn(publicId, n_publicId), n_publicId, debugstr_wn(systemId, n_systemId), n_systemId); - if (!name) return E_INVALIDARG; - if (publicId && !systemId) return E_INVALIDARG; - if (!publicId && !systemId) return E_INVALIDARG; - - write_output_buffer(This->buffer, entityW, sizeof(entityW)/sizeof(WCHAR)); + if (!name || !systemId) return E_INVALIDARG; + + write_output_buffer(This, entityW, sizeof(entityW)/sizeof(WCHAR)); if (n_name) { - write_output_buffer(This->buffer, name, n_name); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, name, n_name); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (publicId) { - write_output_buffer(This->buffer, publicW, sizeof(publicW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, publicId, n_publicId); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, systemId, n_systemId); + write_output_buffer(This, publicW, sizeof(publicW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, publicId, n_publicId); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, systemId, n_systemId); } else { - write_output_buffer(This->buffer, systemW, sizeof(systemW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, systemId, n_systemId); - } - - write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + write_output_buffer(This, systemW, sizeof(systemW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, systemId, n_systemId); + } + + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); return S_OK; } @@ -2194,14 +2267,45 @@ } static HRESULT WINAPI SAXDTDHandler_notationDecl(ISAXDTDHandler *iface, - const WCHAR *name, INT nname, - const WCHAR *publicid, INT npublicid, - const WCHAR *systemid, INT nsystemid) -{ + const WCHAR *name, INT n_name, + const WCHAR *publicid, INT n_publicid, + const WCHAR *systemid, INT n_systemid) +{ + static const WCHAR notationW[] = {'<','!','N','O','T','A','T','I','O','N',' '}; mxwriter *This = impl_from_ISAXDTDHandler( iface ); - FIXME("(%p)->(%s:%d, %s:%d, %s:%d): stub\n", This, debugstr_wn(name, nname), nname, - debugstr_wn(publicid, npublicid), npublicid, debugstr_wn(systemid, nsystemid), nsystemid); - return E_NOTIMPL; + + TRACE("(%p)->(%s:%d, %s:%d, %s:%d)\n", This, debugstr_wn(name, n_name), n_name, + debugstr_wn(publicid, n_publicid), n_publicid, debugstr_wn(systemid, n_systemid), n_systemid); + + if (!name || !n_name) + return E_INVALIDARG; + + write_output_buffer(This, notationW, sizeof(notationW)/sizeof(WCHAR)); + write_output_buffer(This, name, n_name); + + if (!publicid && !systemid) + return E_INVALIDARG; + + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + if (publicid) + { + write_output_buffer(This, publicW, sizeof(publicW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, publicid, n_publicid); + if (systemid) + { + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, systemid, n_systemid); + } + } + else + { + write_output_buffer(This, systemW, sizeof(systemW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, systemid, n_systemid); + } + + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + + return S_OK; } static HRESULT WINAPI SAXDTDHandler_unparsedEntityDecl(ISAXDTDHandler *iface, @@ -2502,9 +2606,8 @@ This->newline = FALSE; This->dest = NULL; - This->dest_written = 0; - - hr = alloc_output_buffer(This->xml_enc, &This->buffer); + + hr = init_output_buffer(This->xml_enc, &This->buffer); if (hr != S_OK) { SysFreeString(This->encoding); SysFreeString(This->version); Modified: trunk/reactos/dll/win32/msxml3/node.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/node.c?re…
============================================================================== --- trunk/reactos/dll/win32/msxml3/node.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/node.c [iso-8859-1] Tue Jun 7 10:29:11 2016 @@ -412,13 +412,13 @@ /* _private field holds a number of COM instances spawned from this libxml2 node * most significant bits are used to store information about ignorrable whitespace nodes */ -static void xmlnode_add_ref(xmlNodePtr node) +void xmlnode_add_ref(xmlNodePtr node) { if (node->type == XML_DOCUMENT_NODE) return; InterlockedIncrement((LONG*)&node->_private); } -static void xmlnode_release(xmlNodePtr node) +void xmlnode_release(xmlNodePtr node) { if (node->type == XML_DOCUMENT_NODE) return; InterlockedDecrement((LONG*)&node->_private); Modified: trunk/reactos/dll/win32/msxml3/nodemap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/nodemap.c…
============================================================================== --- trunk/reactos/dll/win32/msxml3/nodemap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/nodemap.c [iso-8859-1] Tue Jun 7 10:29:11 2016 @@ -120,6 +120,7 @@ TRACE("(%p)->(%d)\n", This, ref); if ( ref == 0 ) { + xmlnode_release( This->node ); xmldoc_release( This->node->doc ); if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant); heap_free( This ); @@ -430,6 +431,7 @@ init_dispex(&This->dispex, (IUnknown*)&This->IXMLDOMNamedNodeMap_iface, &xmlnodemap_dispex); + xmlnode_add_ref(node); xmldoc_add_ref(node->doc); return &This->IXMLDOMNamedNodeMap_iface; Modified: trunk/reactos/dll/win32/msxml3/saxreader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/saxreader…
============================================================================== --- trunk/reactos/dll/win32/msxml3/saxreader.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/saxreader.c [iso-8859-1] Tue Jun 7 10:29:11 2016 @@ -2500,7 +2500,7 @@ if (encoding == XML_CHAR_ENCODING_NONE) { const WCHAR *ptr = (WCHAR*)buffer; - /* xml declaration with possibly specfied encoding will be still handled by parser */ + /* xml declaration with possibly specified encoding will be still handled by parser */ if ((size >= 2) && *ptr == '<' && ptr[1] != '?') { enc_name = (xmlChar*)xmlGetCharEncodingName(XML_CHAR_ENCODING_UTF16LE); Modified: trunk/reactos/dll/win32/msxml3/schema.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/schema.c?…
============================================================================== --- trunk/reactos/dll/win32/msxml3/schema.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/schema.c [iso-8859-1] Tue Jun 7 10:29:11 2016 @@ -789,7 +789,7 @@ static inline schema_cache* impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection* iface) { - return CONTAINING_RECORD(iface, schema_cache, IXMLDOMSchemaCollection2_iface); + return CONTAINING_RECORD((IXMLDOMSchemaCollection2 *)iface, schema_cache, IXMLDOMSchemaCollection2_iface); } static inline schema_cache* unsafe_impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection *iface) @@ -1085,6 +1085,18 @@ { *ppvObject = iface; } + else if(This->version == MSXML6 && IsEqualIID(riid, &CLSID_XMLSchemaCache60)) + { + /* + * Version 6 can be queried for an interface with IID equal to CLSID. + * There is no public interface with that IID and returned pointer + * is equal to returned IXMLDOMSchemaCollection2 iface. We assume + * that it's just another way for querying IXMLDOMSchemaCollection2 + * interface. Office 2013 ClickToRun installer uses this. + */ + WARN("riid CLSID_XMLSchemaCache60, returning IXMLDOMSchemaCollection2 interface.\n"); + *ppvObject = iface; + } else if (dispex_query_interface(&This->dispex, riid, ppvObject)) { return *ppvObject ? S_OK : E_NOINTERFACE; @@ -1206,12 +1218,13 @@ break; case VT_DISPATCH: + case VT_UNKNOWN: { xmlDocPtr doc = NULL; cache_entry* entry; CacheEntryType type; IXMLDOMNode* domnode = NULL; - IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IXMLDOMNode, (void**)&domnode); + IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IXMLDOMNode, (void**)&domnode); if (domnode) doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc; @@ -1255,10 +1268,9 @@ break; default: - { - heap_free(name); - return E_INVALIDARG; - } + FIXME("arg type is not supported, %s\n", debugstr_variant(&var)); + heap_free(name); + return E_INVALIDARG; } heap_free(name); return S_OK; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jun 7 10:29:11 2016 @@ -131,7 +131,7 @@ reactos/dll/win32/msvidc32 # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml # Synced to WineStaging-1.9.4 reactos/dll/win32/msxml2 # Synced to WineStaging-1.9.4 -reactos/dll/win32/msxml3 # Synced to WineStaging-1.9.4 +reactos/dll/win32/msxml3 # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml4 # Synced to WineStaging-1.9.4 reactos/dll/win32/msxml6 # Synced to WineStaging-1.9.4 reactos/dll/win32/nddeapi # Synced to WineStaging-1.9.4
8 years, 7 months
1
0
0
0
[akhaldi] 71575: [MSVIDC32] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jun 7 10:27:20 2016 New Revision: 71575 URL:
http://svn.reactos.org/svn/reactos?rev=71575&view=rev
Log: [MSVIDC32] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/msvidc32/msvideo1.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msvidc32/msvideo1.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvidc32/msvideo…
============================================================================== --- trunk/reactos/dll/win32/msvidc32/msvideo1.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvidc32/msvideo1.c [iso-8859-1] Tue Jun 7 10:27:20 2016 @@ -71,8 +71,13 @@ typedef struct Msvideo1Context { DWORD dwMagic; - BOOL mode_8bit; /* if it's not 8-bit, it's 16-bit */ + int depth; } Msvideo1Context; + +static inline int get_stride(int width, int depth) +{ + return ((depth * width + 31) >> 3) & ~3; +} static void msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_size, @@ -331,8 +336,15 @@ TRACE("out->bpp = %d\n", out->bmiHeader.biBitCount ); TRACE("out->height = %d\n", out->bmiHeader.biHeight ); TRACE("out->width = %d\n", out->bmiHeader.biWidth ); - if(( in->bmiHeader.biBitCount != out->bmiHeader.biBitCount ) || - ( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes ) || + + if ((in->bmiHeader.biBitCount != out->bmiHeader.biBitCount) && + (in->bmiHeader.biBitCount != 16 || out->bmiHeader.biBitCount != 24)) + { + TRACE("incompatible depth requested\n"); + return ICERR_BADFORMAT; + } + + if(( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes ) || ( in->bmiHeader.biHeight != out->bmiHeader.biHeight ) || ( in->bmiHeader.biWidth != out->bmiHeader.biWidth )) { @@ -359,12 +371,17 @@ if (in->bmiHeader.biBitCount <= 8) size += in->bmiHeader.biClrUsed * sizeof(RGBQUAD); + if (in->bmiHeader.biBitCount != 8 && in->bmiHeader.biBitCount != 16) + return ICERR_BADFORMAT; + if( out ) { memcpy( out, in, size ); + out->bmiHeader.biWidth = in->bmiHeader.biWidth & ~1; + out->bmiHeader.biHeight = in->bmiHeader.biHeight & ~1; out->bmiHeader.biCompression = BI_RGB; - out->bmiHeader.biSizeImage = in->bmiHeader.biHeight - * in->bmiHeader.biWidth *4; + out->bmiHeader.biSizeImage = in->bmiHeader.biHeight * + get_stride(out->bmiHeader.biWidth, out->bmiHeader.biBitCount); return ICERR_OK; } @@ -380,21 +397,56 @@ TRACE("bitmap is %d bpp\n", in->bmiHeader.biBitCount); if( in->bmiHeader.biBitCount == 8 ) - info->mode_8bit = TRUE; + info->depth = 8; else if( in->bmiHeader.biBitCount == 16 ) - info->mode_8bit = FALSE; + info->depth = 16; else { - info->mode_8bit = FALSE; + info->depth = 0; FIXME("Unsupported output format %i\n", in->bmiHeader.biBitCount); } return ICERR_OK; } +static void convert_depth(char *input, int depth_in, char *output, BITMAPINFOHEADER *out_hdr) +{ + int x, y; + int stride_in = get_stride(out_hdr->biWidth, depth_in); + int stride_out = get_stride(out_hdr->biWidth, out_hdr->biBitCount); + + if (depth_in == 16 && out_hdr->biBitCount == 24) + { + static const unsigned char convert_5to8[] = + { + 0x00, 0x08, 0x10, 0x19, 0x21, 0x29, 0x31, 0x3a, + 0x42, 0x4a, 0x52, 0x5a, 0x63, 0x6b, 0x73, 0x7b, + 0x84, 0x8c, 0x94, 0x9c, 0xa5, 0xad, 0xb5, 0xbd, + 0xc5, 0xce, 0xd6, 0xde, 0xe6, 0xef, 0xf7, 0xff, + }; + + for (y = 0; y < out_hdr->biHeight; y++) + { + WORD *src_row = (WORD *)(input + y * stride_in); + char *out_row = output + y * stride_out; + + for (x = 0; x < out_hdr->biWidth; x++) + { + WORD pixel = *src_row++; + *out_row++ = convert_5to8[(pixel & 0x7c00u) >> 10]; + *out_row++ = convert_5to8[(pixel & 0x03e0u) >> 5]; + *out_row++ = convert_5to8[(pixel & 0x001fu)]; + } + } + } + else + FIXME("Conversion from %d to %d bit unimplemented\n", depth_in, out_hdr->biBitCount); +} + static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD size ) { LONG width, height, stride, sz; + void *output; TRACE("ICM_DECOMPRESS %p %p %d\n", info, icd, size); @@ -405,18 +457,33 @@ width = icd->lpbiInput->biWidth; height = icd->lpbiInput->biHeight; - stride = width; /* in bytes or 16bit words */ sz = icd->lpbiInput->biSizeImage; - if (info->mode_8bit) - { + output = icd->lpOutput; + + if (icd->lpbiOutput->biBitCount != info->depth) + { + output = HeapAlloc(GetProcessHeap(), 0, icd->lpbiOutput->biWidth * icd->lpbiOutput->biHeight * info->depth / 8); + if (!output) return ICERR_MEMORY; + } + + if (info->depth == 8) + { + stride = get_stride(width, 8); msvideo1_decode_8bit( width, height, icd->lpInput, sz, - icd->lpOutput, stride); + output, stride ); } else { + stride = get_stride(width, 16) / 2; msvideo1_decode_16bit( width, height, icd->lpInput, sz, - icd->lpOutput, stride); + output, stride ); + } + + if (icd->lpbiOutput->biBitCount != info->depth) + { + convert_depth(output, info->depth, icd->lpOutput, icd->lpbiOutput); + HeapFree(GetProcessHeap(), 0, output); } return ICERR_OK; @@ -425,6 +492,7 @@ static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DWORD size ) { LONG width, height, stride, sz; + void *output; TRACE("ICM_DECOMPRESSEX %p %p %d\n", info, icd, size); @@ -435,18 +503,33 @@ width = icd->lpbiSrc->biWidth; height = icd->lpbiSrc->biHeight; - stride = width; sz = icd->lpbiSrc->biSizeImage; - if (info->mode_8bit) - { + output = icd->lpDst; + + if (icd->lpbiDst->biBitCount != info->depth) + { + output = HeapAlloc(GetProcessHeap(), 0, icd->lpbiDst->biWidth * icd->lpbiDst->biHeight * info->depth / 8); + if (!output) return ICERR_MEMORY; + } + + if (info->depth == 8) + { + stride = get_stride(width, 8); msvideo1_decode_8bit( width, height, icd->lpSrc, sz, - icd->lpDst, stride); + output, stride ); } else { + stride = get_stride(width, 16) / 2; msvideo1_decode_16bit( width, height, icd->lpSrc, sz, - icd->lpDst, stride); + output, stride ); + } + + if (icd->lpbiDst->biBitCount != info->depth) + { + convert_depth(output, info->depth, icd->lpDst, icd->lpbiDst); + HeapFree(GetProcessHeap(), 0, output); } return ICERR_OK; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jun 7 10:27:20 2016 @@ -128,7 +128,7 @@ reactos/dll/win32/msvcrt20 # Out of sync reactos/dll/win32/msvcrt40 # Out of sync reactos/dll/win32/msvfw32 # Synced to WineStaging-1.9.11 -reactos/dll/win32/msvidc32 # Synced to WineStaging-1.9.4 +reactos/dll/win32/msvidc32 # Synced to WineStaging-1.9.11 reactos/dll/win32/msxml # Synced to WineStaging-1.9.4 reactos/dll/win32/msxml2 # Synced to WineStaging-1.9.4 reactos/dll/win32/msxml3 # Synced to WineStaging-1.9.4
8 years, 7 months
1
0
0
0
[akhaldi] 71574: [MSVFW32] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jun 7 10:26:22 2016 New Revision: 71574 URL:
http://svn.reactos.org/svn/reactos?rev=71574&view=rev
Log: [MSVFW32] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/msvfw32/msvideo_main.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msvfw32/msvideo_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvfw32/msvideo_…
============================================================================== --- trunk/reactos/dll/win32/msvfw32/msvideo_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvfw32/msvideo_main.c [iso-8859-1] Tue Jun 7 10:26:22 2016 @@ -88,6 +88,11 @@ } #undef XX return str; +} + +static inline int get_stride(int width, int depth) +{ + return ((depth * width + 31) >> 3) & ~3; } static WINE_HIC* MSVIDEO_FirstHic /* = NULL */; @@ -442,7 +447,7 @@ local = ICOpen(fccType, info.fccHandler, wMode); if (local != 0) { - TRACE("Returning %s as defult handler for %s\n", + TRACE("Returning %s as default handler for %s\n", wine_dbgstr_fcc(info.fccHandler), wine_dbgstr_fcc(fccType)); return local; } @@ -711,23 +716,84 @@ HIC hic,LPBITMAPINFOHEADER lpbiIn,LPBITMAPINFOHEADER lpbiOut, INT depth,INT dx,INT dy) { - HIC tmphic = hic; - - TRACE("(%p,%p,%p,%d,%d,%d)!\n",hic,lpbiIn,lpbiOut,depth,dx,dy); - - if (!tmphic) { - tmphic=ICLocate(ICTYPE_VIDEO,0,lpbiIn,NULL,ICMODE_DECOMPRESS); - if (!tmphic) - return tmphic; - } - if ((dy == lpbiIn->biHeight) && (dx == lpbiIn->biWidth)) - dy = dx = 0; /* no resize needed */ + static const struct + { + int depth; + int compression; + } + try_depths[] = + { + { 8, BI_RGB}, + {16, BI_RGB}, + {16, BI_BITFIELDS}, + {24, BI_RGB}, + {32, BI_RGB}, + }; + + int screen_depth, i; + BOOL found = FALSE; + HIC tmphic; + HDC hdc; + + TRACE("(%p,%p,%p,%d,%d,%d)!\n", hic, lpbiIn, lpbiOut, depth, dx, dy); + + tmphic = hic ? hic : ICLocate(ICTYPE_VIDEO, 0, lpbiIn, NULL, ICMODE_DECOMPRESS); + if (!tmphic) return tmphic; + + hdc = GetDC(0); + screen_depth = GetDeviceCaps(hdc, BITSPIXEL) * GetDeviceCaps(hdc, PLANES); + ReleaseDC(0, hdc); + + if (dx <= 0) dx = lpbiIn->biWidth; + if (dy <= 0) dy = lpbiIn->biHeight; + if (!depth) depth = screen_depth; /* Can we decompress it ? */ - if (ICDecompressQuery(tmphic,lpbiIn,NULL) != 0) + if (ICDecompressQuery(tmphic, lpbiIn, NULL) != ICERR_OK) goto errout; /* no, sorry */ ICSendMessage(tmphic, ICM_DECOMPRESS_GET_FORMAT, (DWORD_PTR)lpbiIn, (DWORD_PTR)lpbiOut); + + lpbiOut->biSize = sizeof(BITMAPINFOHEADER); + lpbiOut->biWidth = dx; + lpbiOut->biHeight = dy; + lpbiOut->biPlanes = 1; + + for (i = 0; i < sizeof(try_depths) / sizeof(try_depths[0]); i++) + { + if (!found && try_depths[i].depth != depth) + continue; + + found = TRUE; + lpbiOut->biBitCount = try_depths[i].depth; + lpbiOut->biCompression = try_depths[i].compression; + lpbiOut->biSizeImage = dx * get_stride(dy, lpbiOut->biBitCount); + + if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) + { + if (try_depths[i].depth == 8) + ICDecompressGetPalette(tmphic, lpbiIn, lpbiOut); + goto success; + } + } + + if (!found) + { + lpbiOut->biBitCount = depth; + lpbiOut->biCompression = BI_RGB; + lpbiOut->biSizeImage = dx * get_stride(dy, lpbiOut->biBitCount); + if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) + goto success; + + lpbiOut->biBitCount = screen_depth; + lpbiOut->biCompression = BI_RGB; + lpbiOut->biSizeImage = dx * get_stride(dy, lpbiOut->biBitCount); + if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) + goto success; + } + + if (ICSendMessage(tmphic, ICM_DECOMPRESS_GET_FORMAT, (DWORD_PTR)lpbiIn, (DWORD_PTR)lpbiOut)) + goto errout; if (lpbiOut->biCompression != 0) { FIXME("Ooch, how come decompressor outputs compressed data (%d)??\n", @@ -738,20 +804,11 @@ lpbiOut->biSize); lpbiOut->biSize = sizeof(*lpbiOut); } - if (!depth) { - HDC hdc; - - hdc = GetDC(0); - depth = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES); - ReleaseDC(0,hdc); - if (depth==15) depth = 16; - if (depth<8) depth = 8; - } - if (lpbiIn->biBitCount == 8) - depth = 8; - + +success: TRACE("=> %p\n", tmphic); return tmphic; + errout: if (hic!=tmphic) ICClose(tmphic); Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jun 7 10:26:22 2016 @@ -127,7 +127,7 @@ reactos/dll/win32/mstask # Synced to WineStaging-1.9.4 reactos/dll/win32/msvcrt20 # Out of sync reactos/dll/win32/msvcrt40 # Out of sync -reactos/dll/win32/msvfw32 # Synced to WineStaging-1.9.4 +reactos/dll/win32/msvfw32 # Synced to WineStaging-1.9.11 reactos/dll/win32/msvidc32 # Synced to WineStaging-1.9.4 reactos/dll/win32/msxml # Synced to WineStaging-1.9.4 reactos/dll/win32/msxml2 # Synced to WineStaging-1.9.4
8 years, 7 months
1
0
0
0
[akhaldi] 71573: [MSRLE32] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Jun 7 10:24:56 2016 New Revision: 71573 URL:
http://svn.reactos.org/svn/reactos?rev=71573&view=rev
Log: [MSRLE32] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/msrle32/msrle32.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msrle32/msrle32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msrle32/msrle32.…
============================================================================== --- trunk/reactos/dll/win32/msrle32/msrle32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msrle32/msrle32.c [iso-8859-1] Tue Jun 7 10:24:56 2016 @@ -1567,8 +1567,16 @@ size = lpbiIn->biSize; - if (lpbiIn->biBitCount <= 8) - size += lpbiIn->biClrUsed * sizeof(RGBQUAD); + if (lpbiIn->biBitCount <= 8) { + int colors; + + if (lpbiIn->biClrUsed == 0) + colors = 1 << lpbiIn->biBitCount; + else + colors = lpbiIn->biClrUsed; + + size += colors * sizeof(RGBQUAD); + } if (lpbiOut != NULL) { memcpy(lpbiOut, lpbiIn, size); @@ -1647,27 +1655,33 @@ if (lpbiIn->biCompression != BI_RGB) { + int colors; + + if (lpbiIn->biBitCount <= 8 && lpbiIn->biClrUsed == 0) + colors = 1 << lpbiIn->biBitCount; + else + colors = lpbiIn->biClrUsed; + rgbIn = (const RGBQUAD*)((const BYTE*)lpbiIn + lpbiIn->biSize); rgbOut = (const RGBQUAD*)((const BYTE*)lpbiOut + lpbiOut->biSize); switch (lpbiOut->biBitCount) { case 4: case 8: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed); + pi->palette_map = LocalAlloc(LPTR, colors); if (pi->palette_map == NULL) return ICERR_MEMORY; - for (i = 0; i < lpbiIn->biClrUsed; i++) { - pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(lpbiOut->biClrUsed, rgbOut, rgbIn[i]); - } + for (i = 0; i < colors; i++) + pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(colors, rgbOut, rgbIn[i]); break; case 15: case 16: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2); + pi->palette_map = LocalAlloc(LPTR, colors * 2); if (pi->palette_map == NULL) return ICERR_MEMORY; - for (i = 0; i < lpbiIn->biClrUsed; i++) { + for (i = 0; i < colors; i++) { WORD color; if (lpbiOut->biBitCount == 15) @@ -1683,10 +1697,10 @@ break; case 24: case 32: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * sizeof(RGBQUAD)); + pi->palette_map = LocalAlloc(LPTR, colors * sizeof(RGBQUAD)); if (pi->palette_map == NULL) return ICERR_MEMORY; - memcpy(pi->palette_map, rgbIn, lpbiIn->biClrUsed * sizeof(RGBQUAD)); + memcpy(pi->palette_map, rgbIn, colors * sizeof(RGBQUAD)); break; }; } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jun 7 10:24:56 2016 @@ -121,7 +121,7 @@ reactos/dll/win32/msisys.ocx # Synced to WineStaging-1.9.4 reactos/dll/win32/msnet32 # Synced to WineStaging-1.9.4 reactos/dll/win32/mspatcha # Synced to WineStaging-1.9.4 -reactos/dll/win32/msrle32 # Synced to WineStaging-1.9.4 +reactos/dll/win32/msrle32 # Synced to WineStaging-1.9.11 reactos/dll/win32/mssign32 # Synced to WineStaging-1.9.4 reactos/dll/win32/mssip32 # Synced to WineStaging-1.9.4 reactos/dll/win32/mstask # Synced to WineStaging-1.9.4
8 years, 7 months
1
0
0
0
[mjansen] 71572: [APPHELP_APITEST] Extend stringtable related tests. CORE-10367
by mjansen@svn.reactos.org
Author: mjansen Date: Sun Jun 5 21:26:07 2016 New Revision: 71572 URL:
http://svn.reactos.org/svn/reactos?rev=71572&view=rev
Log: [APPHELP_APITEST] Extend stringtable related tests. CORE-10367 Modified: trunk/rostests/apitests/apphelp/db.c Modified: trunk/rostests/apitests/apphelp/db.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apphelp/db.c?rev…
============================================================================== --- trunk/rostests/apitests/apphelp/db.c [iso-8859-1] (original) +++ trunk/rostests/apitests/apphelp/db.c [iso-8859-1] Sun Jun 5 21:26:07 2016 @@ -315,6 +315,7 @@ /* - Show that a stringtable is automatically generated, + - Show that entries in the stringtable are re-used, - validate multiple lists (for the length) */ static void test_write_ex(void) @@ -327,6 +328,7 @@ TAG tag; DWORD size; BOOL ret; + LPWSTR ptr; /* Write a small database */ pdb = pSdbCreateDatabase(path1, DOS_PATH); @@ -336,12 +338,14 @@ tagdb = pSdbBeginWriteListTag(pdb, TAG_DATABASE); ok(tagdb == 12, "Expected tag to be 12, was %u\n", tagdb); ret = pSdbWriteStringTag(pdb, TAG_NAME, test1); + ret = pSdbWriteStringTag(pdb, TAG_NAME, test2); ok(ret, "Expected SdbWriteStringTag to succeed\n"); ret = pSdbEndWriteListTag(pdb, tagdb); ok(ret, "Expected SdbEndWriteListTag to succeed\n"); tagdb = pSdbBeginWriteListTag(pdb, TAG_DATABASE); - ok(tagdb == 24, "Expected tag to be 24, was %u\n", tagdb); + ok(tagdb == 30, "Expected tag to be 24, was %u\n", tagdb); + ret = pSdbWriteStringTag(pdb, TAG_NAME, test1); ret = pSdbWriteStringTag(pdb, TAG_NAME, test2); ok(ret, "Expected SdbWriteStringTag to succeed\n"); ret = pSdbEndWriteListTag(pdb, tagdb); @@ -354,10 +358,12 @@ ok(pdb != NULL, "Expected a valid database\n"); if (!pdb) return; + tagdb = pSdbFindFirstTag(pdb, TAGID_ROOT, TAG_DATABASE); ok(tagdb == 12, "Expected tag to be 12, was %u\n", tagdb); size = pSdbGetTagDataSize(pdb, tagdb); - ok(size == 6, "Expected size to be 6, was %u\n", size); + ok(size == 12, "Expected size to be 12, was %u\n", size); + tagstr = pSdbFindFirstTag(pdb, tagdb, TAG_NAME); ok(tagstr == 18, "Expected string tag to be 18, was %u\n", tagstr); tag = pSdbGetTagFromTagID(pdb, tagstr); @@ -365,38 +371,160 @@ size = pSdbGetTagDataSize(pdb, tagstr); ok(size == 4, "Expected size to be 4, was 0x%x\n", size); + tagstr = pSdbFindNextTag(pdb, tagdb, tagstr); + ok(tagstr == 24, "Expected string tag to be 24, was %u\n", tagstr); + tag = pSdbGetTagFromTagID(pdb, tagstr); + ok(tag == TAG_NAME, "Expected tag to be TAG_NAME, was 0x%x\n", (DWORD)tag); + size = pSdbGetTagDataSize(pdb, tagstr); + ok(size == 4, "Expected size to be 4, was 0x%x\n", size); + tagdb = pSdbFindNextTag(pdb, TAGID_ROOT, tagdb); - ok(tagdb == 24, "Expected tag to be 24, was %u\n", tagdb); + ok(tagdb == 30, "Expected tag to be 30, was %u\n", tagdb); size = pSdbGetTagDataSize(pdb, tagdb); - ok(size == 6, "Expected size to be 6, was %u\n", size); + ok(size == 12, "Expected size to be 12, was %u\n", size); + tagstr = pSdbFindFirstTag(pdb, tagdb, TAG_NAME); - ok(tagstr == 30, "Expected string tag to be 30, was %u\n", tagstr); + ok(tagstr == 36, "Expected string tag to be 36, was %u\n", tagstr); tag = pSdbGetTagFromTagID(pdb, tagstr); ok(tag == TAG_NAME, "Expected tag to be TAG_NAME, was 0x%x\n", (DWORD)tag); size = pSdbGetTagDataSize(pdb, tagstr); ok(size == 4, "Expected size to be 4, was %u\n", size); + tagstr = pSdbFindNextTag(pdb, tagdb, tagstr); + ok(tagstr == 42, "Expected string tag to be 42, was %u\n", tagstr); + tag = pSdbGetTagFromTagID(pdb, tagstr); + ok(tag == TAG_NAME, "Expected tag to be TAG_NAME, was 0x%x\n", (DWORD)tag); + size = pSdbGetTagDataSize(pdb, tagstr); + ok(size == 4, "Expected size to be 4, was 0x%x\n", size); + tagdb = pSdbFindFirstTag(pdb, TAGID_ROOT, TAG_STRINGTABLE); - ok(tagdb == 36, "Expected tag to be 36, was %u\n", tagdb); + ok(tagdb == 48, "Expected tag to be 48, was %u\n", tagdb); size = pSdbGetTagDataSize(pdb, tagdb); ok(size == 32, "Expected size to be 32, was %u\n", size); + tagstr = pSdbGetFirstChild(pdb, tagdb); - ok(tagstr == 42, "Expected string tag to be 42, was %u\n", tagstr); + ok(tagstr == 54, "Expected string tag to be 54, was %u\n", tagstr); tag = pSdbGetTagFromTagID(pdb, tagstr); ok(tag == TAG_STRINGTABLE_ITEM, "Expected tag to be TAG_STRINGTABLE_ITEM, was 0x%x\n", (DWORD)tag); size = pSdbGetTagDataSize(pdb, tagstr); ok(size == 10, "Expected size to be 10, was %u\n", size); + ptr = pSdbGetStringTagPtr(pdb, tagstr); + ok(ptr != NULL, "Expected a valid pointer\n"); + if (ptr) + ok(!wcscmp(ptr, test1), "Expected ptr to be %s, was %s\n", wine_dbgstr_w(test1), wine_dbgstr_w(ptr)); tagstr = pSdbGetNextChild(pdb, tagdb, tagstr); - ok(tagstr == 58, "Expected string tag to be 58, was %u\n", tagstr); + ok(tagstr == 70, "Expected string tag to be 70, was %u\n", tagstr); tag = pSdbGetTagFromTagID(pdb, tagstr); ok(tag == TAG_STRINGTABLE_ITEM, "Expected tag to be TAG_STRINGTABLE_ITEM, was 0x%x\n", (DWORD)tag); size = pSdbGetTagDataSize(pdb, tagstr); ok(size == 10, "Expected size to be 10, was %u\n", size); + ptr = pSdbGetStringTagPtr(pdb, tagstr); + ok(ptr != NULL, "Expected a valid pointer\n"); + if (ptr) + ok(!wcscmp(ptr, test2), "Expected ptr to be %s, was %s\n", wine_dbgstr_w(test2), wine_dbgstr_w(ptr)); pSdbCloseDatabase(pdb); } + +static void write_db_strings(const WCHAR* name, const WCHAR* data[], size_t count) +{ + PDB pdb; + size_t n; + BOOL ret; + + pdb = pSdbCreateDatabase(name, DOS_PATH); + ok(pdb != NULL, "Failed to create db for case %u\n", count); + for (n = 0; n < count; ++n) + { + ret = pSdbWriteStringTag(pdb, TAG_NAME, data[n]); + ok(ret, "Failed to write string %u/%u\n", n, count); + } + pSdbCloseDatabaseWrite(pdb); +} + +static void test_stringtable() +{ + static const WCHAR path1[] = {'t','e','s','t','.','s','d','b',0}; + static const WCHAR test1[] = {'t','e','s','t','1',0}; + static const WCHAR test2[] = {'T','e','s','t','1',0}; + static const WCHAR test3[] = {'T','E','s','t','1',0}; + static const WCHAR test4[] = {'T','E','S','T','1',0}; + static const WCHAR test5[] = {'T','E','S','T','2',0}; + static const WCHAR lipsum[] = {'L','o','r','e','m',' ','i','p','s','u','m',' ','d','o','l','o','r',' ','s','i','t',' ','a','m','e','t',',',' ','c','o','n','s','e','c','t','e','t','u','r',' ','a','d','i','p','i','s','c','i','n','g',' ','e','l','i','t','.',' ','N','u','l','l','a',' ','a','n','t','e',' ','r','i','s','u','s',',',' ','m','a','l','e','s','u','a','d','a',' ','s','e','d',' ','i','a','c','u','l','i','s',' ','l','u','c','t','u','s',',',' ','o','r','n','a','r','e',' ','p','u','l','v','i','n','a','r',' ','v','e','l','i','t','.',' ','L','o','r','e','m',' ','i','p','s','u','m',' ','d','o','l','o','r',' ','s','i','t',' ','a','m','e','t',',',' ','c','o','n','s','e','c','t','e','t','u','r',' ','a','d','i','p','i','s','c','i','n','g',' ','e','l','i','t','.',' ','I','n','t','e','g','e','r',' ','q','u','i','s',' ','f','e','l','i','s',' ','u','t',' ','l','e','o',' ','e','l','e','i','f','e','n','d',' ','u','l','t','r','i','c','e','s',' ','f','i','n','i','b','u','s',' ','e','u',' ','d','o','l','o','r','.',' ','I','n',' ','b','i','b','e','n','d','u','m',',',' ','e','r','o','s',' ','e','u',' ','f','a','u','c','i','b','u','s',' ','c','o','n','s','e','q','u','a','t',',',' ','n','i','s','i',' ','m','a','g','n','a',' ','v','e','n','e','n','a','t','i','s',' ','j','u','s','t','o',',',' ','a','t',' ','t','r','i','s','t','i','q','u','e',' ','m','e','t','u','s',' ','d','o','l','o','r',' ','u','t',' ','r','i','s','u','s','.',' ','N','u','n','c',' ','e','u',' ','o','d','i','o',' ','d','i','g','n','i','s','s','i','m',',',' ','o','r','n','a','r','e',' ','a','n','t','e',' ','g','r','a','v','i','d','a',',',' ','l','o','b','o','r','t','i','s',' ','e','r','o','s','.',' ','C','r','a','s',' ','s','e','m',' ','e','x',',',' ','c','o','n','s','e','c','t','e','t','u','r',' ','p','u','l','v','i','n','a','r',' ','t','i','n','c','i','d','u','n','t',' ','e','u',',',' ','c','o','n','g','u','e',' ','a',' ','e','r','o','s','.',' ','C','u','r','a','b','i','t','u','r',' ','e','r','o','s',' ','e','r','a','t',',',' ','p','e','l','l','e','n','t','e','s','q','u','e',' ','e','t',' ','n','i','b','h',' ','q','u','i','s',',',' ','i','n','t','e','r','d','u','m',' ','t','e','m','p','o','r',' ','o','d','i','o','.',' ','E','t','i','a','m',' ','s','a','p','i','e','n',' ','s','a','p','i','e','n',',',' ','a','l','i','q','u','a','m',' ','u','t',' ','a','l','i','q','u','a','m',' ','a','t',',',' ','s','a','g','i','t','t','i','s',' ','e','u',' ','m','a','g','n','a','.',' ','M','a','e','c','e','n','a','s',' ','m','a','g','n','a',' ','m','a','g','n','a',',',' ','s','u','s','c','i','p','i','t',' ','u','t',' ','l','o','r','e','m',' ','u','t',',',' ','v','a','r','i','u','s',' ','p','r','e','t','i','u','m',' ','f','e','l','i','s','.',' ','I','n','t','e','g','e','r',' ','t','i','n','c','i','d','u','n','t',',',' ','m','e','t','u','s',' ','v','e','l',' ','s','o','l','l','i','c','i','t','u','d','i','n',' ','f','i','n','i','b','u','s',',',' ','f','e','l','i','s',' ','e','r','a','t',' ','m','o','l','e','s','t','i','e',' ','u','r','n','a',',',' ','a',' ','c','o','n','d','i','m','e','n','t','u','m',' ','a','u','g','u','e',' ','a','r','c','u',' ','v','i','t','a','e',' ','r','i','s','u','s','.',' ','E','t','i','a','m',' ','i','d',' ','s','a','g','i','t','t','i','s',' ','q','u','a','m','.',' ','M','o','r','b','i',' ','a',' ','u','l','t','r','i','c','i','e','s',' ','n','u','n','c','.',' ','P','h','a','s','e','l','l','u','s',' ','e','r','o','s',' ','r','i','s','u','s',',',' ','c','u','r','s','u','s',' ','u','l','l','a','m','c','o','r','p','e','r',' ','m','a','s','s','a',' ','s','e','d',',',' ','d','i','g','n','i','s','s','i','m',' ','c','o','n','s','e','q','u','a','t',' ','l','i','g','u','l','a','.',' ','A','l','i','q','u','a','m',' ','t','u','r','p','i','s',' ','a','r','c','u',',',' ','a','c','c','u','m','s','a','n',' ','q','u','i','s',' ','s','a','p','i','e','n',' ','v','i','t','a','e',',',' ','l','a','c','i','n','i','a',' ','e','u','i','s','m','o','d',' ','n','i','s','l','.',' ','M','a','u','r','i','s',' ','i','d',' ','f','e','l','i','s',' ','s','e','m','.',0}; + /* Last char changed from '.' to '!' */ + static const WCHAR lipsum2[] = {'L','o','r','e','m',' ','i','p','s','u','m',' ','d','o','l','o','r',' ','s','i','t',' ','a','m','e','t',',',' ','c','o','n','s','e','c','t','e','t','u','r',' ','a','d','i','p','i','s','c','i','n','g',' ','e','l','i','t','.',' ','N','u','l','l','a',' ','a','n','t','e',' ','r','i','s','u','s',',',' ','m','a','l','e','s','u','a','d','a',' ','s','e','d',' ','i','a','c','u','l','i','s',' ','l','u','c','t','u','s',',',' ','o','r','n','a','r','e',' ','p','u','l','v','i','n','a','r',' ','v','e','l','i','t','.',' ','L','o','r','e','m',' ','i','p','s','u','m',' ','d','o','l','o','r',' ','s','i','t',' ','a','m','e','t',',',' ','c','o','n','s','e','c','t','e','t','u','r',' ','a','d','i','p','i','s','c','i','n','g',' ','e','l','i','t','.',' ','I','n','t','e','g','e','r',' ','q','u','i','s',' ','f','e','l','i','s',' ','u','t',' ','l','e','o',' ','e','l','e','i','f','e','n','d',' ','u','l','t','r','i','c','e','s',' ','f','i','n','i','b','u','s',' ','e','u',' ','d','o','l','o','r','.',' ','I','n',' ','b','i','b','e','n','d','u','m',',',' ','e','r','o','s',' ','e','u',' ','f','a','u','c','i','b','u','s',' ','c','o','n','s','e','q','u','a','t',',',' ','n','i','s','i',' ','m','a','g','n','a',' ','v','e','n','e','n','a','t','i','s',' ','j','u','s','t','o',',',' ','a','t',' ','t','r','i','s','t','i','q','u','e',' ','m','e','t','u','s',' ','d','o','l','o','r',' ','u','t',' ','r','i','s','u','s','.',' ','N','u','n','c',' ','e','u',' ','o','d','i','o',' ','d','i','g','n','i','s','s','i','m',',',' ','o','r','n','a','r','e',' ','a','n','t','e',' ','g','r','a','v','i','d','a',',',' ','l','o','b','o','r','t','i','s',' ','e','r','o','s','.',' ','C','r','a','s',' ','s','e','m',' ','e','x',',',' ','c','o','n','s','e','c','t','e','t','u','r',' ','p','u','l','v','i','n','a','r',' ','t','i','n','c','i','d','u','n','t',' ','e','u',',',' ','c','o','n','g','u','e',' ','a',' ','e','r','o','s','.',' ','C','u','r','a','b','i','t','u','r',' ','e','r','o','s',' ','e','r','a','t',',',' ','p','e','l','l','e','n','t','e','s','q','u','e',' ','e','t',' ','n','i','b','h',' ','q','u','i','s',',',' ','i','n','t','e','r','d','u','m',' ','t','e','m','p','o','r',' ','o','d','i','o','.',' ','E','t','i','a','m',' ','s','a','p','i','e','n',' ','s','a','p','i','e','n',',',' ','a','l','i','q','u','a','m',' ','u','t',' ','a','l','i','q','u','a','m',' ','a','t',',',' ','s','a','g','i','t','t','i','s',' ','e','u',' ','m','a','g','n','a','.',' ','M','a','e','c','e','n','a','s',' ','m','a','g','n','a',' ','m','a','g','n','a',',',' ','s','u','s','c','i','p','i','t',' ','u','t',' ','l','o','r','e','m',' ','u','t',',',' ','v','a','r','i','u','s',' ','p','r','e','t','i','u','m',' ','f','e','l','i','s','.',' ','I','n','t','e','g','e','r',' ','t','i','n','c','i','d','u','n','t',',',' ','m','e','t','u','s',' ','v','e','l',' ','s','o','l','l','i','c','i','t','u','d','i','n',' ','f','i','n','i','b','u','s',',',' ','f','e','l','i','s',' ','e','r','a','t',' ','m','o','l','e','s','t','i','e',' ','u','r','n','a',',',' ','a',' ','c','o','n','d','i','m','e','n','t','u','m',' ','a','u','g','u','e',' ','a','r','c','u',' ','v','i','t','a','e',' ','r','i','s','u','s','.',' ','E','t','i','a','m',' ','i','d',' ','s','a','g','i','t','t','i','s',' ','q','u','a','m','.',' ','M','o','r','b','i',' ','a',' ','u','l','t','r','i','c','i','e','s',' ','n','u','n','c','.',' ','P','h','a','s','e','l','l','u','s',' ','e','r','o','s',' ','r','i','s','u','s',',',' ','c','u','r','s','u','s',' ','u','l','l','a','m','c','o','r','p','e','r',' ','m','a','s','s','a',' ','s','e','d',',',' ','d','i','g','n','i','s','s','i','m',' ','c','o','n','s','e','q','u','a','t',' ','l','i','g','u','l','a','.',' ','A','l','i','q','u','a','m',' ','t','u','r','p','i','s',' ','a','r','c','u',',',' ','a','c','c','u','m','s','a','n',' ','q','u','i','s',' ','s','a','p','i','e','n',' ','v','i','t','a','e',',',' ','l','a','c','i','n','i','a',' ','e','u','i','s','m','o','d',' ','n','i','s','l','.',' ','M','a','u','r','i','s',' ','i','d',' ','f','e','l','i','s',' ','s','e','m','!',0}; + static const WCHAR empty[] = {0}; + static const WCHAR* all[] = { test1, test2, test3, test4, test5, lipsum, lipsum2, empty }; + static const TAGID expected_str[] = { 0xc, 0x12, 0x18, 0x1e, 0x24, 0x2a, 0x30, 0x36 }; + static const TAGID expected_tab[] = { 6, 0x18, 0x2a, 0x3c, 0x4e, 0x60, 0x846, 0x102c }; + size_t n, j; + + for (n = 0; n < (sizeof(all) / sizeof(all[0])); ++n) + { + PDB pdb; + TAGID tagstr, table, expected_table; + + write_db_strings(path1, all, n+1); + + pdb = pSdbOpenDatabase(path1, DOS_PATH); + ok(pdb != NULL, "Expected a valid database\n"); + if (!pdb) + { + DeleteFileW(path1); + continue; + } + tagstr = pSdbFindFirstTag(pdb, TAGID_ROOT, TAG_NAME); + for (j = 0; j <= n; ++j) + { + ok(tagstr == expected_str[j], "Expected tagstr to be 0x%x, was 0x%x for %u/%u\n", expected_str[j], tagstr, j, n); + if (tagstr) + { + LPWSTR data; + DWORD size; + TAG tag = pSdbGetTagFromTagID(pdb, tagstr); + ok(tag == TAG_NAME, "Expected tag to be TAG_NAME, was 0x%x for %u/%u\n", tag, j, n); + size = pSdbGetTagDataSize(pdb, tagstr); + ok(size == 4, "Expected datasize to be 4, was %u for %u/%u\n", size, j, n); + data = pSdbGetStringTagPtr(pdb, tagstr); + ok(data && !wcsicmp(data, all[j]), "Expected data to be %s was %s for %u/%u\n", wine_dbgstr_w(all[j]), wine_dbgstr_w(data), j, n); + } + tagstr = pSdbFindNextTag(pdb, TAGID_ROOT, tagstr); + } + ok(tagstr == TAGID_NULL, "Expected to be at the end for %u\n", n); + + + table = pSdbFindFirstTag(pdb, TAGID_ROOT, TAG_STRINGTABLE); + expected_table = 0xc + (n+1)*6; + ok(table == expected_table, "Expected to find a stringtable at 0x%x instead of 0x%x for %u\n", expected_table, table, n); + if (table) + { + tagstr = pSdbFindFirstTag(pdb, table, TAG_STRINGTABLE_ITEM); + for (j = 0; j <= n; ++j) + { + ok(tagstr == (expected_tab[j] + expected_table), "Expected tagstr to be 0x%x, was 0x%x for %u/%u\n", (expected_tab[j] + expected_table), tagstr, j, n); + if (tagstr) + { + LPWSTR data; + DWORD size, expected_size; + TAG tag = pSdbGetTagFromTagID(pdb, tagstr); + ok(tag == TAG_STRINGTABLE_ITEM, "Expected tag to be TAG_NAME, was 0x%x for %u/%u\n", tag, j, n); + size = pSdbGetTagDataSize(pdb, tagstr); + expected_size = (lstrlenW(all[j])+1) * 2; + ok(size == expected_size, "Expected datasize to be %u, was %u for %u/%u\n", expected_size, size, j, n); + data = pSdbGetStringTagPtr(pdb, tagstr); + ok(data && !wcsicmp(data, all[j]), "Expected data to be %s was %s for %u/%u\n", wine_dbgstr_w(all[j]), wine_dbgstr_w(data), j, n); + } + tagstr = pSdbFindNextTag(pdb, TAGID_ROOT, tagstr); + } + ok(tagstr == TAGID_NULL, "Expected to be at the end for %u\n", n); + } + + pSdbCloseDatabase(pdb); + DeleteFileW(path1); + } +} static void match_str_attr_imp(PDB pdb, TAGID parent, TAG find, const char* compare) { @@ -876,5 +1004,6 @@ test_Sdb(); test_write_ex(); + test_stringtable(); test_CheckDatabaseManually(); }
8 years, 7 months
1
0
0
0
[tfaber] 71571: [COMCTL32_WINETEST] - Fix copypasta'd test list entry
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Jun 5 21:00:22 2016 New Revision: 71571 URL:
http://svn.reactos.org/svn/reactos?rev=71571&view=rev
Log: [COMCTL32_WINETEST] - Fix copypasta'd test list entry Modified: trunk/rostests/winetests/comctl32/testlist.c Modified: trunk/rostests/winetests/comctl32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/testli…
============================================================================== --- trunk/rostests/winetests/comctl32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comctl32/testlist.c [iso-8859-1] Sun Jun 5 21:00:22 2016 @@ -31,7 +31,7 @@ const struct test winetest_testlist[] = { - { "button", func_animate }, + { "animate", func_animate }, { "button", func_button }, { "comboex", func_comboex }, { "datetime", func_datetime },
8 years, 7 months
1
0
0
0
[akhaldi] 71570: [DBGHELP] GET_ENTRY => CONTAINING_RECORD.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 5 19:47:14 2016 New Revision: 71570 URL:
http://svn.reactos.org/svn/reactos?rev=71570&view=rev
Log: [DBGHELP] GET_ENTRY => CONTAINING_RECORD. Modified: trunk/reactos/dll/win32/dbghelp/dbghelp_ros.diff trunk/reactos/dll/win32/dbghelp/symbol.c Modified: trunk/reactos/dll/win32/dbghelp/dbghelp_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/dbghelp_…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/dbghelp_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/dbghelp_ros.diff [iso-8859-1] Sun Jun 5 19:47:14 2016 @@ -529,7 +529,7 @@ + + /* try to find the pointer in our ht */ + while ((ptr = hash_table_iter_up(&hti))) { -+ idx_to_ptr = GET_ENTRY(ptr, struct symt_idx_to_ptr, hash_elt); ++ idx_to_ptr = CONTAINING_RECORD(ptr, struct symt_idx_to_ptr, hash_elt); + if (idx_to_ptr->sym == sym) + return idx_to_ptr->idx; } Modified: trunk/reactos/dll/win32/dbghelp/symbol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dbghelp/symbol.c…
============================================================================== --- trunk/reactos/dll/win32/dbghelp/symbol.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dbghelp/symbol.c [iso-8859-1] Sun Jun 5 19:47:14 2016 @@ -68,7 +68,7 @@ /* try to find the pointer in our ht */ while ((ptr = hash_table_iter_up(&hti))) { - idx_to_ptr = GET_ENTRY(ptr, struct symt_idx_to_ptr, hash_elt); + idx_to_ptr = CONTAINING_RECORD(ptr, struct symt_idx_to_ptr, hash_elt); if (idx_to_ptr->sym == sym) return idx_to_ptr->idx; }
8 years, 7 months
1
0
0
0
[akhaldi] 71569: [MSCTF_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 5 19:38:56 2016 New Revision: 71569 URL:
http://svn.reactos.org/svn/reactos?rev=71569&view=rev
Log: [MSCTF_WINETEST] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/rostests/winetests/msctf/inputprocessor.c Modified: trunk/rostests/winetests/msctf/inputprocessor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msctf/inputproc…
============================================================================== --- trunk/rostests/winetests/msctf/inputprocessor.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msctf/inputprocessor.c [iso-8859-1] Sun Jun 5 19:38:56 2016 @@ -62,6 +62,7 @@ static DWORD tmSinkCookie; static DWORD tmSinkRefCount; +static DWORD dmSinkCookie; static DWORD documentStatus; static ITfDocumentMgr *test_CurrentFocus = NULL; static ITfDocumentMgr *test_PrevFocus = NULL; @@ -117,9 +118,7 @@ *sink = (*sink & ~SINK_EXPECTED_COUNT_MASK) + (count << 16); return; default: - if (todo) - todo_wine winetest_ok(0, "Unexpected %s sink\n",name); - else + todo_wine_if (todo) winetest_ok(0, "Unexpected %s sink\n",name); } *sink = SINK_FIRED; @@ -147,9 +146,7 @@ winetest_trace("optional sink %s not fired\n",name); break; default: - if (todo) - todo_wine winetest_ok(0, "%s not fired as expected, in state %x\n",name,*sink); - else + todo_wine_if (todo) winetest_ok(0, "%s not fired as expected, in state %x\n",name,*sink); } *sink = SINK_UNEXPECTED; @@ -230,12 +227,18 @@ static HRESULT WINAPI TextStoreACP_AdviseSink(ITextStoreACP *iface, REFIID riid, IUnknown *punk, DWORD dwMask) { + ITextStoreACPServices *services; HRESULT hr; sink_fire_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink"); - hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink,(LPVOID*)(&ACPSink)); + hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink, (void**)&ACPSink); ok(SUCCEEDED(hr),"Unable to QueryInterface on sink\n"); + + hr = ITextStoreACPSink_QueryInterface(ACPSink, &IID_ITextStoreACPServices, (void**)&services); + ok(hr == S_OK, "got 0x%08x\n", hr); + ITextStoreACPServices_Release(services); + return S_OK; } @@ -620,6 +623,42 @@ return S_OK; } +static HRESULT WINAPI TfTransitoryExtensionSink_QueryInterface(ITfTransitoryExtensionSink *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ITfTransitoryExtensionSink, riid)) { + *ppv = iface; + return S_OK; + } + + *ppv = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI TfTransitoryExtensionSink_AddRef(ITfTransitoryExtensionSink *iface) +{ + return 2; +} + +static ULONG WINAPI TfTransitoryExtensionSink_Release(ITfTransitoryExtensionSink *iface) +{ + return 1; +} + +static HRESULT WINAPI TfTransitoryExtensionSink_OnTransitoryExtensionUpdated(ITfTransitoryExtensionSink *iface, ITfContext *pic, + TfEditCookie ecReadOnly, ITfRange *pResultRange, ITfRange *pCompositionRange, BOOL *pfDeleteResultRange) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const ITfTransitoryExtensionSinkVtbl TfTransitoryExtensionSinkVtbl = { + TfTransitoryExtensionSink_QueryInterface, + TfTransitoryExtensionSink_AddRef, + TfTransitoryExtensionSink_Release, + TfTransitoryExtensionSink_OnTransitoryExtensionUpdated +}; + +static ITfTransitoryExtensionSink TfTransitoryExtensionSink = { &TfTransitoryExtensionSinkVtbl }; /******************************************************************************************** * Stub text service for testing @@ -1051,6 +1090,34 @@ ITfSource_Release(source); } +static void test_DocumentMgrAdviseSinks(void) +{ + ITfSource *source; + HRESULT hr; + + hr = ITfDocumentMgr_QueryInterface(g_dm, &IID_ITfSource, (void**)&source); + ok(hr == S_OK,"Failed to get IID_ITfSource for DocumentMgr\n"); + + dmSinkCookie = 0; + hr = ITfSource_AdviseSink(source, &IID_ITfTransitoryExtensionSink, (IUnknown*)&TfTransitoryExtensionSink, &dmSinkCookie); + ok(hr == S_OK,"Failed to Advise Sink\n"); + + ITfSource_Release(source); +} + +static void test_DocumentMgrUnadviseSinks(void) +{ + ITfSource *source = NULL; + HRESULT hr; + + hr = ITfDocumentMgr_QueryInterface(g_dm, &IID_ITfSource, (void**)&source); + ok(hr == S_OK,"Failed to get IID_ITfSource for DocumentMgr\n"); + + hr = ITfSource_UnadviseSink(source, dmSinkCookie); + ok(hr == S_OK,"Failed to unadvise Sink\n"); + ITfSource_Release(source); +} + /********************************************************************** * ITfKeyEventSink **********************************************************************/ @@ -1204,13 +1271,13 @@ ok(hr == E_INVALIDARG,"Wrong return, expected E_INVALIDARG\n"); hr =ITfKeystrokeMgr_PreserveKey(keymgr, 0, &CLSID_PreservedKey, &tfpk, NULL, 0); - ok(hr==E_INVALIDARG,"ITfKeystrokeMgr_PreserveKey inproperly succeeded\n"); + ok(hr==E_INVALIDARG,"ITfKeystrokeMgr_PreserveKey improperly succeeded\n"); hr =ITfKeystrokeMgr_PreserveKey(keymgr, tid, &CLSID_PreservedKey, &tfpk, NULL, 0); ok(SUCCEEDED(hr),"ITfKeystrokeMgr_PreserveKey failed\n"); hr =ITfKeystrokeMgr_PreserveKey(keymgr, tid, &CLSID_PreservedKey, &tfpk, NULL, 0); - ok(hr == TF_E_ALREADY_EXISTS,"ITfKeystrokeMgr_PreserveKey inproperly succeeded\n"); + ok(hr == TF_E_ALREADY_EXISTS,"ITfKeystrokeMgr_PreserveKey improperly succeeded\n"); preserved = FALSE; hr = ITfKeystrokeMgr_IsPreservedKey(keymgr, &CLSID_PreservedKey, &tfpk, &preserved); @@ -1225,7 +1292,7 @@ if (hr == S_FALSE) ok(preserved == FALSE,"misreporting preserved key\n"); hr = ITfKeystrokeMgr_UnpreserveKey(keymgr, &CLSID_PreservedKey,&tfpk); - ok(hr==CONNECT_E_NOCONNECTION,"ITfKeystrokeMgr_UnpreserveKey inproperly succeeded\n"); + ok(hr==CONNECT_E_NOCONNECTION,"ITfKeystrokeMgr_UnpreserveKey improperly succeeded\n"); hr = ITfKeystrokeMgr_UnadviseKeyEventSink(keymgr,tid); ok(SUCCEEDED(hr),"ITfKeystrokeMgr_UnadviseKeyEventSink failed\n"); @@ -1425,13 +1492,16 @@ ok(cid == cid2, "Second activate client ID does not match\n"); hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfThreadMgrEx, (void **)&tmex); - ok(SUCCEEDED(hr), "Unable to acquire ITfThreadMgrEx interface\n"); - - hr = ITfThreadMgrEx_ActivateEx(tmex, &cid2, 0); - ok(SUCCEEDED(hr), "Failed to Activate\n"); - ok(cid == cid2, "ActivateEx client ID does not match\n"); - - ITfThreadMgrEx_Release(tmex); + if (hr == S_OK) + { + hr = ITfThreadMgrEx_ActivateEx(tmex, &cid2, 0); + ok(SUCCEEDED(hr), "Failed to Activate\n"); + ok(cid == cid2, "ActivateEx client ID does not match\n"); + + ITfThreadMgrEx_Release(tmex); + } + else + win_skip("ITfThreadMgrEx is not supported\n"); hr = ITfThreadMgr_Deactivate(g_tm); ok(SUCCEEDED(hr), "Failed to Deactivate\n"); @@ -2235,6 +2305,7 @@ test_ThreadMgrAdviseSinks(); test_Activate(); test_startSession(); + test_DocumentMgrAdviseSinks(); test_TfGuidAtom(); test_ClientId(); test_KeystrokeMgr(); @@ -2245,6 +2316,7 @@ test_FindClosestCategory(); test_Disable(); test_ThreadMgrUnadviseSinks(); + test_DocumentMgrUnadviseSinks(); test_UnregisterCategory(); test_Unregister(); test_profile_mgr();
8 years, 7 months
1
0
0
0
[akhaldi] 71568: [MSCTF] Sync with Wine Staging 1.9.11. CORE-11368
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun Jun 5 19:38:23 2016 New Revision: 71568 URL:
http://svn.reactos.org/svn/reactos?rev=71568&view=rev
Log: [MSCTF] Sync with Wine Staging 1.9.11. CORE-11368 Modified: trunk/reactos/dll/win32/msctf/compartmentmgr.c trunk/reactos/dll/win32/msctf/context.c trunk/reactos/dll/win32/msctf/documentmgr.c trunk/reactos/dll/win32/msctf/inputprocessor.c trunk/reactos/dll/win32/msctf/msctf.c trunk/reactos/dll/win32/msctf/msctf_internal.h trunk/reactos/dll/win32/msctf/threadmgr.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msctf/compartmentmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/compartmen…
============================================================================== --- trunk/reactos/dll/win32/msctf/compartmentmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/compartmentmgr.c [iso-8859-1] Sun Jun 5 19:38:23 2016 @@ -46,15 +46,6 @@ struct list *cursor; } CompartmentEnumGuid; - -typedef struct tagCompartmentSink { - struct list entry; - union { - IUnknown *pIUnknown; - ITfCompartmentEventSink *pITfCompartmentEventSink; - } interfaces; -} CompartmentSink; - typedef struct tagCompartment { ITfCompartment ITfCompartment_iface; ITfSource ITfSource_iface; @@ -423,23 +414,11 @@ /************************************************** * ITfCompartment **************************************************/ -static void free_sink(CompartmentSink *sink) -{ - IUnknown_Release(sink->interfaces.pIUnknown); - HeapFree(GetProcessHeap(),0,sink); -} - static void Compartment_Destructor(Compartment *This) { - struct list *cursor, *cursor2; TRACE("destroying %p\n", This); VariantClear(&This->variant); - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->CompartmentEventSink) - { - CompartmentSink* sink = LIST_ENTRY(cursor,CompartmentSink,entry); - list_remove(cursor); - free_sink(sink); - } + free_sinks(&This->CompartmentEventSink); HeapFree(GetProcessHeap(),0,This); } @@ -489,6 +468,7 @@ TfClientId tid, const VARIANT *pvarValue) { Compartment *This = impl_from_ITfCompartment(iface); + ITfCompartmentEventSink *sink; struct list *cursor; TRACE("(%p) %i %p\n",This,tid,pvarValue); @@ -514,10 +494,9 @@ else if (V_VT(pvarValue) == VT_UNKNOWN) IUnknown_AddRef(V_UNKNOWN(&This->variant)); - LIST_FOR_EACH(cursor, &This->CompartmentEventSink) - { - CompartmentSink* sink = LIST_ENTRY(cursor,CompartmentSink,entry); - ITfCompartmentEventSink_OnChange(sink->interfaces.pITfCompartmentEventSink,&This->valueData->guid); + SINK_FOR_EACH(cursor, &This->CompartmentEventSink, ITfCompartmentEventSink, sink) + { + ITfCompartmentEventSink_OnChange(sink, &This->valueData->guid); } return S_OK; @@ -572,7 +551,6 @@ REFIID riid, IUnknown *punk, DWORD *pdwCookie) { Compartment *This = impl_from_ITfSource(iface); - CompartmentSink *cs; TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie); @@ -580,47 +558,23 @@ return E_INVALIDARG; if (IsEqualIID(riid, &IID_ITfCompartmentEventSink)) - { - cs = HeapAlloc(GetProcessHeap(),0,sizeof(CompartmentSink)); - if (!cs) - return E_OUTOFMEMORY; - if (FAILED(IUnknown_QueryInterface(punk, riid, (LPVOID *)&cs->interfaces.pITfCompartmentEventSink))) - { - HeapFree(GetProcessHeap(),0,cs); - return CONNECT_E_CANNOTCONNECT; - } - list_add_head(&This->CompartmentEventSink,&cs->entry); - *pdwCookie = generate_Cookie(COOKIE_MAGIC_COMPARTMENTSINK , cs); - } - else - { - FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); - return E_NOTIMPL; - } - - TRACE("cookie %x\n",*pdwCookie); - - return S_OK; + return advise_sink(&This->CompartmentEventSink, &IID_ITfCompartmentEventSink, + COOKIE_MAGIC_COMPARTMENTSINK, punk, pdwCookie); + + FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); + return E_NOTIMPL; } static HRESULT WINAPI CompartmentSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) { Compartment *This = impl_from_ITfSource(iface); - CompartmentSink *sink; TRACE("(%p) %x\n",This,pdwCookie); if (get_Cookie_magic(pdwCookie)!=COOKIE_MAGIC_COMPARTMENTSINK) return E_INVALIDARG; - sink = remove_Cookie(pdwCookie); - if (!sink) - return CONNECT_E_NOCONNECTION; - - list_remove(&sink->entry); - free_sink(sink); - - return S_OK; + return unadvise_sink(pdwCookie); } static const ITfSourceVtbl CompartmentSourceVtbl = Modified: trunk/reactos/dll/win32/msctf/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/context.c?…
============================================================================== --- trunk/reactos/dll/win32/msctf/context.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/context.c [iso-8859-1] Sun Jun 5 19:38:23 2016 @@ -20,19 +20,6 @@ #include "msctf_internal.h" -typedef struct tagContextSink { - struct list entry; - union { - /* Context Sinks */ - IUnknown *pIUnknown; - /* ITfContextKeyEventSink *pITfContextKeyEventSink; */ - /* ITfEditTransactionSink *pITfEditTransactionSink; */ - /* ITfStatusSink *pITfStatusSink; */ - ITfTextEditSink *pITfTextEditSink; - /* ITfTextLayoutSink *pITfTextLayoutSink; */ - } interfaces; -} ContextSink; - typedef struct tagContext { ITfContext ITfContext_iface; ITfSource ITfSource_iface; @@ -43,6 +30,8 @@ /* const ITfMouseTrackerVtbl *MouseTrackerVtbl; */ /* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */ ITfSourceSingle ITfSourceSingle_iface; + ITextStoreACPSink ITextStoreACPSink_iface; + ITextStoreACPServices ITextStoreACPServices_iface; LONG refCount; BOOL connected; @@ -57,7 +46,6 @@ ITextStoreACP *pITextStoreACP; ITfContextOwnerCompositionSink *pITfContextOwnerCompositionSink; - ITextStoreACPSink *pITextStoreACPSink; ITfEditSession* currentEditSession; /* kept as separate lists to reduce unnecessary iterations */ @@ -74,17 +62,6 @@ Context *pOwningContext; } EditCookie; -typedef struct tagTextStoreACPSink { - ITextStoreACPSink ITextStoreACPSink_iface; - /* const ITextStoreACPServicesVtbl *TextStoreACPServicesVtbl; */ - LONG refCount; - - Context *pContext; -} TextStoreACPSink; - - -static HRESULT TextStoreACPSink_Constructor(ITextStoreACPSink **ppOut, Context *pContext); - static inline Context *impl_from_ITfContext(ITfContext *iface) { return CONTAINING_RECORD(iface, Context, ITfContext_iface); @@ -105,31 +82,26 @@ return CONTAINING_RECORD(iface, Context, ITfSourceSingle_iface); } -static inline TextStoreACPSink *impl_from_ITextStoreACPSink(ITextStoreACPSink *iface) -{ - return CONTAINING_RECORD(iface, TextStoreACPSink, ITextStoreACPSink_iface); -} - -static void free_sink(ContextSink *sink) -{ - IUnknown_Release(sink->interfaces.pIUnknown); - HeapFree(GetProcessHeap(),0,sink); +static inline Context *impl_from_ITextStoreACPSink(ITextStoreACPSink *iface) +{ + return CONTAINING_RECORD(iface, Context, ITextStoreACPSink_iface); +} + +static inline Context *impl_from_ITextStoreACPServices(ITextStoreACPServices *iface) +{ + return CONTAINING_RECORD(iface, Context, ITextStoreACPServices_iface); } static void Context_Destructor(Context *This) { - struct list *cursor, *cursor2; EditCookie *cookie; TRACE("destroying %p\n", This); - if (This->pITextStoreACPSink) - { - ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)This->pITextStoreACPSink); - ITextStoreACPSink_Release(This->pITextStoreACPSink); - } - if (This->pITextStoreACP) + { + ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)&This->ITextStoreACPSink_iface); ITextStoreACP_Release(This->pITextStoreACP); + } if (This->pITfContextOwnerCompositionSink) ITfContextOwnerCompositionSink_Release(This->pITfContextOwnerCompositionSink); @@ -141,36 +113,11 @@ This->defaultCookie = 0; } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pContextKeyEventSink) - { - ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pEditTransactionSink) - { - ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pStatusSink) - { - ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pTextEditSink) - { - ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->pTextLayoutSink) - { - ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); - list_remove(cursor); - free_sink(sink); - } + free_sinks(&This->pContextKeyEventSink); + free_sinks(&This->pEditTransactionSink); + free_sinks(&This->pStatusSink); + free_sinks(&This->pTextEditSink); + free_sinks(&This->pTextLayoutSink); CompartmentMgr_Destructor(This->CompartmentMgr); HeapFree(GetProcessHeap(),0,This); @@ -590,53 +537,29 @@ REFIID riid, IUnknown *punk, DWORD *pdwCookie) { Context *This = impl_from_ITfSource(iface); - ContextSink *es; + TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie); if (!riid || !punk || !pdwCookie) return E_INVALIDARG; if (IsEqualIID(riid, &IID_ITfTextEditSink)) - { - es = HeapAlloc(GetProcessHeap(),0,sizeof(ContextSink)); - if (!es) - return E_OUTOFMEMORY; - if (FAILED(IUnknown_QueryInterface(punk, riid, (LPVOID *)&es->interfaces.pITfTextEditSink))) - { - HeapFree(GetProcessHeap(),0,es); - return CONNECT_E_CANNOTCONNECT; - } - list_add_head(&This->pTextEditSink ,&es->entry); - *pdwCookie = generate_Cookie(COOKIE_MAGIC_CONTEXTSINK, es); - } - else - { - FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); - return E_NOTIMPL; - } - - TRACE("cookie %x\n",*pdwCookie); - return S_OK; + return advise_sink(&This->pTextEditSink, &IID_ITfTextEditSink, COOKIE_MAGIC_CONTEXTSINK, punk, pdwCookie); + + FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); + return E_NOTIMPL; } static HRESULT WINAPI ContextSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) { Context *This = impl_from_ITfSource(iface); - ContextSink *sink; TRACE("(%p) %x\n",This,pdwCookie); if (get_Cookie_magic(pdwCookie)!=COOKIE_MAGIC_CONTEXTSINK) return E_INVALIDARG; - sink = remove_Cookie(pdwCookie); - if (!sink) - return CONNECT_E_NOCONNECTION; - - list_remove(&sink->entry); - free_sink(sink); - - return S_OK; + return unadvise_sink(pdwCookie); } static const ITfSourceVtbl ContextSourceVtbl = @@ -769,114 +692,22 @@ SourceSingle_UnadviseSingleSink, }; -HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore) -{ - Context *This; - EditCookie *cookie; - - This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Context)); - if (This == NULL) - return E_OUTOFMEMORY; - - cookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie)); - if (cookie == NULL) - { - HeapFree(GetProcessHeap(),0,This); - return E_OUTOFMEMORY; - } - - TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore); - - This->ITfContext_iface.lpVtbl= &ContextVtbl; - This->ITfSource_iface.lpVtbl = &ContextSourceVtbl; - This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl; - This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl; - This->refCount = 1; - This->tidOwner = tidOwner; - This->connected = FALSE; - This->manager = mgr; - - CompartmentMgr_Constructor((IUnknown*)&This->ITfContext_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); - - cookie->lockType = TF_ES_READ; - cookie->pOwningContext = This; - - if (punk) - { - IUnknown_QueryInterface(punk, &IID_ITextStoreACP, - (LPVOID*)&This->pITextStoreACP); - - IUnknown_QueryInterface(punk, &IID_ITfContextOwnerCompositionSink, - (LPVOID*)&This->pITfContextOwnerCompositionSink); - - if (!This->pITextStoreACP && !This->pITfContextOwnerCompositionSink) - FIXME("Unhandled pUnk\n"); - } - - This->defaultCookie = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE,cookie); - *pecTextStore = This->defaultCookie; - - list_init(&This->pContextKeyEventSink); - list_init(&This->pEditTransactionSink); - list_init(&This->pStatusSink); - list_init(&This->pTextEditSink); - list_init(&This->pTextLayoutSink); - - *ppOut = &This->ITfContext_iface; - TRACE("returning %p\n", *ppOut); - - return S_OK; -} - -HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager) -{ - Context *This = impl_from_ITfContext(iface); - - if (This->pITextStoreACP) - { - if (SUCCEEDED(TextStoreACPSink_Constructor(&This->pITextStoreACPSink, This))) - ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink, - (IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS); - } - This->connected = TRUE; - This->manager = manager; - return S_OK; -} - -HRESULT Context_Uninitialize(ITfContext *iface) -{ - Context *This = impl_from_ITfContext(iface); - - if (This->pITextStoreACPSink) - { - ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)This->pITextStoreACPSink); - if (ITextStoreACPSink_Release(This->pITextStoreACPSink) == 0) - This->pITextStoreACPSink = NULL; - } - This->connected = FALSE; - This->manager = NULL; - return S_OK; -} - /************************************************************************** * ITextStoreACPSink **************************************************************************/ -static void TextStoreACPSink_Destructor(TextStoreACPSink *This) -{ - TRACE("destroying %p\n", This); - HeapFree(GetProcessHeap(),0,This); -} - static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface, REFIID iid, LPVOID *ppvOut) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); + *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITextStoreACPSink)) { *ppvOut = &This->ITextStoreACPSink_iface; } + else if (IsEqualIID(iid, &IID_ITextStoreACPServices)) + *ppvOut = &This->ITextStoreACPServices_iface; if (*ppvOut) { @@ -890,19 +721,14 @@ static ULONG WINAPI TextStoreACPSink_AddRef(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); - return InterlockedIncrement(&This->refCount); + Context *This = impl_from_ITextStoreACPSink(iface); + return ITfContext_AddRef(&This->ITfContext_iface); } static ULONG WINAPI TextStoreACPSink_Release(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); - ULONG ret; - - ret = InterlockedDecrement(&This->refCount); - if (ret == 0) - TextStoreACPSink_Destructor(This); - return ret; + Context *This = impl_from_ITextStoreACPSink(iface); + return ITfContext_Release(&This->ITfContext_iface); } /***************************************************** @@ -912,14 +738,14 @@ static HRESULT WINAPI TextStoreACPSink_OnTextChange(ITextStoreACPSink *iface, DWORD dwFlags, const TS_TEXTCHANGE *pChange) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI TextStoreACPSink_OnSelectionChange(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -927,7 +753,7 @@ static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface, TsLayoutCode lcode, TsViewCookie vcView) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -935,27 +761,21 @@ static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface, DWORD dwFlags) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); HRESULT hr, hrSession; TRACE("(%p) %x\n",This, dwFlags); - if (!This->pContext) - { - ERR("No context?\n"); - return E_FAIL; - } - - if (!This->pContext->pITextStoreACP) + if (!This->pITextStoreACP) { FIXME("Context does not have a ITextStoreACP\n"); return E_NOTIMPL; } - hr = ITextStoreACP_RequestLock(This->pContext->pITextStoreACP, TS_LF_READ, &hrSession); + hr = ITextStoreACP_RequestLock(This->pITextStoreACP, TS_LF_READ, &hrSession); if(SUCCEEDED(hr) && SUCCEEDED(hrSession)) - This->pContext->documentStatus.dwDynamicFlags = dwFlags; + This->documentStatus.dwDynamicFlags = dwFlags; return S_OK; } @@ -963,7 +783,7 @@ static HRESULT WINAPI TextStoreACPSink_OnAttrsChange(ITextStoreACPSink *iface, LONG acpStart, LONG acpEnd, ULONG cAttrs, const TS_ATTRID *paAttrs) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -971,7 +791,7 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface, DWORD dwLockFlags) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); HRESULT hr; EditCookie *cookie,*sinkcookie; TfEditCookie ec; @@ -979,13 +799,7 @@ TRACE("(%p) %x\n",This, dwLockFlags); - if (!This->pContext) - { - ERR("OnLockGranted called without a context\n"); - return E_FAIL; - } - - if (!This->pContext->currentEditSession) + if (!This->currentEditSession) { FIXME("OnLockGranted called for something other than an EditSession\n"); return S_OK; @@ -1003,32 +817,31 @@ } cookie->lockType = dwLockFlags; - cookie->pOwningContext = This->pContext; + cookie->pOwningContext = This; ec = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE, cookie); - hr = ITfEditSession_DoEditSession(This->pContext->currentEditSession, ec); + hr = ITfEditSession_DoEditSession(This->currentEditSession, ec); if ((dwLockFlags&TS_LF_READWRITE) == TS_LF_READWRITE) { + ITfTextEditSink *sink; TfEditCookie sc; sinkcookie->lockType = TS_LF_READ; - sinkcookie->pOwningContext = This->pContext; + sinkcookie->pOwningContext = This; sc = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE, sinkcookie); /*TODO: implement ITfEditRecord */ - LIST_FOR_EACH(cursor, &This->pContext->pTextEditSink) + SINK_FOR_EACH(cursor, &This->pTextEditSink, ITfTextEditSink, sink) { - ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); - ITfTextEditSink_OnEndEdit(sink->interfaces.pITfTextEditSink, - (ITfContext*) &This->pContext, sc, NULL); + ITfTextEditSink_OnEndEdit(sink, (ITfContext*) &This->ITfContext_iface, sc, NULL); } sinkcookie = remove_Cookie(sc); } HeapFree(GetProcessHeap(),0,sinkcookie); - ITfEditSession_Release(This->pContext->currentEditSession); - This->pContext->currentEditSession = NULL; + ITfEditSession_Release(This->currentEditSession); + This->currentEditSession = NULL; /* Edit Cookie is only valid during the edit session */ cookie = remove_Cookie(ec); @@ -1039,14 +852,14 @@ static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -1066,20 +879,154 @@ TextStoreACPSink_OnEndEditTransaction }; -static HRESULT TextStoreACPSink_Constructor(ITextStoreACPSink **ppOut, Context *pContext) -{ - TextStoreACPSink *This; - - This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(TextStoreACPSink)); +static HRESULT WINAPI TextStoreACPServices_QueryInterface(ITextStoreACPServices *iface, REFIID riid, void **obj) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + return ITextStoreACPSink_QueryInterface(&This->ITextStoreACPSink_iface, riid, obj); +} + +static ULONG WINAPI TextStoreACPServices_AddRef(ITextStoreACPServices *iface) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + return ITextStoreACPSink_AddRef(&This->ITextStoreACPSink_iface); +} + +static ULONG WINAPI TextStoreACPServices_Release(ITextStoreACPServices *iface) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + return ITextStoreACPSink_Release(&This->ITextStoreACPSink_iface); +} + +static HRESULT WINAPI TextStoreACPServices_Serialize(ITextStoreACPServices *iface, ITfProperty *prop, ITfRange *range, + TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + + FIXME("stub: %p %p %p %p %p\n", This, prop, range, header, stream); + + return E_NOTIMPL; +} + +static HRESULT WINAPI TextStoreACPServices_Unserialize(ITextStoreACPServices *iface, ITfProperty *prop, + const TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream, ITfPersistentPropertyLoaderACP *loader) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + + FIXME("stub: %p %p %p %p %p\n", This, prop, header, stream, loader); + + return E_NOTIMPL; +} + +static HRESULT WINAPI TextStoreACPServices_ForceLoadProperty(ITextStoreACPServices *iface, ITfProperty *prop) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + + FIXME("stub: %p %p\n", This, prop); + + return E_NOTIMPL; +} + +static HRESULT WINAPI TextStoreACPServices_CreateRange(ITextStoreACPServices *iface, + LONG start, LONG end, ITfRangeACP **range) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + + FIXME("stub: %p %d %d %p\n", This, start, end, range); + + return S_OK; +} + +static const ITextStoreACPServicesVtbl TextStoreACPServicesVtbl = +{ + TextStoreACPServices_QueryInterface, + TextStoreACPServices_AddRef, + TextStoreACPServices_Release, + TextStoreACPServices_Serialize, + TextStoreACPServices_Unserialize, + TextStoreACPServices_ForceLoadProperty, + TextStoreACPServices_CreateRange +}; + +HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore) +{ + Context *This; + EditCookie *cookie; + + This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Context)); if (This == NULL) return E_OUTOFMEMORY; - This->ITextStoreACPSink_iface.lpVtbl= &TextStoreACPSinkVtbl; + cookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie)); + if (cookie == NULL) + { + HeapFree(GetProcessHeap(),0,This); + return E_OUTOFMEMORY; + } + + TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore); + + This->ITfContext_iface.lpVtbl= &ContextVtbl; + This->ITfSource_iface.lpVtbl = &ContextSourceVtbl; + This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl; + This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl; + This->ITextStoreACPSink_iface.lpVtbl = &TextStoreACPSinkVtbl; + This->ITextStoreACPServices_iface.lpVtbl = &TextStoreACPServicesVtbl; This->refCount = 1; - - This->pContext = pContext; - - *ppOut = &This->ITextStoreACPSink_iface; + This->tidOwner = tidOwner; + This->connected = FALSE; + This->manager = mgr; + + CompartmentMgr_Constructor((IUnknown*)&This->ITfContext_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); + + cookie->lockType = TF_ES_READ; + cookie->pOwningContext = This; + + if (punk) + { + IUnknown_QueryInterface(punk, &IID_ITextStoreACP, + (LPVOID*)&This->pITextStoreACP); + + IUnknown_QueryInterface(punk, &IID_ITfContextOwnerCompositionSink, + (LPVOID*)&This->pITfContextOwnerCompositionSink); + + if (!This->pITextStoreACP && !This->pITfContextOwnerCompositionSink) + FIXME("Unhandled pUnk\n"); + } + + This->defaultCookie = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE,cookie); + *pecTextStore = This->defaultCookie; + + list_init(&This->pContextKeyEventSink); + list_init(&This->pEditTransactionSink); + list_init(&This->pStatusSink); + list_init(&This->pTextEditSink); + list_init(&This->pTextLayoutSink); + + *ppOut = &This->ITfContext_iface; TRACE("returning %p\n", *ppOut); + return S_OK; } + +HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager) +{ + Context *This = impl_from_ITfContext(iface); + + if (This->pITextStoreACP) + ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink, + (IUnknown*)&This->ITextStoreACPSink_iface, TS_AS_ALL_SINKS); + This->connected = TRUE; + This->manager = manager; + return S_OK; +} + +HRESULT Context_Uninitialize(ITfContext *iface) +{ + Context *This = impl_from_ITfContext(iface); + + if (This->pITextStoreACP) + ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)&This->ITextStoreACPSink_iface); + This->connected = FALSE; + This->manager = NULL; + return S_OK; +} Modified: trunk/reactos/dll/win32/msctf/documentmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/documentmg…
============================================================================== --- trunk/reactos/dll/win32/msctf/documentmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/documentmgr.c [iso-8859-1] Sun Jun 5 19:38:23 2016 @@ -30,6 +30,8 @@ ITfContext* contextStack[2]; /* limit of 2 contexts */ ITfThreadMgrEventSink* ThreadMgrSink; + + struct list TransitoryExtensionSink; } DocumentMgr; typedef struct tagEnumTfContext { @@ -69,6 +71,7 @@ ITfContext_Release(This->contextStack[0]); if (This->contextStack[1]) ITfContext_Release(This->contextStack[1]); + free_sinks(&This->TransitoryExtensionSink); CompartmentMgr_Destructor(This->CompartmentMgr); HeapFree(GetProcessHeap(),0,This); } @@ -278,15 +281,33 @@ REFIID riid, IUnknown *punk, DWORD *pdwCookie) { DocumentMgr *This = impl_from_ITfSource(iface); - FIXME("STUB:(%p)\n",This); + + TRACE("(%p) %s %p %p\n", This, debugstr_guid(riid), punk, pdwCookie); + + if (!riid || !punk || !pdwCookie) + return E_INVALIDARG; + + if (IsEqualIID(riid, &IID_ITfTransitoryExtensionSink)) + { + WARN("semi-stub for ITfTransitoryExtensionSink: callback won't be used.\n"); + return advise_sink(&This->TransitoryExtensionSink, &IID_ITfTransitoryExtensionSink, + COOKIE_MAGIC_DMSINK, punk, pdwCookie); + } + + FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); return E_NOTIMPL; } static HRESULT WINAPI DocumentMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) { DocumentMgr *This = impl_from_ITfSource(iface); - FIXME("STUB:(%p)\n",This); - return E_NOTIMPL; + + TRACE("(%p) %x\n",This,pdwCookie); + + if (get_Cookie_magic(pdwCookie)!=COOKIE_MAGIC_DMSINK) + return E_INVALIDARG; + + return unadvise_sink(pdwCookie); } static const ITfSourceVtbl DocumentMgrSourceVtbl = @@ -310,6 +331,7 @@ This->ITfSource_iface.lpVtbl = &DocumentMgrSourceVtbl; This->refCount = 1; This->ThreadMgrSink = ThreadMgrSink; + list_init(&This->TransitoryExtensionSink); CompartmentMgr_Constructor((IUnknown*)&This->ITfDocumentMgr_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); Modified: trunk/reactos/dll/win32/msctf/inputprocessor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/inputproce…
============================================================================== --- trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/inputprocessor.c [iso-8859-1] Sun Jun 5 19:38:23 2016 @@ -30,15 +30,6 @@ static const WCHAR szwProfile[] = {'P','r','o','f','i','l','e',0}; static const WCHAR szwDefaultFmt[] = {'%','s','\\','%','s','\\','0','x','%','0','8','x','\\','%','s',0}; -typedef struct tagInputProcessorProfilesSink { - struct list entry; - union { - /* InputProcessorProfile Sinks */ - IUnknown *pIUnknown; - ITfLanguageProfileNotifySink *pITfLanguageProfileNotifySink; - } interfaces; -} InputProcessorProfilesSink; - typedef struct tagInputProcessorProfiles { ITfInputProcessorProfiles ITfInputProcessorProfiles_iface; ITfSource ITfSource_iface; @@ -196,25 +187,11 @@ return CONTAINING_RECORD(iface, EnumTfLanguageProfiles, IEnumTfLanguageProfiles_iface); } -static void free_sink(InputProcessorProfilesSink *sink) -{ - IUnknown_Release(sink->interfaces.pIUnknown); - HeapFree(GetProcessHeap(),0,sink); -} - static void InputProcessorProfiles_Destructor(InputProcessorProfiles *This) { - struct list *cursor, *cursor2; TRACE("destroying %p\n", This); - /* free sinks */ - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->LanguageProfileNotifySink) - { - InputProcessorProfilesSink* sink = LIST_ENTRY(cursor,InputProcessorProfilesSink,entry); - list_remove(cursor); - free_sink(sink); - } - + free_sinks(&This->LanguageProfileNotifySink); HeapFree(GetProcessHeap(),0,This); } @@ -584,18 +561,18 @@ ITfInputProcessorProfiles *iface, LANGID langid) { InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface); + ITfLanguageProfileNotifySink *sink; struct list *cursor; BOOL accept; FIXME("STUB:(%p)\n",This); - LIST_FOR_EACH(cursor, &This->LanguageProfileNotifySink) - { - InputProcessorProfilesSink* sink = LIST_ENTRY(cursor,InputProcessorProfilesSink,entry); + SINK_FOR_EACH(cursor, &This->LanguageProfileNotifySink, ITfLanguageProfileNotifySink, sink) + { accept = TRUE; - ITfLanguageProfileNotifySink_OnLanguageChange(sink->interfaces.pITfLanguageProfileNotifySink, langid, &accept); + ITfLanguageProfileNotifySink_OnLanguageChange(sink, langid, &accept); if (!accept) - return E_FAIL; + return E_FAIL; } /* TODO: On successful language change call OnLanguageChanged sink */ @@ -907,7 +884,6 @@ REFIID riid, IUnknown *punk, DWORD *pdwCookie) { InputProcessorProfiles *This = impl_from_ITfSource(iface); - InputProcessorProfilesSink *ipps; TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie); @@ -915,47 +891,23 @@ return E_INVALIDARG; if (IsEqualIID(riid, &IID_ITfLanguageProfileNotifySink)) - { - ipps = HeapAlloc(GetProcessHeap(),0,sizeof(InputProcessorProfilesSink)); - if (!ipps) - return E_OUTOFMEMORY; - if (FAILED(IUnknown_QueryInterface(punk, riid, (LPVOID *)&ipps->interfaces.pITfLanguageProfileNotifySink))) - { - HeapFree(GetProcessHeap(),0,ipps); - return CONNECT_E_CANNOTCONNECT; - } - list_add_head(&This->LanguageProfileNotifySink,&ipps->entry); - *pdwCookie = generate_Cookie(COOKIE_MAGIC_IPPSINK, ipps); - } - else - { - FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); - return E_NOTIMPL; - } - - TRACE("cookie %x\n",*pdwCookie); - - return S_OK; + return advise_sink(&This->LanguageProfileNotifySink, &IID_ITfLanguageProfileNotifySink, + COOKIE_MAGIC_IPPSINK, punk, pdwCookie); + + FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); + return E_NOTIMPL; } static HRESULT WINAPI IPPSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) { InputProcessorProfiles *This = impl_from_ITfSource(iface); - InputProcessorProfilesSink *sink; TRACE("(%p) %x\n",This,pdwCookie); if (get_Cookie_magic(pdwCookie)!=COOKIE_MAGIC_IPPSINK) return E_INVALIDARG; - sink = remove_Cookie(pdwCookie); - if (!sink) - return CONNECT_E_NOCONNECTION; - - list_remove(&sink->entry); - free_sink(sink); - - return S_OK; + return unadvise_sink(pdwCookie); } static const ITfSourceVtbl InputProcessorProfilesSourceVtbl = Modified: trunk/reactos/dll/win32/msctf/msctf.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf.c?re…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf.c [iso-8859-1] Sun Jun 5 19:38:23 2016 @@ -266,6 +266,54 @@ return 0x0; } +HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUnknown *unk, DWORD *cookie) +{ + Sink *sink; + + sink = HeapAlloc(GetProcessHeap(), 0, sizeof(*sink)); + if (!sink) + return E_OUTOFMEMORY; + + if (FAILED(IUnknown_QueryInterface(unk, riid, (void**)&sink->interfaces.pIUnknown))) + { + HeapFree(GetProcessHeap(), 0, sink); + return CONNECT_E_CANNOTCONNECT; + } + + list_add_head(sink_list, &sink->entry); + *cookie = generate_Cookie(cookie_magic, sink); + TRACE("cookie %x\n", *cookie); + return S_OK; +} + +static void free_sink(Sink *sink) +{ + list_remove(&sink->entry); + IUnknown_Release(sink->interfaces.pIUnknown); + HeapFree(GetProcessHeap(), 0, sink); +} + +HRESULT unadvise_sink(DWORD cookie) +{ + Sink *sink; + + sink = remove_Cookie(cookie); + if (!sink) + return CONNECT_E_NOCONNECTION; + + free_sink(sink); + return S_OK; +} + +void free_sinks(struct list *sink_list) +{ + while(!list_empty(sink_list)) + { + Sink* sink = LIST_ENTRY(sink_list->next, Sink, entry); + free_sink(sink); + } +} + /***************************************************************************** * Active Text Service Management *****************************************************************************/ Modified: trunk/reactos/dll/win32/msctf/msctf_internal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/msctf_inte…
============================================================================== --- trunk/reactos/dll/win32/msctf/msctf_internal.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/msctf_internal.h [iso-8859-1] Sun Jun 5 19:38:23 2016 @@ -51,6 +51,7 @@ #define COOKIE_MAGIC_IPPSINK 0x0040 #define COOKIE_MAGIC_EDITCOOKIE 0x0050 #define COOKIE_MAGIC_COMPARTMENTSINK 0x0060 +#define COOKIE_MAGIC_DMSINK 0x0070 extern DWORD tlsIndex DECLSPEC_HIDDEN; extern TfClientId processId DECLSPEC_HIDDEN; @@ -89,6 +90,28 @@ extern HRESULT get_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown** sink) DECLSPEC_HIDDEN; extern HRESULT set_textservice_sink(TfClientId tid, REFCLSID iid, IUnknown* sink) DECLSPEC_HIDDEN; +typedef struct { + struct list entry; + union { + IUnknown *pIUnknown; + ITfThreadMgrEventSink *pITfThreadMgrEventSink; + ITfCompartmentEventSink *pITfCompartmentEventSink; + ITfTextEditSink *pITfTextEditSink; + ITfLanguageProfileNotifySink *pITfLanguageProfileNotifySink; + ITfTransitoryExtensionSink *pITfTransitoryExtensionSink; + } interfaces; +} Sink; + +#define SINK_ENTRY(cursor,type) (LIST_ENTRY(cursor,Sink,entry)->interfaces.p##type) +#define SINK_FOR_EACH(cursor,list,type,elem) \ + for ((cursor) = (list)->next, elem = SINK_ENTRY(cursor,type); \ + (cursor) != (list); \ + (cursor) = (cursor)->next, elem = SINK_ENTRY(cursor,type)) + +HRESULT advise_sink(struct list *sink_list, REFIID riid, DWORD cookie_magic, IUnknown *unk, DWORD *cookie) DECLSPEC_HIDDEN; +HRESULT unadvise_sink(DWORD cookie) DECLSPEC_HIDDEN; +void free_sinks(struct list *sink_list) DECLSPEC_HIDDEN; + extern const WCHAR szwSystemTIPKey[] DECLSPEC_HIDDEN; extern const WCHAR szwSystemCTFKey[] DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/msctf/threadmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msctf/threadmgr.…
============================================================================== --- trunk/reactos/dll/win32/msctf/threadmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msctf/threadmgr.c [iso-8859-1] Sun Jun 5 19:38:23 2016 @@ -20,20 +20,6 @@ #include "msctf_internal.h" -typedef struct tagThreadMgrSink { - struct list entry; - union { - /* ThreadMgr Sinks */ - IUnknown *pIUnknown; - /* ITfActiveLanguageProfileNotifySink *pITfActiveLanguageProfileNotifySink; */ - /* ITfDisplayAttributeNotifySink *pITfDisplayAttributeNotifySink; */ - /* ITfKeyTraceEventSink *pITfKeyTraceEventSink; */ - /* ITfPreservedKeyNotifySink *pITfPreservedKeyNotifySink; */ - /* ITfThreadFocusSink *pITfThreadFocusSink; */ - ITfThreadMgrEventSink *pITfThreadMgrEventSink; - } interfaces; -} ThreadMgrSink; - typedef struct tagPreservedKey { struct list entry; @@ -77,8 +63,8 @@ ITfDocumentMgr *focus; LONG activationCount; - ITfKeyEventSink *forgroundKeyEventSink; - CLSID forgroundTextService; + ITfKeyEventSink *foregroundKeyEventSink; + CLSID foregroundTextService; struct list CurrentPreservedKeys; struct list CreatedDocumentMgrs; @@ -150,12 +136,6 @@ return CONTAINING_RECORD(iface, EnumTfDocumentMgr, IEnumTfDocumentMgrs_iface); } -static void free_sink(ThreadMgrSink *sink) -{ - IUnknown_Release(sink->interfaces.pIUnknown); - HeapFree(GetProcessHeap(),0,sink); -} - static void ThreadMgr_Destructor(ThreadMgr *This) { struct list *cursor, *cursor2; @@ -169,43 +149,12 @@ if (This->focus) ITfDocumentMgr_Release(This->focus); - /* free sinks */ - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ActiveLanguageProfileNotifySink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->DisplayAttributeNotifySink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->KeyTraceEventSink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->PreservedKeyNotifySink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ThreadFocusSink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - list_remove(cursor); - free_sink(sink); - } - LIST_FOR_EACH_SAFE(cursor, cursor2, &This->ThreadMgrEventSink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - list_remove(cursor); - free_sink(sink); - } + free_sinks(&This->ActiveLanguageProfileNotifySink); + free_sinks(&This->DisplayAttributeNotifySink); + free_sinks(&This->KeyTraceEventSink); + free_sinks(&This->PreservedKeyNotifySink); + free_sinks(&This->ThreadFocusSink); + free_sinks(&This->ThreadMgrEventSink); LIST_FOR_EACH_SAFE(cursor, cursor2, &This->CurrentPreservedKeys) { @@ -636,7 +585,6 @@ REFIID riid, IUnknown *punk, DWORD *pdwCookie) { ThreadMgr *This = impl_from_ITfSource(iface); - ThreadMgrSink *tms; TRACE("(%p) %s %p %p\n",This,debugstr_guid(riid),punk,pdwCookie); @@ -644,47 +592,22 @@ return E_INVALIDARG; if (IsEqualIID(riid, &IID_ITfThreadMgrEventSink)) - { - tms = HeapAlloc(GetProcessHeap(),0,sizeof(ThreadMgrSink)); - if (!tms) - return E_OUTOFMEMORY; - if (FAILED(IUnknown_QueryInterface(punk, riid, (LPVOID *)&tms->interfaces.pITfThreadMgrEventSink))) - { - HeapFree(GetProcessHeap(),0,tms); - return CONNECT_E_CANNOTCONNECT; - } - list_add_head(&This->ThreadMgrEventSink,&tms->entry); - *pdwCookie = generate_Cookie(COOKIE_MAGIC_TMSINK, tms); - } - else - { - FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); - return E_NOTIMPL; - } - - TRACE("cookie %x\n",*pdwCookie); - - return S_OK; + return advise_sink(&This->ThreadMgrEventSink, &IID_ITfThreadMgrEventSink, COOKIE_MAGIC_TMSINK, punk, pdwCookie); + + FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid)); + return E_NOTIMPL; } static HRESULT WINAPI ThreadMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie) { ThreadMgr *This = impl_from_ITfSource(iface); - ThreadMgrSink *sink; TRACE("(%p) %x\n",This,pdwCookie); if (get_Cookie_magic(pdwCookie)!=COOKIE_MAGIC_TMSINK) return E_INVALIDARG; - sink = remove_Cookie(pdwCookie); - if (!sink) - return CONNECT_E_NOCONNECTION; - - list_remove(&sink->entry); - free_sink(sink); - - return S_OK; + return unadvise_sink(pdwCookie); } static const ITfSourceVtbl ThreadMgrSourceVtbl = @@ -745,15 +668,15 @@ if (fForeground) { - if (This->forgroundKeyEventSink) + if (This->foregroundKeyEventSink) { - ITfKeyEventSink_OnSetFocus(This->forgroundKeyEventSink, FALSE); - ITfKeyEventSink_Release(This->forgroundKeyEventSink); + ITfKeyEventSink_OnSetFocus(This->foregroundKeyEventSink, FALSE); + ITfKeyEventSink_Release(This->foregroundKeyEventSink); } ITfKeyEventSink_AddRef(check); ITfKeyEventSink_OnSetFocus(check, TRUE); - This->forgroundKeyEventSink = check; - This->forgroundTextService = textservice; + This->foregroundKeyEventSink = check; + This->foregroundTextService = textservice; } return S_OK; } @@ -781,11 +704,11 @@ set_textservice_sink(tid, &IID_ITfKeyEventSink, NULL); ITfKeyEventSink_Release(check); - if (This->forgroundKeyEventSink == check) - { - ITfKeyEventSink_Release(This->forgroundKeyEventSink); - This->forgroundKeyEventSink = NULL; - This->forgroundTextService = GUID_NULL; + if (This->foregroundKeyEventSink == check) + { + ITfKeyEventSink_Release(This->foregroundKeyEventSink); + This->foregroundKeyEventSink = NULL; + This->foregroundTextService = GUID_NULL; } return S_OK; } @@ -798,10 +721,10 @@ if (!pclsid) return E_INVALIDARG; - if (IsEqualCLSID(&This->forgroundTextService,&GUID_NULL)) + if (IsEqualCLSID(&This->foregroundTextService,&GUID_NULL)) return S_FALSE; - *pclsid = This->forgroundTextService; + *pclsid = This->foregroundTextService; return S_OK; } @@ -810,7 +733,8 @@ { ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface); FIXME("STUB:(%p)\n",This); - return E_NOTIMPL; + *pfEaten = FALSE; + return S_OK; } static HRESULT WINAPI KeystrokeMgr_TestKeyUp(ITfKeystrokeMgr *iface, @@ -818,7 +742,8 @@ { ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface); FIXME("STUB:(%p)\n",This); - return E_NOTIMPL; + *pfEaten = FALSE; + return S_OK; } static HRESULT WINAPI KeystrokeMgr_KeyDown(ITfKeystrokeMgr *iface, @@ -1133,15 +1058,15 @@ static HRESULT WINAPI ThreadMgrEventSink_OnInitDocumentMgr( ITfThreadMgrEventSink *iface,ITfDocumentMgr *pdim) { + ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); + ITfThreadMgrEventSink *sink; struct list *cursor; - ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); TRACE("(%p) %p\n",This,pdim); - LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - ITfThreadMgrEventSink_OnInitDocumentMgr(sink->interfaces.pITfThreadMgrEventSink,pdim); + SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink) + { + ITfThreadMgrEventSink_OnInitDocumentMgr(sink, pdim); } return S_OK; @@ -1150,15 +1075,15 @@ static HRESULT WINAPI ThreadMgrEventSink_OnUninitDocumentMgr( ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdim) { + ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); + ITfThreadMgrEventSink *sink; struct list *cursor; - ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); TRACE("(%p) %p\n",This,pdim); - LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - ITfThreadMgrEventSink_OnUninitDocumentMgr(sink->interfaces.pITfThreadMgrEventSink,pdim); + SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink) + { + ITfThreadMgrEventSink_OnUninitDocumentMgr(sink, pdim); } return S_OK; @@ -1168,15 +1093,15 @@ ITfThreadMgrEventSink *iface, ITfDocumentMgr *pdimFocus, ITfDocumentMgr *pdimPrevFocus) { + ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); + ITfThreadMgrEventSink *sink; struct list *cursor; - ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); TRACE("(%p) %p %p\n",This,pdimFocus, pdimPrevFocus); - LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - ITfThreadMgrEventSink_OnSetFocus(sink->interfaces.pITfThreadMgrEventSink, pdimFocus, pdimPrevFocus); + SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink) + { + ITfThreadMgrEventSink_OnSetFocus(sink, pdimFocus, pdimPrevFocus); } return S_OK; @@ -1185,15 +1110,15 @@ static HRESULT WINAPI ThreadMgrEventSink_OnPushContext( ITfThreadMgrEventSink *iface, ITfContext *pic) { + ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); + ITfThreadMgrEventSink *sink; struct list *cursor; - ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); TRACE("(%p) %p\n",This,pic); - LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - ITfThreadMgrEventSink_OnPushContext(sink->interfaces.pITfThreadMgrEventSink,pic); + SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink) + { + ITfThreadMgrEventSink_OnPushContext(sink, pic); } return S_OK; @@ -1202,15 +1127,15 @@ static HRESULT WINAPI ThreadMgrEventSink_OnPopContext( ITfThreadMgrEventSink *iface, ITfContext *pic) { + ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); + ITfThreadMgrEventSink *sink; struct list *cursor; - ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); TRACE("(%p) %p\n",This,pic); - LIST_FOR_EACH(cursor, &This->ThreadMgrEventSink) - { - ThreadMgrSink* sink = LIST_ENTRY(cursor,ThreadMgrSink,entry); - ITfThreadMgrEventSink_OnPopContext(sink->interfaces.pITfThreadMgrEventSink,pic); + SINK_FOR_EACH(cursor, &This->ThreadMgrEventSink, ITfThreadMgrEventSink, sink) + { + ITfThreadMgrEventSink_OnPopContext(sink, pic); } return S_OK; Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Jun 5 19:38:23 2016 @@ -108,7 +108,7 @@ reactos/dll/win32/mscat32 # Synced to WineStaging-1.9.4 reactos/dll/win32/mscms # Synced to WineStaging-1.9.4 reactos/dll/win32/mscoree # Synced to Wine-1.5.4 -reactos/dll/win32/msctf # Synced to WineStaging-1.9.4 +reactos/dll/win32/msctf # Synced to WineStaging-1.9.11 reactos/dll/win32/msftedit # Synced to WineStaging-1.9.4 reactos/dll/win32/msg711.acm # Synced to WineStaging-1.9.4 reactos/dll/win32/msgsm32.acm # Synced to WineStaging-1.9.4
8 years, 7 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
23
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Results per page:
10
25
50
100
200