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
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
March 2013
----- 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
14 participants
249 discussions
Start a n
N
ew thread
[jgardou] 58581: [DDRAW] * Add CMakeLists.txt
by jgardou@svn.reactos.org
Author: jgardou Date: Fri Mar 22 16:32:11 2013 New Revision: 58581 URL:
http://svn.reactos.org/svn/reactos?rev=58581&view=rev
Log: [DDRAW] * Add CMakeLists.txt Added: trunk/reactos/dll/directx/ddraw/CMakeLists.txt (with props) Added: trunk/reactos/dll/directx/ddraw/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/CMakeLis…
============================================================================== --- trunk/reactos/dll/directx/ddraw/CMakeLists.txt (added) +++ trunk/reactos/dll/directx/ddraw/CMakeLists.txt [iso-8859-1] Fri Mar 22 16:32:11 2013 @@ -1,0 +1,61 @@ + +spec2def(ddraw.dll ddraw.spec ADD_IMPORTLIB) + +list(APPEND SOURCE + cleanup.c + main.c + startup.c + Clipper/clipper_main.c + Clipper/clipper_stubs.c + Color/color_stubs.c + d3d/DirectD3D_main.c + Ddraw/callbacks_dd_hel.c + Ddraw/ddraw_displaymode.c + Ddraw/ddraw_main.c + Ddraw/ddraw_setcooperativelevel.c + Ddraw/ddraw_stubs.c + Ddraw/GetCaps.c + Ddraw/GetDeviceIdentifier.c + Gamma/gamma_stubs.c + Kernel/kernel_stubs.c + Palette/createpalette.c + Palette/palette.c + Surface/callbacks_surf_hel.c + Surface/createsurface.c + Surface/surface_main.c + Surface/surface_stubs.c + Videoport/videoport_stubs.c + Vtable/DirectD3D_Vtable.c + Vtable/DirectD3D2_Vtable.c + Vtable/DirectD3D3_Vtable.c + Vtable/DirectD3D7_Vtable.c + Vtable/DirectDraw_Vtable.c + Vtable/DirectDraw2_Vtable.c + Vtable/DirectDraw4_Vtable.c + Vtable/DirectDraw7_Vtable.c + Vtable/DirectDrawSurface_Vtable.c + Vtable/DirectDrawSurface2_Vtable.c + Vtable/DirectDrawSurface3_Vtable.c + Vtable/DirectDrawSurface4_Vtable.c + Vtable/DirectDrawSurface7_Vtable.c +) + +add_library(ddraw SHARED ${SOURCE}) + +set_module_type(ddraw win32dll) + +target_link_libraries(ddraw + uuid + dxguid + ${PSEH_LIB} +) + +add_importlibs(ddraw + advapi32 + gdi32 + user32 + msvcrt + kernel32 + ntdll) + +add_cd_file(TARGET ddraw DESTINATION reactos/system32 FOR all) Propchange: trunk/reactos/dll/directx/ddraw/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
11 years, 9 months
1
0
0
0
[akhaldi] 58580: [MSXML3_WINETEST] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 16:13:58 2013 New Revision: 58580 URL:
http://svn.reactos.org/svn/reactos?rev=58580&view=rev
Log: [MSXML3_WINETEST] * Sync with Wine 1.5.26. Added: trunk/rostests/winetests/msxml3/httpreq.c (with props) Modified: trunk/rostests/winetests/msxml3/CMakeLists.txt trunk/rostests/winetests/msxml3/domdoc.c trunk/rostests/winetests/msxml3/saxreader.c trunk/rostests/winetests/msxml3/schema.c trunk/rostests/winetests/msxml3/testlist.c trunk/rostests/winetests/msxml3/xmldoc.c trunk/rostests/winetests/msxml3/xmlparser.c trunk/rostests/winetests/msxml3/xmlview.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/msxml3/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/CMakeLis…
Modified: trunk/rostests/winetests/msxml3/domdoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/domdoc.c…
Added: trunk/rostests/winetests/msxml3/httpreq.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/httpreq.…
Modified: trunk/rostests/winetests/msxml3/saxreader.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/saxreade…
Modified: trunk/rostests/winetests/msxml3/schema.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/schema.c…
Modified: trunk/rostests/winetests/msxml3/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/testlist…
Modified: trunk/rostests/winetests/msxml3/xmldoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/xmldoc.c…
Modified: trunk/rostests/winetests/msxml3/xmlparser.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/xmlparse…
Modified: trunk/rostests/winetests/msxml3/xmlview.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msxml3/xmlview.…
11 years, 9 months
1
0
0
0
[akhaldi] 58579: [MSXML3] * Sync with Wine 1.5.26.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 16:13:43 2013 New Revision: 58579 URL:
http://svn.reactos.org/svn/reactos?rev=58579&view=rev
Log: [MSXML3] * Sync with Wine 1.5.26. Modified: trunk/reactos/dll/win32/msxml3/attribute.c trunk/reactos/dll/win32/msxml3/cdata.c trunk/reactos/dll/win32/msxml3/dispex.c trunk/reactos/dll/win32/msxml3/domdoc.c trunk/reactos/dll/win32/msxml3/element.c trunk/reactos/dll/win32/msxml3/factory.c trunk/reactos/dll/win32/msxml3/httprequest.c trunk/reactos/dll/win32/msxml3/main.c 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/nodelist.c trunk/reactos/dll/win32/msxml3/saxreader.c trunk/reactos/dll/win32/msxml3/schema.c trunk/reactos/dll/win32/msxml3/text.c trunk/reactos/dll/win32/msxml3/xmlparser.c trunk/reactos/dll/win32/msxml3/xslpattern.l trunk/reactos/dll/win32/msxml3/xslpattern.yy.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/msxml3/attribute.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/attribute…
============================================================================== --- trunk/reactos/dll/win32/msxml3/attribute.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/attribute.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -606,7 +606,7 @@ TRACE("(%p)->(%s)\n", This, debugstr_variant(&value)); - return node_put_value(&This->node, &value); + return node_put_value_escaped(&This->node, &value); } static const struct IXMLDOMAttributeVtbl domattr_vtbl = Modified: trunk/reactos/dll/win32/msxml3/cdata.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/cdata.c?r…
============================================================================== --- trunk/reactos/dll/win32/msxml3/cdata.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/cdata.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -293,10 +293,9 @@ IXMLDOMNode** outOldNode) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - - FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode); - - return node_insert_before(&This->node, newNode, &refChild, outOldNode); + TRACE("(%p)->(%p %s %p)\n", This, newNode, debugstr_variant(&refChild), outOldNode); + if (outOldNode) *outOldNode = NULL; + return E_FAIL; } static HRESULT WINAPI domcdata_replaceChild( @@ -306,10 +305,9 @@ IXMLDOMNode** outOldNode) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - - FIXME("(%p)->(%p %p %p) needs tests\n", This, newNode, oldNode, outOldNode); - - return node_replace_child(&This->node, newNode, oldNode, outOldNode); + TRACE("(%p)->(%p %p %p)\n", This, newNode, oldNode, outOldNode); + if (outOldNode) *outOldNode = NULL; + return E_FAIL; } static HRESULT WINAPI domcdata_removeChild( @@ -318,7 +316,8 @@ { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); TRACE("(%p)->(%p %p)\n", This, child, oldChild); - return node_remove_child(&This->node, child, oldChild); + if (oldChild) *oldChild = NULL; + return E_FAIL; } static HRESULT WINAPI domcdata_appendChild( @@ -327,7 +326,8 @@ { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); TRACE("(%p)->(%p %p)\n", This, child, outChild); - return node_append_child(&This->node, child, outChild); + if (outChild) *outChild = NULL; + return E_FAIL; } static HRESULT WINAPI domcdata_hasChildNodes( Modified: trunk/reactos/dll/win32/msxml3/dispex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/dispex.c?…
============================================================================== --- trunk/reactos/dll/win32/msxml3/dispex.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/dispex.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -601,6 +601,7 @@ hres = IUnknown_QueryInterface(This->outer, get_riid_from_tid(data->funcs[n].tid), (void**)&unk); if(FAILED(hres)) { ERR("Could not get iface: %08x\n", hres); + ITypeInfo_Release(ti); return E_FAIL; } Modified: trunk/reactos/dll/win32/msxml3/domdoc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/domdoc.c?…
============================================================================== --- trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -134,9 +134,6 @@ domdoc_properties* properties; bsc_t *bsc; HRESULT error; - - /* IPersistStream */ - IStream *stream; /* IObjectWithSite*/ IUnknown *site; @@ -559,19 +556,28 @@ priv_from_xmlDocPtr(doc)->properties = create_properties(version); } -LONG xmldoc_add_ref(xmlDocPtr doc) -{ - LONG ref = InterlockedIncrement(&priv_from_xmlDocPtr(doc)->refs); +LONG xmldoc_add_refs(xmlDocPtr doc, LONG refs) +{ + LONG ref = InterlockedExchangeAdd(&priv_from_xmlDocPtr(doc)->refs, refs) + refs; TRACE("(%p)->(%d)\n", doc, ref); return ref; } -LONG xmldoc_release(xmlDocPtr doc) +LONG xmldoc_add_ref(xmlDocPtr doc) +{ + return xmldoc_add_refs(doc, 1); +} + +LONG xmldoc_release_refs(xmlDocPtr doc, LONG refs) { xmldoc_priv *priv = priv_from_xmlDocPtr(doc); - LONG ref = InterlockedDecrement(&priv->refs); + LONG ref = InterlockedExchangeAdd(&priv->refs, -refs) - refs; TRACE("(%p)->(%d)\n", doc, ref); - if(ref == 0) + + if (ref < 0) + WARN("negative refcount, expect troubles\n"); + + if (ref == 0) { orphan_entry *orphan, *orphan2; TRACE("freeing docptr %p\n", doc); @@ -590,6 +596,11 @@ return ref; } +LONG xmldoc_release(xmlDocPtr doc) +{ + return xmldoc_release_refs(doc, 1); +} + HRESULT xmldoc_add_orphan(xmlDocPtr doc, xmlNodePtr node) { xmldoc_priv *priv = priv_from_xmlDocPtr(doc); @@ -624,7 +635,7 @@ static inline xmlDocPtr get_doc( domdoc *This ) { - return (xmlDocPtr)This->node.node; + return This->node.node->doc; } static HRESULT attach_xmldoc(domdoc *This, xmlDocPtr xml ) @@ -721,46 +732,42 @@ return S_FALSE; } -static HRESULT WINAPI PersistStreamInit_Load( - IPersistStreamInit *iface, LPSTREAM pStm) -{ - domdoc *This = impl_from_IPersistStreamInit(iface); +static HRESULT domdoc_load_from_stream(domdoc *doc, ISequentialStream *stream) +{ + DWORD read, written, len; + xmlDocPtr xmldoc = NULL; + IStream *hstream; + HGLOBAL hglobal; + BYTE buf[4096]; HRESULT hr; - HGLOBAL hglobal; - DWORD read, written, len; - BYTE buf[4096]; char *ptr; - xmlDocPtr xmldoc = NULL; - - TRACE("(%p)->(%p)\n", This, pStm); - - if (!pStm) - return E_INVALIDARG; - - hr = CreateStreamOnHGlobal(NULL, TRUE, &This->stream); + + hstream = NULL; + hr = CreateStreamOnHGlobal(NULL, TRUE, &hstream); if (FAILED(hr)) return hr; do { - IStream_Read(pStm, buf, sizeof(buf), &read); - hr = IStream_Write(This->stream, buf, read, &written); + ISequentialStream_Read(stream, buf, sizeof(buf), &read); + hr = IStream_Write(hstream, buf, read, &written); } while(SUCCEEDED(hr) && written != 0 && read != 0); if (FAILED(hr)) { - ERR("Failed to copy stream\n"); + ERR("failed to copy stream 0x%08x\n", hr); + IStream_Release(hstream); return hr; } - hr = GetHGlobalFromStream(This->stream, &hglobal); + hr = GetHGlobalFromStream(hstream, &hglobal); if (FAILED(hr)) return hr; len = GlobalSize(hglobal); ptr = GlobalLock(hglobal); - if (len != 0) - xmldoc = doparse(This, ptr, len, XML_CHAR_ENCODING_NONE); + if (len) + xmldoc = doparse(doc, ptr, len, XML_CHAR_ENCODING_NONE); GlobalUnlock(hglobal); if (!xmldoc) @@ -771,7 +778,19 @@ xmldoc->_private = create_priv(); - return attach_xmldoc(This, xmldoc); + return attach_xmldoc(doc, xmldoc); +} + +static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream *stream) +{ + domdoc *This = impl_from_IPersistStreamInit(iface); + + TRACE("(%p)->(%p)\n", This, stream); + + if (!stream) + return E_INVALIDARG; + + return domdoc_load_from_stream(This, (ISequentialStream*)stream); } static HRESULT WINAPI PersistStreamInit_Save( @@ -801,7 +820,7 @@ IPersistStreamInit *iface, ULARGE_INTEGER *pcbSize) { domdoc *This = impl_from_IPersistStreamInit(iface); - TRACE("(%p)->(%p): stub!\n", This, pcbSize); + TRACE("(%p)->(%p)\n", This, pcbSize); return E_NOTIMPL; } @@ -914,8 +933,6 @@ if (This->site) IUnknown_Release( This->site ); destroy_xmlnode(&This->node); - if (This->stream) - IStream_Release(This->stream); for (eid = 0; eid < EVENTID_LAST; eid++) if (This->events[eid]) IDispatch_Release(This->events[eid]); @@ -1115,12 +1132,26 @@ IXMLDOMNode** outNewChild ) { domdoc *This = impl_from_IXMLDOMDocument3( iface ); + DOMNodeType type; + HRESULT hr; TRACE("(%p)->(%p %s %p)\n", This, newChild, debugstr_variant(&refChild), outNewChild); - return node_insert_before(&This->node, newChild, &refChild, outNewChild); -} - + hr = IXMLDOMNode_get_nodeType(newChild, &type); + if (hr != S_OK) return hr; + + TRACE("new node type %d\n", type); + switch (type) + { + case NODE_ATTRIBUTE: + case NODE_DOCUMENT: + case NODE_CDATA_SECTION: + if (outNewChild) *outNewChild = NULL; + return E_FAIL; + default: + return node_insert_before(&This->node, newChild, &refChild, outNewChild); + } +} static HRESULT WINAPI domdoc_replaceChild( IXMLDOMDocument3 *iface, @@ -1510,7 +1541,9 @@ domdoc *This = impl_from_IXMLDOMDocument3( iface ); IXMLDOMNode *elementNode; xmlNodePtr oldRoot; + xmlDocPtr old_doc; xmlnode *xmlNode; + int refcount = 0; HRESULT hr; TRACE("(%p)->(%p)\n", This, DOMElement); @@ -1526,7 +1559,14 @@ if(xmldoc_remove_orphan(xmlNode->node->doc, xmlNode->node) != S_OK) WARN("%p is not an orphan of %p\n", xmlNode->node->doc, xmlNode->node); + old_doc = xmlNode->node->doc; + if (old_doc != get_doc(This)) + refcount = xmlnode_get_inst_cnt(xmlNode); + + /* old root is still orphaned by its document, update refcount from new root */ + if (refcount) xmldoc_add_refs(get_doc(This), refcount); oldRoot = xmlDocSetRootElement( get_doc(This), xmlNode->node); + if (refcount) xmldoc_release_refs(old_doc, refcount); IXMLDOMNode_Release( elementNode ); if(oldRoot) @@ -2029,8 +2069,6 @@ domdoc *This = impl_from_IXMLDOMDocument3( iface ); LPWSTR filename = NULL; HRESULT hr = S_FALSE; - IXMLDOMDocument3 *pNewDoc = NULL; - IStream *pStream = NULL; xmlDocPtr xmldoc; TRACE("(%p)->(%s)\n", This, debugstr_variant(&source)); @@ -2096,13 +2134,18 @@ } break; case VT_UNKNOWN: + { + ISequentialStream *stream = NULL; + IXMLDOMDocument3 *newdoc = NULL; + if (!V_UNKNOWN(&source)) return E_INVALIDARG; - hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IXMLDOMDocument3, (void**)&pNewDoc); + + hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IXMLDOMDocument3, (void**)&newdoc); if(hr == S_OK) { - if(pNewDoc) + if(newdoc) { - domdoc *newDoc = impl_from_IXMLDOMDocument3( pNewDoc ); + domdoc *newDoc = impl_from_IXMLDOMDocument3( newdoc ); xmldoc = xmlCopyDoc(get_doc(newDoc), 1); xmldoc->_private = create_priv(); @@ -2114,40 +2157,25 @@ return hr; } } - hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IStream, (void**)&pStream); - if(hr == S_OK) + + hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_IStream, (void**)&stream); + if (FAILED(hr)) + hr = IUnknown_QueryInterface(V_UNKNOWN(&source), &IID_ISequentialStream, (void**)&stream); + + if (hr == S_OK) { - IPersistStream *pDocStream; - hr = IXMLDOMDocument3_QueryInterface(iface, &IID_IPersistStream, (void**)&pDocStream); - if(hr == S_OK) - { - hr = IPersistStream_Load(pDocStream, pStream); - IStream_Release(pStream); - if(hr == S_OK) - { - *isSuccessful = VARIANT_TRUE; - - TRACE("Using IStream to load Document\n"); - return S_OK; - } - else - { - ERR("xmldoc_IPersistStream_Load failed (%d)\n", hr); - } - } - else - { - ERR("QueryInterface IID_IPersistStream failed (%d)\n", hr); - } + hr = domdoc_load_from_stream(This, stream); + if (hr == S_OK) + *isSuccessful = VARIANT_TRUE; + ISequentialStream_Release(stream); + return hr; } - else - { - /* ISequentialStream */ - FIXME("Unknown type not supported (%d) (%p)(%p)\n", hr, pNewDoc, V_UNKNOWN(&source)->lpVtbl); - } + + FIXME("unsupported IUnknown type (0x%08x) (%p)\n", hr, V_UNKNOWN(&source)->lpVtbl); break; - default: - FIXME("VT type not supported (%d)\n", V_VT(&source)); + } + default: + FIXME("VT type not supported (%d)\n", V_VT(&source)); } if ( filename ) @@ -3251,12 +3279,43 @@ return S_OK; } -static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink, - DWORD *pdwCookie) +static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *unk_sink, + DWORD *cookie) { ConnectionPoint *This = impl_from_IConnectionPoint(iface); - FIXME("(%p)->(%p %p): stub\n", This, pUnkSink, pdwCookie); - return E_NOTIMPL; + IUnknown *sink; + HRESULT hr; + DWORD i; + + TRACE("(%p)->(%p %p)\n", This, unk_sink, cookie); + + hr = IUnknown_QueryInterface(unk_sink, This->iid, (void**)&sink); + if(FAILED(hr) && !IsEqualGUID(&IID_IPropertyNotifySink, This->iid)) + hr = IUnknown_QueryInterface(unk_sink, &IID_IDispatch, (void**)&sink); + if(FAILED(hr)) + return CONNECT_E_CANNOTCONNECT; + + if(This->sinks) + { + for (i = 0; i < This->sinks_size; i++) + if (!This->sinks[i].unk) + break; + + if (i == This->sinks_size) + This->sinks = heap_realloc(This->sinks,(++This->sinks_size)*sizeof(*This->sinks)); + } + else + { + This->sinks = heap_alloc(sizeof(*This->sinks)); + This->sinks_size = 1; + i = 0; + } + + This->sinks[i].unk = sink; + if (cookie) + *cookie = i+1; + + return S_OK; } static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD cookie) @@ -3466,7 +3525,6 @@ doc->resolving = 0; doc->properties = properties_from_xmlDocPtr(xmldoc); doc->error = S_OK; - doc->stream = NULL; doc->site = NULL; doc->safeopt = 0; doc->bsc = NULL; Modified: trunk/reactos/dll/win32/msxml3/element.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/element.c…
============================================================================== --- trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -304,13 +304,29 @@ static HRESULT WINAPI domelem_insertBefore( IXMLDOMElement *iface, IXMLDOMNode* newNode, VARIANT refChild, - IXMLDOMNode** outOldNode) -{ - domelem *This = impl_from_IXMLDOMElement( iface ); - - TRACE("(%p)->(%p %s %p)\n", This, newNode, debugstr_variant(&refChild), outOldNode); - - return node_insert_before(&This->node, newNode, &refChild, outOldNode); + IXMLDOMNode** old_node) +{ + domelem *This = impl_from_IXMLDOMElement( iface ); + DOMNodeType type; + HRESULT hr; + + TRACE("(%p)->(%p %s %p)\n", This, newNode, debugstr_variant(&refChild), old_node); + + hr = IXMLDOMNode_get_nodeType(newNode, &type); + if (hr != S_OK) return hr; + + TRACE("new node type %d\n", type); + switch (type) + { + case NODE_DOCUMENT: + case NODE_DOCUMENT_TYPE: + case NODE_ENTITY: + case NODE_NOTATION: + if (old_node) *old_node = NULL; + return E_FAIL; + default: + return node_insert_before(&This->node, newNode, &refChild, old_node); + } } static HRESULT WINAPI domelem_replaceChild( @@ -739,7 +755,7 @@ { static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; const BYTE *d = buf; - int bytes, pad_bytes, div, i; + int bytes, pad_bytes, div; DWORD needed; WCHAR *ptr; @@ -756,7 +772,6 @@ div = len / 3; ptr = *ret; - i = 0; while (div > 0) { /* first char is the first 6 bits of the first byte*/ @@ -769,7 +784,6 @@ *ptr++ = b64[ ((d[1] << 2) & 0x3c) | (d[2] >> 6 & 0x03)]; /* fourth char is the remaining 6 bits of the third byte */ *ptr++ = b64[ d[2] & 0x3f]; - i += 4; d += 3; div--; } @@ -1232,8 +1246,7 @@ domelem *This = impl_from_IXMLDOMElement( iface ); xmlChar *xml_name, *xml_value, *local, *prefix; xmlNodePtr element; - HRESULT hr; - VARIANT var; + HRESULT hr = S_OK; TRACE("(%p)->(%s %s)\n", This, debugstr_w(name), debugstr_variant(&value)); @@ -1241,16 +1254,25 @@ if ( !element ) return E_FAIL; - VariantInit(&var); - hr = VariantChangeType(&var, &value, 0, VT_BSTR); - if(hr != S_OK) - { - FIXME("VariantChangeType failed\n"); - return hr; - } + if (V_VT(&value) != VT_BSTR) + { + VARIANT var; + + VariantInit(&var); + hr = VariantChangeType(&var, &value, 0, VT_BSTR); + if (hr != S_OK) + { + FIXME("VariantChangeType failed\n"); + return hr; + } + + xml_value = xmlchar_from_wchar(V_BSTR(&var)); + VariantClear(&var); + } + else + xml_value = xmlchar_from_wchar(V_BSTR(&value)); xml_name = xmlchar_from_wchar( name ); - xml_value = xmlchar_from_wchar( V_BSTR(&var) ); if ((local = xmlSplitQName2(xml_name, &prefix))) { @@ -1273,7 +1295,6 @@ heap_free(xml_value); heap_free(xml_name); - VariantClear(&var); return hr; } Modified: trunk/reactos/dll/win32/msxml3/factory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/factory.c…
============================================================================== --- trunk/reactos/dll/win32/msxml3/factory.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/factory.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -101,7 +101,7 @@ static MSXML_VERSION get_msxml_version(const GUID *clsid) { - int i; + unsigned int i; for (i = 0; i < sizeof(clsid_versions_table)/sizeof(struct clsid_version_t); i++) if (IsEqualGUID(clsid, clsid_versions_table[i].clsid)) Modified: trunk/reactos/dll/win32/msxml3/httprequest.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/httpreque…
============================================================================== --- trunk/reactos/dll/win32/msxml3/httprequest.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/httprequest.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -85,8 +85,8 @@ /* request */ BINDVERB verb; BSTR custom; - BSTR siteurl; - BSTR url; + IUri *uri; + IUri *base_uri; BOOL async; struct list reqheaders; /* cached resulting custom request headers string length in WCHARs */ @@ -144,8 +144,16 @@ static void httprequest_setreadystate(httprequest *This, READYSTATE state) { READYSTATE last = This->state; + static const char* readystates[] = { + "READYSTATE_UNINITIALIZED", + "READYSTATE_LOADING", + "READYSTATE_LOADED", + "READYSTATE_INTERACTIVE", + "READYSTATE_COMPLETE"}; This->state = state; + + TRACE("state %s\n", readystates[state]); if (This->sink && last != state) { @@ -209,6 +217,7 @@ if (bsc) { if (bsc->binding) IBinding_Abort(bsc->binding); + bsc->request->bsc = NULL; bsc->request = NULL; IBindStatusCallback_Release(&bsc->IBindStatusCallback_iface); } @@ -343,7 +352,11 @@ } if (hr == S_OK) + { + BindStatusCallback_Detach(This->request->bsc); + This->request->bsc = This; httprequest_setreadystate(This->request, READYSTATE_COMPLETE); + } return S_OK; } @@ -688,22 +701,27 @@ case VT_ARRAY|VT_UI1: { sa = V_ARRAY(body); - if ((hr = SafeArrayAccessData(sa, (void **)&ptr)) != S_OK) return hr; + if ((hr = SafeArrayAccessData(sa, (void **)&ptr)) != S_OK) + { + heap_free(bsc); + return hr; + } if ((hr = SafeArrayGetUBound(sa, 1, &size) != S_OK)) { SafeArrayUnaccessData(sa); + heap_free(bsc); return hr; } size++; break; } + default: + FIXME("unsupported body data type %d\n", V_VT(body)); + /* fall through */ case VT_EMPTY: case VT_ERROR: ptr = NULL; size = 0; - break; - default: - FIXME("unsupported body data type %d\n", V_VT(body)); break; } @@ -734,7 +752,7 @@ { IMoniker *moniker; - hr = CreateURLMoniker(NULL, This->url, &moniker); + hr = CreateURLMonikerEx2(NULL, This->uri, &moniker, URL_MK_UNIFORM); if (hr == S_OK) { IStream *stream; @@ -753,6 +771,53 @@ } *obj = bsc; + return hr; +} + +static HRESULT verify_uri(httprequest *This, IUri *uri) +{ + DWORD scheme, base_scheme; + BSTR host, base_host; + HRESULT hr; + + if(!(This->safeopt & INTERFACESAFE_FOR_UNTRUSTED_DATA)) + return S_OK; + + if(!This->base_uri) + return E_ACCESSDENIED; + + hr = IUri_GetScheme(uri, &scheme); + if(FAILED(hr)) + return hr; + + hr = IUri_GetScheme(This->base_uri, &base_scheme); + if(FAILED(hr)) + return hr; + + if(scheme != base_scheme) { + WARN("Schemes don't match\n"); + return E_ACCESSDENIED; + } + + if(scheme == INTERNET_SCHEME_UNKNOWN) { + FIXME("Unknown scheme\n"); + return E_ACCESSDENIED; + } + + hr = IUri_GetHost(uri, &host); + if(FAILED(hr)) + return hr; + + hr = IUri_GetHost(This->base_uri, &base_host); + if(SUCCEEDED(hr)) { + if(strcmpiW(host, base_host)) { + WARN("Hosts don't match\n"); + hr = E_ACCESSDENIED; + } + SysFreeString(base_host); + } + + SysFreeString(host); return hr; } @@ -765,15 +830,20 @@ static const WCHAR MethodDeleteW[] = {'D','E','L','E','T','E',0}; static const WCHAR MethodPropFindW[] = {'P','R','O','P','F','I','N','D',0}; VARIANT str, is_async; + IUri *uri; HRESULT hr; if (!method || !url) return E_INVALIDARG; /* free previously set data */ - SysFreeString(This->url); + if(This->uri) { + IUri_Release(This->uri); + This->uri = NULL; + } + SysFreeString(This->user); SysFreeString(This->password); - This->url = This->user = This->password = NULL; + This->user = This->password = NULL; if (!strcmpiW(method, MethodGetW)) { @@ -800,22 +870,22 @@ return E_FAIL; } - /* try to combine with site url */ - if (This->siteurl && PathIsRelativeW(url)) - { - DWORD len = INTERNET_MAX_URL_LENGTH; - WCHAR *fullW = heap_alloc(len*sizeof(WCHAR)); - - hr = UrlCombineW(This->siteurl, url, fullW, &len, 0); - if (hr == S_OK) - { - TRACE("combined url %s\n", debugstr_w(fullW)); - This->url = SysAllocString(fullW); - } - heap_free(fullW); - } + if(This->base_uri) + hr = CoInternetCombineUrlEx(This->base_uri, url, 0, &uri, 0); else - This->url = SysAllocString(url); + hr = CreateUri(url, 0, 0, &uri); + if(FAILED(hr)) { + WARN("Could not create IUri object: %08x\n", hr); + return hr; + } + + hr = verify_uri(This, uri); + if(FAILED(hr)) { + IUri_Release(uri); + return hr; + } + + This->uri = uri; VariantInit(&is_async); hr = VariantChangeType(&is_async, &async, 0, VT_BOOL); @@ -881,7 +951,8 @@ { struct httpheader *entry; - if (!header || !value) return E_INVALIDARG; + if (!header) return E_INVALIDARG; + if (!value) return E_POINTER; if (This->raw_respheaders && list_empty(&This->respheaders)) { @@ -915,7 +986,7 @@ static HRESULT httprequest_getAllResponseHeaders(httprequest *This, BSTR *respheaders) { - if (!respheaders) return E_INVALIDARG; + if (!respheaders) return E_POINTER; *respheaders = SysAllocString(This->raw_respheaders); @@ -930,18 +1001,16 @@ if (This->state != READYSTATE_LOADING) return E_FAIL; hr = BindStatusCallback_create(This, &bsc, &body); - if (FAILED(hr)) return hr; - + if (FAILED(hr)) + /* success path to detach it is OnStopBinding call */ + BindStatusCallback_Detach(bsc); + + return hr; +} + +static HRESULT httprequest_abort(httprequest *This) +{ BindStatusCallback_Detach(This->bsc); - This->bsc = bsc; - - return hr; -} - -static HRESULT httprequest_abort(httprequest *This) -{ - BindStatusCallback_Detach(This->bsc); - This->bsc = NULL; httprequest_setreadystate(This, READYSTATE_UNINITIALIZED); @@ -950,17 +1019,16 @@ static HRESULT httprequest_get_status(httprequest *This, LONG *status) { - if (!status) return E_INVALIDARG; - if (This->state != READYSTATE_COMPLETE) return E_FAIL; + if (!status) return E_POINTER; *status = This->status; - return S_OK; + return This->state == READYSTATE_COMPLETE ? S_OK : E_FAIL; } static HRESULT httprequest_get_statusText(httprequest *This, BSTR *status) { - if (!status) return E_INVALIDARG; + if (!status) return E_POINTER; if (This->state != READYSTATE_COMPLETE) return E_FAIL; *status = SysAllocString(This->status_text); @@ -973,7 +1041,7 @@ HGLOBAL hglobal; HRESULT hr; - if (!body) return E_INVALIDARG; + if (!body) return E_POINTER; if (This->state != READYSTATE_COMPLETE) return E_FAIL; hr = GetHGlobalFromStream(This->bsc->stream, &hglobal); @@ -1119,7 +1187,7 @@ static HRESULT httprequest_get_readyState(httprequest *This, LONG *state) { - if (!state) return E_INVALIDARG; + if (!state) return E_POINTER; *state = This->state; return S_OK; @@ -1139,10 +1207,12 @@ if (This->site) IUnknown_Release( This->site ); + if (This->uri) + IUri_Release(This->uri); + if (This->base_uri) + IUri_Release(This->base_uri); SysFreeString(This->custom); - SysFreeString(This->siteurl); - SysFreeString(This->url); SysFreeString(This->user); SysFreeString(This->password); @@ -1442,37 +1512,55 @@ return IUnknown_QueryInterface( This->site, iid, ppvSite ); } +static void get_base_uri(httprequest *This) +{ + IServiceProvider *provider; + IHTMLDocument2 *doc; + IUri *uri; + BSTR url; + HRESULT hr; + + hr = IUnknown_QueryInterface(This->site, &IID_IServiceProvider, (void**)&provider); + if(FAILED(hr)) + return; + + hr = IServiceProvider_QueryService(provider, &SID_SContainerDispatch, &IID_IHTMLDocument2, (void**)&doc); + IServiceProvider_Release(provider); + if(FAILED(hr)) + return; + + hr = IHTMLDocument2_get_URL(doc, &url); + IHTMLDocument2_Release(doc); + if(FAILED(hr) || !url || !*url) + return; + + TRACE("host url %s\n", debugstr_w(url)); + + hr = CreateUri(url, 0, 0, &uri); + SysFreeString(url); + if(FAILED(hr)) + return; + + This->base_uri = uri; +} + static HRESULT WINAPI httprequest_ObjectWithSite_SetSite( IObjectWithSite *iface, IUnknown *punk ) { httprequest *This = impl_from_IObjectWithSite(iface); - IServiceProvider *provider; - HRESULT hr; - - TRACE("(%p)->(%p)\n", iface, punk); - - if (punk) - IUnknown_AddRef( punk ); + + TRACE("(%p)->(%p)\n", This, punk); if(This->site) IUnknown_Release( This->site ); + if(This->base_uri) + IUri_Release(This->base_uri); This->site = punk; - hr = IUnknown_QueryInterface(This->site, &IID_IServiceProvider, (void**)&provider); - if (hr == S_OK) - { - IHTMLDocument2 *doc; - - hr = IServiceProvider_QueryService(provider, &SID_SContainerDispatch, &IID_IHTMLDocument2, (void**)&doc); - if (hr == S_OK) - { - SysFreeString(This->siteurl); - - hr = IHTMLDocument2_get_URL(doc, &This->siteurl); - IHTMLDocument2_Release(doc); - TRACE("host url %s, 0x%08x\n", debugstr_w(This->siteurl), hr); - } - IServiceProvider_Release(provider); + if (punk) + { + IUnknown_AddRef( punk ); + get_base_uri(This); } return S_OK; @@ -1826,7 +1914,8 @@ req->async = FALSE; req->verb = -1; req->custom = NULL; - req->url = req->siteurl = req->user = req->password = NULL; + req->uri = req->base_uri = NULL; + req->user = req->password = NULL; req->state = READYSTATE_UNINITIALIZED; req->sink = NULL; Modified: trunk/reactos/dll/win32/msxml3/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/main.c?re…
============================================================================== --- trunk/reactos/dll/win32/msxml3/main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/main.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -276,6 +276,8 @@ return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v)); case VT_I4: return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v)); + case VT_INT: + return wine_dbg_sprintf("{VT_INT: %d}", V_INT(v)); case VT_R8: return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v)); case VT_BSTR: 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] Fri Mar 22 16:13:43 2013 @@ -194,7 +194,8 @@ size = (strlenW(str)+1)*sizeof(WCHAR); ret = heap_alloc(size); - memcpy(ret, str, size); + if(ret) + memcpy(ret, str, size); } return ret; @@ -291,6 +292,9 @@ extern void xmldoc_init( xmlDocPtr doc, MSXML_VERSION version ) DECLSPEC_HIDDEN; extern LONG xmldoc_add_ref( xmlDocPtr doc ) DECLSPEC_HIDDEN; 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 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; extern void xmldoc_link_xmldecl(xmlDocPtr doc, xmlNodePtr node) DECLSPEC_HIDDEN; @@ -404,6 +408,21 @@ return xmlchar_from_wcharn(str, -1); } +static inline xmlChar *heap_strdupxmlChar(const xmlChar *str) +{ + xmlChar *ret = NULL; + + if(str) { + DWORD size; + + size = (xmlStrlen(str)+1)*sizeof(xmlChar); + ret = heap_alloc(size); + memcpy(ret, str, size); + } + + return ret; +} + #endif static inline HRESULT return_bstr(const WCHAR *value, BSTR *p) 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] Fri Mar 22 16:13:43 2013 @@ -291,7 +291,9 @@ return hr; } - if (ret->code_page == CP_UTF8) { + /* 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); 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] Fri Mar 22 16:13:43 2013 @@ -285,36 +285,48 @@ HRESULT node_put_value(xmlnode *This, VARIANT *value) { - VARIANT string_value; HRESULT hr; - VariantInit(&string_value); - hr = VariantChangeType(&string_value, value, 0, VT_BSTR); - if(FAILED(hr)) { - WARN("Couldn't convert to VT_BSTR\n"); - return hr; - } - - hr = node_set_content(This, V_BSTR(&string_value)); - VariantClear(&string_value); + if (V_VT(value) != VT_BSTR) + { + VARIANT string_value; + + VariantInit(&string_value); + hr = VariantChangeType(&string_value, value, 0, VT_BSTR); + if(FAILED(hr)) { + WARN("Couldn't convert to VT_BSTR\n"); + return hr; + } + + hr = node_set_content(This, V_BSTR(&string_value)); + VariantClear(&string_value); + } + else + hr = node_set_content(This, V_BSTR(value)); return hr; } HRESULT node_put_value_escaped(xmlnode *This, VARIANT *value) { - VARIANT string_value; HRESULT hr; - VariantInit(&string_value); - hr = VariantChangeType(&string_value, value, 0, VT_BSTR); - if(FAILED(hr)) { - WARN("Couldn't convert to VT_BSTR\n"); - return hr; - } - - hr = node_set_content_escaped(This, V_BSTR(&string_value)); - VariantClear(&string_value); + if (V_VT(value) != VT_BSTR) + { + VARIANT string_value; + + VariantInit(&string_value); + hr = VariantChangeType(&string_value, value, 0, VT_BSTR); + if(FAILED(hr)) { + WARN("Couldn't convert to VT_BSTR\n"); + return hr; + } + + hr = node_set_content_escaped(This, V_BSTR(&string_value)); + VariantClear(&string_value); + } + else + hr = node_set_content_escaped(This, V_BSTR(value)); return hr; } @@ -377,11 +389,45 @@ return get_node(This, "next", This->node->next, ret); } +static int node_get_inst_cnt(xmlNodePtr node) +{ + int ret = *(LONG *)&node->_private; + xmlNodePtr child; + + /* add attribute counts */ + if (node->type == XML_ELEMENT_NODE) + { + xmlAttrPtr prop = node->properties; + + while (prop) + { + ret += node_get_inst_cnt((xmlNodePtr)prop); + prop = prop->next; + } + } + + /* add children counts */ + child = node->children; + while (child) + { + ret += node_get_inst_cnt(child); + child = child->next; + } + + return ret; +} + +int xmlnode_get_inst_cnt(xmlnode *node) +{ + return node_get_inst_cnt(node->node); +} + HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT *ref_child, IXMLDOMNode **ret) { IXMLDOMNode *before = NULL; xmlnode *node_obj; + int refcount = 0; xmlDocPtr doc; HRESULT hr; @@ -417,12 +463,34 @@ if(xmldoc_remove_orphan(node_obj->node->doc, node_obj->node) != S_OK) WARN("%p is not an orphan of %p\n", node_obj->node, node_obj->node->doc); + refcount = xmlnode_get_inst_cnt(node_obj); + if(before) { xmlnode *before_node_obj = get_node_obj(before); IXMLDOMNode_Release(before); if(!before_node_obj) return E_FAIL; + /* unlink from current parent first */ + if(node_obj->parent) + { + hr = IXMLDOMNode_removeChild(node_obj->parent, node_obj->iface, NULL); + if (hr == S_OK) xmldoc_remove_orphan(node_obj->node->doc, node_obj->node); + } + + doc = node_obj->node->doc; + + /* refs count including subtree */ + if (doc != before_node_obj->node->doc) + refcount = xmlnode_get_inst_cnt(node_obj); + + if (refcount) xmldoc_add_refs(before_node_obj->node->doc, refcount); + xmlAddPrevSibling(before_node_obj->node, node_obj->node); + if (refcount) xmldoc_release_refs(doc, refcount); + node_obj->parent = This->parent; + } + else + { /* unlink from current parent first */ if(node_obj->parent) { @@ -430,25 +498,15 @@ if (hr == S_OK) xmldoc_remove_orphan(node_obj->node->doc, node_obj->node); } doc = node_obj->node->doc; - xmldoc_add_ref(before_node_obj->node->doc); - xmlAddPrevSibling(before_node_obj->node, node_obj->node); - xmldoc_release(doc); - node_obj->parent = This->parent; - } - else - { - /* unlink from current parent first */ - if(node_obj->parent) - { - hr = IXMLDOMNode_removeChild(node_obj->parent, node_obj->iface, NULL); - if (hr == S_OK) xmldoc_remove_orphan(node_obj->node->doc, node_obj->node); - } - doc = node_obj->node->doc; - xmldoc_add_ref(This->node->doc); + + if (doc != This->node->doc) + refcount = xmlnode_get_inst_cnt(node_obj); + + if (refcount) xmldoc_add_refs(This->node->doc, refcount); /* xmlAddChild doesn't unlink node from previous parent */ xmlUnlinkNode(node_obj->node); xmlAddChild(This->node, node_obj->node); - xmldoc_release(doc); + if (refcount) xmldoc_release_refs(doc, refcount); node_obj->parent = This->iface; } @@ -468,6 +526,7 @@ xmlnode *old_child, *new_child; xmlDocPtr leaving_doc; xmlNode *my_ancestor; + int refcount = 0; /* Do not believe any documentation telling that newChild == NULL means removal. It does certainly *not* apply to msxml3! */ @@ -505,9 +564,13 @@ WARN("%p is not an orphan of %p\n", new_child->node, new_child->node->doc); leaving_doc = new_child->node->doc; - xmldoc_add_ref(old_child->node->doc); + + if (leaving_doc != old_child->node->doc) + refcount = xmlnode_get_inst_cnt(new_child); + + if (refcount) xmldoc_add_refs(old_child->node->doc, refcount); xmlReplaceNode(old_child->node, new_child->node); - xmldoc_release(leaving_doc); + if (refcount) xmldoc_release_refs(leaving_doc, refcount); new_child->parent = old_child->parent; old_child->parent = NULL; @@ -598,7 +661,7 @@ clone = xmlCopyNode(This->node, deep ? 1 : 2); if (clone) { - clone->doc = This->node->doc; + xmlSetTreeDoc(clone, This->node->doc); xmldoc_add_orphan(clone->doc, clone); node = create_node(clone); @@ -836,6 +899,53 @@ return *ret ? S_OK : E_OUTOFMEMORY; } +static void htmldtd_dumpcontent(xmlOutputBufferPtr buf, xmlDocPtr doc) +{ + xmlDtdPtr cur = doc->intSubset; + + xmlOutputBufferWriteString(buf, "<!DOCTYPE "); + xmlOutputBufferWriteString(buf, (const char *)cur->name); + if (cur->ExternalID) + { + xmlOutputBufferWriteString(buf, " PUBLIC "); + xmlBufferWriteQuotedString(buf->buffer, cur->ExternalID); + if (cur->SystemID) + { + xmlOutputBufferWriteString(buf, " "); + xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); + } + } + else if (cur->SystemID) + { + xmlOutputBufferWriteString(buf, " SYSTEM "); + xmlBufferWriteQuotedString(buf->buffer, cur->SystemID); + } + xmlOutputBufferWriteString(buf, ">\n"); +} + +static void htmldoc_dumpcontent(xmlOutputBufferPtr buf, xmlDocPtr doc) +{ + xmlElementType type; + + /* force HTML output */ + type = doc->type; + doc->type = XML_HTML_DOCUMENT_NODE; + if (doc->intSubset) + htmldtd_dumpcontent(buf, doc); + if (doc->children) + { + xmlNodePtr cur = doc->children; + + while (cur) + { + htmlNodeDumpFormatOutput(buf, doc, cur, NULL, 1); + cur = cur->next; + } + + } + doc->type = type; +} + HRESULT node_transform_node(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *p) { #ifdef SONAME_LIBXSLT @@ -863,7 +973,7 @@ xmlOutputBufferPtr output = xmlAllocOutputBuffer(NULL); if (output) { - htmlDocContentDumpOutput(output, result->doc, NULL); + htmldoc_dumpcontent(output, result->doc); content = xmlBufferContent(output->buffer); *p = bstr_from_xmlChar(content); xmlOutputBufferClose(output); @@ -973,17 +1083,36 @@ return S_OK; } +/* _private field holds a number of COM instances spawned from this libxml2 node */ +static void xmlnode_add_ref(xmlNodePtr node) +{ + if (node->type == XML_DOCUMENT_NODE) return; + InterlockedIncrement((LONG*)&node->_private); +} + +static void xmlnode_release(xmlNodePtr node) +{ + if (node->type == XML_DOCUMENT_NODE) return; + InterlockedDecrement((LONG*)&node->_private); +} + void destroy_xmlnode(xmlnode *This) { if(This->node) + { + xmlnode_release(This->node); xmldoc_release(This->node->doc); + } release_dispex(&This->dispex); } void init_xmlnode(xmlnode *This, xmlNodePtr node, IXMLDOMNode *node_iface, dispex_static_data_t *dispex_data) { if(node) - xmldoc_add_ref( node->doc ); + { + xmlnode_add_ref(node); + xmldoc_add_ref(node->doc); + } This->node = node; This->iface = node_iface; Modified: trunk/reactos/dll/win32/msxml3/nodelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/nodelist.…
============================================================================== --- trunk/reactos/dll/win32/msxml3/nodelist.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/nodelist.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -341,28 +341,62 @@ TRACE("(%p)->(%x %x %x %p %p %p)\n", This, id, lcid, flags, params, res, ei); - V_VT(res) = VT_DISPATCH; - V_DISPATCH(res) = NULL; - - if (id < DISPID_DOM_COLLECTION_BASE || id > DISPID_DOM_COLLECTION_MAX) + if (id >= DISPID_DOM_COLLECTION_BASE && id <= DISPID_DOM_COLLECTION_MAX) + { + switch(flags) + { + case DISPATCH_PROPERTYGET: + { + IXMLDOMNode *disp = NULL; + + V_VT(res) = VT_DISPATCH; + IXMLDOMNodeList_get_item(&This->IXMLDOMNodeList_iface, id - DISPID_DOM_COLLECTION_BASE, &disp); + V_DISPATCH(res) = (IDispatch*)disp; + break; + } + default: + { + FIXME("unimplemented flags %x\n", flags); + break; + } + } + } + else if (id == DISPID_VALUE) + { + switch(flags) + { + case DISPATCH_METHOD|DISPATCH_PROPERTYGET: + case DISPATCH_PROPERTYGET: + case DISPATCH_METHOD: + { + IXMLDOMNode *item; + VARIANT index; + HRESULT hr; + + if (params->cArgs - params->cNamedArgs != 1) return DISP_E_BADPARAMCOUNT; + + VariantInit(&index); + hr = VariantChangeType(&index, params->rgvarg, 0, VT_I4); + if(FAILED(hr)) + { + FIXME("failed to convert arg, %s\n", debugstr_variant(params->rgvarg)); + return hr; + } + + IXMLDOMNodeList_get_item(&This->IXMLDOMNodeList_iface, V_I4(&index), &item); + V_VT(res) = VT_DISPATCH; + V_DISPATCH(res) = (IDispatch*)item; + break; + } + default: + { + FIXME("DISPID_VALUE: unimplemented flags %x\n", flags); + break; + } + } + } + else return DISP_E_UNKNOWNNAME; - - switch(flags) - { - case INVOKE_PROPERTYGET: - { - IXMLDOMNode *disp = NULL; - - IXMLDOMNodeList_get_item(&This->IXMLDOMNodeList_iface, id - DISPID_DOM_COLLECTION_BASE, &disp); - V_DISPATCH(res) = (IDispatch*)disp; - break; - } - default: - { - FIXME("unimplemented flags %x\n", flags); - break; - } - } TRACE("ret %p\n", V_DISPATCH(res)); 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] Fri Mar 22 16:13:43 2013 @@ -171,12 +171,13 @@ SAXContentHandler = 0, SAXDeclHandler, SAXDTDHandler, + SAXEntityResolver, SAXErrorHandler, SAXLexicalHandler, SAXHandler_Last }; -struct saxhandler_iface +struct saxanyhandler_iface { IUnknown *handler; IUnknown *vbhandler; @@ -198,6 +199,23 @@ { ISAXLexicalHandler *handler; IVBSAXLexicalHandler *vbhandler; +}; + +struct saxentityresolver_iface +{ + ISAXEntityResolver *handler; + IVBSAXEntityResolver *vbhandler; +}; + +struct saxhandler_iface +{ + union { + struct saxcontenthandler_iface content; + struct saxentityresolver_iface entityresolver; + struct saxerrorhandler_iface error; + struct saxlexicalhandler_iface lexical; + struct saxanyhandler_iface anyhandler; + } u; }; typedef struct @@ -218,7 +236,7 @@ static HRESULT saxreader_put_handler(saxreader *reader, enum saxhandler_type type, void *ptr, BOOL vb) { - struct saxhandler_iface *iface = &reader->saxhandlers[type]; + struct saxanyhandler_iface *iface = &reader->saxhandlers[type].u.anyhandler; IUnknown *unk = (IUnknown*)ptr; if (unk) @@ -237,7 +255,7 @@ static HRESULT saxreader_get_handler(const saxreader *reader, enum saxhandler_type type, BOOL vb, void **ret) { - const struct saxhandler_iface *iface = &reader->saxhandlers[type]; + const struct saxanyhandler_iface *iface = &reader->saxhandlers[type].u.anyhandler; if (!ret) return E_POINTER; @@ -256,17 +274,17 @@ static struct saxcontenthandler_iface *saxreader_get_contenthandler(saxreader *reader) { - return (struct saxcontenthandler_iface*)&reader->saxhandlers[SAXContentHandler]; + return &reader->saxhandlers[SAXContentHandler].u.content; } static struct saxerrorhandler_iface *saxreader_get_errorhandler(saxreader *reader) { - return (struct saxerrorhandler_iface*)&reader->saxhandlers[SAXErrorHandler]; + return &reader->saxhandlers[SAXErrorHandler].u.error; } static struct saxlexicalhandler_iface *saxreader_get_lexicalhandler(saxreader *reader) { - return (struct saxlexicalhandler_iface*)&reader->saxhandlers[SAXLexicalHandler]; + return &reader->saxhandlers[SAXLexicalHandler].u.lexical; } typedef struct @@ -279,8 +297,8 @@ saxreader *saxreader; HRESULT ret; xmlParserCtxtPtr pParserCtxt; - WCHAR *publicId; - WCHAR *systemId; + BSTR publicId; + BSTR systemId; int line; int column; BOOL vbInterface; @@ -330,8 +348,23 @@ static inline int saxreader_has_handler(const saxlocator *locator, enum saxhandler_type type) { - return (locator->vbInterface && locator->saxreader->saxhandlers[type].vbhandler) || - (!locator->vbInterface && locator->saxreader->saxhandlers[type].handler); + struct saxanyhandler_iface *iface = &locator->saxreader->saxhandlers[type].u.anyhandler; + return (locator->vbInterface && iface->vbhandler) || (!locator->vbInterface && iface->handler); +} + +static HRESULT saxreader_saxcharacters(saxlocator *locator, BSTR chars) +{ + struct saxcontenthandler_iface *content = saxreader_get_contenthandler(locator->saxreader); + HRESULT hr; + + if (!saxreader_has_handler(locator, SAXContentHandler)) return S_OK; + + if (locator->vbInterface) + hr = IVBSAXContentHandler_characters(content->vbhandler, &chars); + else + hr = ISAXContentHandler_characters(content->handler, chars, SysStringLen(chars)); + + return hr; } /* property names */ @@ -1550,7 +1583,6 @@ int len) { saxlocator *This = ctx; - struct saxcontenthandler_iface *handler = saxreader_get_contenthandler(This->saxreader); BSTR Chars; HRESULT hr; xmlChar *cur, *end; @@ -1609,10 +1641,7 @@ } Chars = pooled_bstr_from_xmlCharN(&This->saxreader->pool, cur, end-cur); - if(This->vbInterface) - hr = IVBSAXContentHandler_characters(handler->vbhandler, &Chars); - else - hr = ISAXContentHandler_characters(handler->handler, Chars, SysStringLen(Chars)); + hr = saxreader_saxcharacters(This, Chars); if (sax_callback_failed(This, hr)) { @@ -1745,33 +1774,58 @@ This->ret = E_FAIL; } -static void libxmlCDataBlock(void *ctx, const xmlChar *value, int len) -{ - saxlocator *This = ctx; - struct saxcontenthandler_iface *content = saxreader_get_contenthandler(This->saxreader); - struct saxlexicalhandler_iface *lexical = saxreader_get_lexicalhandler(This->saxreader); +/* The only reason this helper exists is that CDATA section are reported by chunks, + newlines are used as delimiter. More than that, reader even alters input data before reporting. + + This helper should be called for substring with trailing newlines. +*/ +static BSTR saxreader_get_cdata_chunk(const xmlChar *str, int len) +{ + BSTR bstr = bstr_from_xmlCharN(str, len), ret; + WCHAR *ptr; + + ptr = bstr + len - 1; + while ((*ptr == '\r' || *ptr == '\n') && ptr >= bstr) + ptr--; + + while (*++ptr) + { + /* replace returns as: + + - "\r<char>" -> "\n<char>" + - "\r\r" -> "\r" + - "\r\n" -> "\n" + */ + if (*ptr == '\r') + { + if (*(ptr+1) == '\r' || *(ptr+1) == '\n') + { + /* shift tail */ + memmove(ptr, ptr+1, len-- - (ptr-bstr)); + } + else + *ptr = '\n'; + } + } + + ret = SysAllocStringLen(bstr, len); + SysFreeString(bstr); + return ret; +} + +static void libxml_cdatablock(void *ctx, const xmlChar *value, int len) +{ + const xmlChar *start, *end; + saxlocator *locator = ctx; + struct saxlexicalhandler_iface *lexical = saxreader_get_lexicalhandler(locator->saxreader); HRESULT hr = S_OK; - xmlChar *beg = (xmlChar*)This->pParserCtxt->input->cur-len; - xmlChar *cur, *end; - int realLen; - BSTR Chars; - BOOL lastEvent = FALSE, change; - - update_position(This, FALSE); - while(beg-9>=This->pParserCtxt->input->base - && memcmp(beg-9, "<![CDATA[", sizeof(char[9]))) - { - if(*beg=='\n' || (*beg=='\r' && *(beg+1)!='\n')) - This->line--; - beg--; - } - This->column = 0; - for(; beg>=This->pParserCtxt->input->base && *beg!='\n' && *beg!='\r'; beg--) - This->column++; - - if (saxreader_has_handler(This, SAXLexicalHandler)) - { - if (This->vbInterface) + BSTR chars; + int i; + + update_position(locator, FALSE); + if (saxreader_has_handler(locator, SAXLexicalHandler)) + { + if (locator->vbInterface) hr = IVBSAXLexicalHandler_startCDATA(lexical->vbhandler); else hr = ISAXLexicalHandler_startCDATA(lexical->handler); @@ -1779,61 +1833,66 @@ if(FAILED(hr)) { - format_error_message_from_id(This, hr); + format_error_message_from_id(locator, hr); return; } - realLen = This->pParserCtxt->input->cur-beg-3; - cur = beg; - end = beg; - - while(1) - { - while(end-beg<realLen && *end!='\r') end++; - if(end-beg==realLen) + start = value; + end = NULL; + i = 0; + + while (i < len) + { + /* scan for newlines */ + if (value[i] == '\r' || value[i] == '\n') { - end--; - lastEvent = TRUE; + /* skip newlines/linefeeds */ + while (i < len) + { + if (value[i] != '\r' && value[i] != '\n') break; + i++; + } + end = &value[i]; + + /* report */ + chars = saxreader_get_cdata_chunk(start, end-start); + TRACE("(chunk %s)\n", debugstr_w(chars)); + hr = saxreader_saxcharacters(locator, chars); + SysFreeString(chars); + + start = &value[i]; + end = NULL; } - else if(end-beg==realLen-1 && *end=='\r' && *(end+1)=='\n') - lastEvent = TRUE; - - if(*end == '\r') change = TRUE; - else change = FALSE; - - if(change) *end = '\n'; - - if (saxreader_has_handler(This, SAXContentHandler)) - { - Chars = pooled_bstr_from_xmlCharN(&This->saxreader->pool, cur, end-cur+1); - if (This->vbInterface) - hr = IVBSAXContentHandler_characters(content->vbhandler, &Chars); - else - hr = ISAXContentHandler_characters(content->handler, Chars, SysStringLen(Chars)); - } - - if(change) *end = '\r'; - - if(lastEvent) - break; - - This->column += end-cur+2; - end += 2; - cur = end; - } - - if (saxreader_has_handler(This, SAXLexicalHandler)) - { - if (This->vbInterface) + i++; + locator->column++; + } + + /* no newline chars (or last chunk) report as a whole */ + if (!end && start == value) + { + /* report */ + chars = bstr_from_xmlCharN(start, len-(start-value)); + TRACE("(%s)\n", debugstr_w(chars)); + hr = saxreader_saxcharacters(locator, chars); + SysFreeString(chars); + } + + if (saxreader_has_handler(locator, SAXLexicalHandler)) + { + if (locator->vbInterface) hr = IVBSAXLexicalHandler_endCDATA(lexical->vbhandler); else hr = ISAXLexicalHandler_endCDATA(lexical->handler); } if(FAILED(hr)) - format_error_message_from_id(This, hr); - - This->column += 4+end-cur; + format_error_message_from_id(locator, hr); +} + +static xmlParserInputPtr libxmlresolveentity(void *ctx, const xmlChar *publicid, const xmlChar *systemid) +{ + FIXME("entity resolving not implemented, %s, %s\n", publicid, systemid); + return xmlSAX2ResolveEntity(ctx, publicid, systemid); } /*** IVBSAXLocator interface ***/ @@ -2123,7 +2182,7 @@ publicId = bstr_from_xmlChar(xmlSAX2GetPublicId(This->pParserCtxt)); if(SysStringLen(publicId)) - This->publicId = (WCHAR*)&publicId; + This->publicId = publicId; else { SysFreeString(publicId); @@ -2145,7 +2204,7 @@ systemId = bstr_from_xmlChar(xmlSAX2GetSystemId(This->pParserCtxt)); if(SysStringLen(systemId)) - This->systemId = (WCHAR*)&systemId; + This->systemId = systemId; else { SysFreeString(systemId); @@ -2368,24 +2427,6 @@ locator->pParserCtxt = NULL; ISAXLocator_Release(&locator->ISAXLocator_iface); return hr; -} - -static HRESULT internal_getEntityResolver( - saxreader *This, - void *pEntityResolver, - BOOL vbInterface) -{ - FIXME("(%p)->(%p) stub\n", This, pEntityResolver); - return E_NOTIMPL; -} - -static HRESULT internal_putEntityResolver( - saxreader *This, - void *pEntityResolver, - BOOL vbInterface) -{ - FIXME("(%p)->(%p) stub\n", This, pEntityResolver); - return E_NOTIMPL; } static HRESULT internal_parse( @@ -2737,7 +2778,7 @@ for (i = 0; i < SAXHandler_Last; i++) { - struct saxhandler_iface *iface = &This->saxhandlers[i]; + struct saxanyhandler_iface *iface = &This->saxhandlers[i].u.anyhandler; if (iface->handler) IUnknown_Release(iface->handler); @@ -2870,18 +2911,18 @@ static HRESULT WINAPI saxxmlreader_get_entityResolver( IVBSAXXMLReader* iface, - IVBSAXEntityResolver **pEntityResolver) + IVBSAXEntityResolver **resolver) { saxreader *This = impl_from_IVBSAXXMLReader( iface ); - return internal_getEntityResolver(This, pEntityResolver, TRUE); + return saxreader_get_handler(This, SAXEntityResolver, TRUE, (void**)resolver); } static HRESULT WINAPI saxxmlreader_put_entityResolver( IVBSAXXMLReader* iface, - IVBSAXEntityResolver *pEntityResolver) + IVBSAXEntityResolver *resolver) { saxreader *This = impl_from_IVBSAXXMLReader( iface ); - return internal_putEntityResolver(This, pEntityResolver, TRUE); + return saxreader_put_handler(This, SAXEntityResolver, resolver, TRUE); } static HRESULT WINAPI saxxmlreader_get_contentHandler( @@ -3077,18 +3118,18 @@ static HRESULT WINAPI isaxxmlreader_getEntityResolver( ISAXXMLReader* iface, - ISAXEntityResolver **ppEntityResolver) + ISAXEntityResolver **resolver) { saxreader *This = impl_from_ISAXXMLReader( iface ); - return internal_getEntityResolver(This, ppEntityResolver, FALSE); + return saxreader_get_handler(This, SAXEntityResolver, FALSE, (void**)resolver); } static HRESULT WINAPI isaxxmlreader_putEntityResolver( ISAXXMLReader* iface, - ISAXEntityResolver *pEntityResolver) + ISAXEntityResolver *resolver) { saxreader *This = impl_from_ISAXXMLReader( iface ); - return internal_putEntityResolver(This, pEntityResolver, FALSE); + return saxreader_put_handler(This, SAXEntityResolver, resolver, FALSE); } static HRESULT WINAPI isaxxmlreader_getContentHandler( @@ -3256,7 +3297,8 @@ reader->sax.comment = libxmlComment; reader->sax.error = libxmlFatalError; reader->sax.fatalError = libxmlFatalError; - reader->sax.cdataBlock = libxmlCDataBlock; + reader->sax.cdataBlock = libxml_cdatablock; + reader->sax.resolveEntity = libxmlresolveentity; *ppObj = &reader->IVBSAXXMLReader_iface; 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] Fri Mar 22 16:13:43 2013 @@ -103,6 +103,9 @@ MSXML_VERSION version; xmlHashTablePtr cache; + xmlChar **uris; + int allocated; + int count; VARIANT_BOOL validateOnLoad; int read_only; @@ -115,12 +118,6 @@ xmlDocPtr doc; LONG ref; } cache_entry; - -typedef struct -{ - LONG index; - BSTR* out; -} cache_index_data; /* datatypes lookup stuff * generated with help from gperf */ @@ -744,7 +741,7 @@ return; } buf = LockResource(datatypes_handle); - datatypes_len = SizeofResource(MSXML_hInstance, datatypes_rsrc) - 1; + datatypes_len = SizeofResource(MSXML_hInstance, datatypes_rsrc); /* Resource is loaded as raw data, * need a null-terminated string */ @@ -844,7 +841,7 @@ xmlNodePtr root, next, child; xmlNsPtr ns; - assert((void*)xmlGetExternalEntityLoader() == (void*)external_entity_loader); + assert(xmlGetExternalEntityLoader() == external_entity_loader); root = xmlDocGetRootElement(schema); if (!root) return FALSE; @@ -985,6 +982,55 @@ cache_entry_release((cache_entry*)data); } +/* returns index or -1 if not found */ +static int cache_free_uri(schema_cache *cache, const xmlChar *uri) +{ + int i; + + for (i = 0; i < cache->count; i++) + if (xmlStrEqual(cache->uris[i], uri)) + { + heap_free(cache->uris[i]); + return i; + } + + return -1; +} + +static void cache_add_entry(schema_cache *cache, const xmlChar *uri, cache_entry *entry) +{ + int i; + + /* meaning no entry found with this name */ + if (xmlHashRemoveEntry(cache->cache, uri, cache_free)) + { + if (cache->count == cache->allocated) + { + cache->allocated *= 2; + cache->uris = heap_realloc(cache->uris, cache->allocated*sizeof(xmlChar*)); + } + i = cache->count++; + } + else + i = cache_free_uri(cache, uri); + + cache->uris[i] = heap_strdupxmlChar(uri); + xmlHashAddEntry(cache->cache, uri, entry); +} + +static void cache_remove_entry(schema_cache *cache, const xmlChar *uri) +{ + /* adjust index if entry was really removed */ + if (xmlHashRemoveEntry(cache->cache, uri, cache_free) == 0) + { + int i = cache_free_uri(cache, uri); + if (i == -1) return; + /* shift array */ + if (i != --cache->count) + memmove(&cache->uris[i], &cache->uris[i+1], (cache->count-i)*sizeof(xmlChar*)); + } +} + /* This one adds all namespaces defined in document to a cache, without anything associated with uri obviously. Unfortunately namespace:: axis implementation in libxml2 differs from what we need, @@ -1033,8 +1079,7 @@ entry->schema = NULL; entry->doc = NULL; - xmlHashRemoveEntry(This->cache, ns->href, cache_free); - xmlHashAddEntry(This->cache, ns->href, entry); + cache_add_entry(This, ns->href, entry); } pos++; } @@ -1091,6 +1136,11 @@ if (ref == 0) { + int i; + + for (i = 0; i < This->count; i++) + heap_free(This->uris[i]); + heap_free(This->uris); xmlHashFree(This->cache, cache_free); release_dispex(&This->dispex); heap_free(This); @@ -1146,7 +1196,7 @@ { case VT_NULL: { - xmlHashRemoveEntry(This->cache, name, cache_free); + cache_remove_entry(This, name); } break; @@ -1164,8 +1214,7 @@ return E_FAIL; } - xmlHashRemoveEntry(This->cache, name, cache_free); - xmlHashAddEntry(This->cache, name, entry); + cache_add_entry(This, name, entry); } break; @@ -1214,8 +1263,7 @@ return E_FAIL; } - xmlHashRemoveEntry(This->cache, name, cache_free); - xmlHashAddEntry(This->cache, name, entry); + cache_add_entry(This, name, entry); } break; @@ -1263,7 +1311,7 @@ if (This->version == MSXML6) return E_NOTIMPL; - xmlHashRemoveEntry(This->cache, name, cache_free); + cache_remove_entry(This, name); heap_free(name); return S_OK; } @@ -1275,33 +1323,25 @@ if (!length) return E_POINTER; - *length = xmlHashSize(This->cache); + + *length = This->count; return S_OK; } -static void cache_index(void* data /* ignored */, void* index, xmlChar* name) -{ - cache_index_data* index_data = (cache_index_data*)index; - - if (index_data->index-- == 0) - *index_data->out = bstr_from_xmlChar(name); -} - static HRESULT WINAPI schema_cache_get_namespaceURI(IXMLDOMSchemaCollection2* iface, - LONG index, BSTR* len) -{ - schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface); - cache_index_data data = {index, len}; - TRACE("(%p)->(%i %p)\n", This, index, len); - - if (!len) + LONG index, BSTR* uri) +{ + schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface); + + TRACE("(%p)->(%i %p)\n", This, index, uri); + + if (!uri) return E_POINTER; - if (index >= xmlHashSize(This->cache)) + if (index >= This->count) return E_FAIL; - *len = NULL; - xmlHashScan(This->cache, cache_index, &data); + *uri = bstr_from_xmlChar(This->uris[index]); return S_OK; } @@ -1313,7 +1353,7 @@ if (xmlHashLookup(This->cache, name) == NULL) { cache_entry_add_ref(entry); - xmlHashAddEntry(This->cache, name, entry); + cache_add_entry(This, name, entry); } } @@ -1531,6 +1571,9 @@ This->IXMLDOMSchemaCollection2_iface.lpVtbl = &XMLDOMSchemaCollection2Vtbl; This->cache = xmlHashCreate(DEFAULT_HASHTABLE_SIZE); + This->allocated = 10; + This->count = 0; + This->uris = heap_alloc(This->allocated*sizeof(xmlChar*)); This->ref = 1; This->version = version; This->validateOnLoad = VARIANT_TRUE; Modified: trunk/reactos/dll/win32/msxml3/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/text.c?re…
============================================================================== --- trunk/reactos/dll/win32/msxml3/text.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/text.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -29,6 +29,7 @@ //#include <stdarg.h> #ifdef HAVE_LIBXML2 # include <libxml/parser.h> +# include <libxml/parserInternals.h> //# include <libxml/xmlerror.h> #endif @@ -58,6 +59,11 @@ return CONTAINING_RECORD(iface, domtext, IXMLDOMText_iface); } +static void domtext_reset_noenc(domtext *This) +{ + This->node.node->name = NULL; +} + static HRESULT WINAPI domtext_QueryInterface( IXMLDOMText *iface, REFIID riid, @@ -185,6 +191,7 @@ TRACE("(%p)->(%s)\n", This, debugstr_variant(&value)); + domtext_reset_noenc(This); return node_put_value(&This->node, &value); } @@ -374,6 +381,7 @@ { domtext *This = impl_from_IXMLDOMText( iface ); TRACE("(%p)->(%s)\n", This, debugstr_w(p)); + domtext_reset_noenc(This); return node_put_text( &This->node, p ); } @@ -611,7 +619,14 @@ BSTR data) { domtext *This = impl_from_IXMLDOMText( iface ); + static WCHAR rnW[] = {'\r','\n',0}; + TRACE("(%p)->(%s)\n", This, debugstr_w(data)); + + if (data && !strcmpW(rnW, data)) + This->node.node->name = xmlStringTextNoenc; + else + domtext_reset_noenc(This); return node_set_content(&This->node, data); } Modified: trunk/reactos/dll/win32/msxml3/xmlparser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/xmlparser…
============================================================================== --- trunk/reactos/dll/win32/msxml3/xmlparser.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/xmlparser.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -49,6 +49,8 @@ typedef struct _xmlparser { IXMLParser IXMLParser_iface; + IXMLNodeFactory *nodefactory; + IUnknown *input; LONG ref; int flags; @@ -98,6 +100,12 @@ TRACE("(%p)->(%d)\n", This, ref); if ( ref == 0 ) { + if(This->input) + IUnknown_Release(This->input); + + if(This->nodefactory) + IXMLNodeFactory_Release(This->nodefactory); + heap_free( This ); } @@ -109,18 +117,33 @@ { xmlparser *This = impl_from_IXMLParser( iface ); - FIXME("(%p %p)\n", This, pNodeFactory); - - return E_NOTIMPL; + TRACE("(%p %p)\n", This, pNodeFactory); + + if(This->nodefactory) + IXMLNodeFactory_Release(This->nodefactory); + + This->nodefactory = pNodeFactory; + if(This->nodefactory) + IXMLNodeFactory_AddRef(This->nodefactory); + + return S_OK; } static HRESULT WINAPI xmlparser_GetFactory(IXMLParser *iface, IXMLNodeFactory **ppNodeFactory) { xmlparser *This = impl_from_IXMLParser( iface ); - FIXME("(%p, %p)\n", This, ppNodeFactory); - - return E_NOTIMPL; + TRACE("(%p, %p)\n", This, ppNodeFactory); + + if(!ppNodeFactory) + return E_INVALIDARG; + + *ppNodeFactory = This->nodefactory; + + if(*ppNodeFactory) + IXMLNodeFactory_AddRef(*ppNodeFactory); + + return S_OK; } static HRESULT WINAPI xmlparser_Abort(IXMLParser *iface, BSTR bstrErrorInfo) @@ -230,9 +253,18 @@ { xmlparser *This = impl_from_IXMLParser( iface ); - FIXME("(%p %p)\n", This, pStm); - - return E_NOTIMPL; + TRACE("(%p %p)\n", This, pStm); + + if(!pStm) + return E_INVALIDARG; + + if(This->input) + IUnknown_Release(This->input); + + This->input = pStm; + IUnknown_AddRef(This->input); + + return S_OK; } static HRESULT WINAPI xmlparser_PushData(IXMLParser *iface, const char *pData, @@ -418,6 +450,8 @@ return E_OUTOFMEMORY; This->IXMLParser_iface.lpVtbl = &xmlparser_vtbl; + This->nodefactory = NULL; + This->input = NULL; This->flags = 0; This->ref = 1; Modified: trunk/reactos/dll/win32/msxml3/xslpattern.l URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/xslpatter…
============================================================================== --- trunk/reactos/dll/win32/msxml3/xslpattern.l [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/xslpattern.l [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -58,7 +58,7 @@ %option reentrant bison-bridge %option noyywrap %option prefix="xslpattern_" -%option noinput nounput +%option noinput nounput never-interactive /* From the w3c XML standard * <
http://www.w3.org/TR/REC-xml/
> */ Modified: trunk/reactos/dll/win32/msxml3/xslpattern.yy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/xslpatter…
============================================================================== --- trunk/reactos/dll/win32/msxml3/xslpattern.yy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msxml3/xslpattern.yy.c [iso-8859-1] Fri Mar 22 16:13:43 2013 @@ -872,16 +872,12 @@ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 138 ); + while ( yy_current_state != 95 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; yy_find_action: yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } YY_DO_BEFORE_ACTION; @@ -1088,7 +1084,7 @@ #line 153 "xslpattern.l" ECHO; YY_BREAK -#line 1092 "xslpattern.yy.c" +#line 1088 "xslpattern.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1155,7 +1151,8 @@ else { - yy_cp = yyg->yy_c_buf_p; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; } } @@ -1609,10 +1606,6 @@ xslpattern_free((void *) b ,yyscanner ); } -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a xslpattern_restart() or at EOF. @@ -1637,7 +1630,7 @@ b->yy_bs_column = 0; } - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + b->yy_is_interactive = 0; errno = oerrno; } 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] Fri Mar 22 16:13:43 2013 @@ -120,7 +120,7 @@ reactos/dll/win32/msvidc32 # Autosync reactos/dll/win32/msxml # Synced to Wine-1.5.19 reactos/dll/win32/msxml2 # Synced to Wine-1.5.19 -reactos/dll/win32/msxml3 # Synced to Wine-1.5.12 +reactos/dll/win32/msxml3 # Synced to Wine-1.5.26 reactos/dll/win32/msxml4 # Synced to Wine-1.5.19 reactos/dll/win32/msxml6 # Synced to Wine-1.5.19 reactos/dll/win32/nddeapi # Synced to Wine-1.5.19
11 years, 9 months
1
0
0
0
[akhaldi] 58578: [CRT] * Annotate sys/stat.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 16:13:06 2013 New Revision: 58578 URL:
http://svn.reactos.org/svn/reactos?rev=58578&view=rev
Log: [CRT] * Annotate sys/stat.h. Modified: trunk/reactos/include/crt/sys/stat.h Modified: trunk/reactos/include/crt/sys/stat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/sys/stat.h?rev…
============================================================================== --- trunk/reactos/include/crt/sys/stat.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/sys/stat.h [iso-8859-1] Fri Mar 22 16:13:06 2013 @@ -139,30 +139,122 @@ #define _S_IWRITE 0x0080 #define _S_IEXEC 0x0040 - _CRTIMP int __cdecl _fstat(int _FileDes,struct _stat *_Stat); - _CRTIMP int __cdecl _fstat32(int _FileDes,struct _stat32 *_Stat); - _CRTIMP int __cdecl _stat(const char *_Name,struct _stat *_Stat); - _CRTIMP int __cdecl _stat32(const char *_Name,struct _stat32 *_Stat); + _CRTIMP + int + __cdecl + _fstat( + _In_ int _FileDes, + _Out_ struct _stat *_Stat); + + _CRTIMP + int + __cdecl + _fstat32( + _In_ int _FileDes, + _Out_ struct _stat32 *_Stat); + + _CRTIMP + int + __cdecl + _stat( + _In_z_ const char *_Name, + _Out_ struct _stat *_Stat); + + _CRTIMP + int + __cdecl + _stat32( + _In_z_ const char *_Name, + _Out_ struct _stat32 *_Stat); #if _INTEGRAL_MAX_BITS >= 64 - _CRTIMP int __cdecl _fstat64(int _FileDes,struct _stat64 *_Stat); - _CRTIMP int __cdecl _fstat32i64(int _FileDes,struct _stat32i64 *_Stat); - _CRTIMP int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat); - _CRTIMP int __cdecl _stat64(const char *_Name,struct _stat64 *_Stat); - _CRTIMP int __cdecl _stat32i64(const char *_Name,struct _stat32i64 *_Stat); - _CRTIMP int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat); + + _CRTIMP + int + __cdecl + _fstat64( + _In_ int _FileDes, + _Out_ struct _stat64 *_Stat); + + _CRTIMP + int + __cdecl + _fstat32i64( + _In_ int _FileDes, + _Out_ struct _stat32i64 *_Stat); + + _CRTIMP + int + __cdecl + _fstat64i32( + _In_ int _FileDes, + _Out_ struct _stat64i32 *_Stat); + + _CRTIMP + int + __cdecl + _stat64( + _In_z_ const char *_Name, + _Out_ struct _stat64 *_Stat); + + _CRTIMP + int + __cdecl + _stat32i64( + _In_z_ const char *_Name, + _Out_ struct _stat32i64 *_Stat); + + _CRTIMP + int + __cdecl + _stat64i32( + _In_z_ const char *_Name, + _Out_ struct _stat64i32 *_Stat); + #endif /* _INTEGRAL_MAX_BITS >= 64 */ #ifndef _WSTAT_DEFINED #define _WSTAT_DEFINED - _CRTIMP int __cdecl _wstat(const wchar_t *_Name,struct _stat *_Stat); - _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat); + + _CRTIMP + int + __cdecl + _wstat( + _In_z_ const wchar_t *_Name, + _Out_ struct _stat *_Stat); + + _CRTIMP + int + __cdecl + _wstat32( + _In_z_ const wchar_t *_Name, + _Out_ struct _stat32 *_Stat); + #if _INTEGRAL_MAX_BITS >= 64 - _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat); - _CRTIMP int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat); - _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat); -#endif -#endif + _CRTIMP + int + __cdecl + _wstat32i64( + _In_z_ const wchar_t *_Name, + _Out_ struct _stat32i64 *_Stat); + + _CRTIMP + int + __cdecl + _wstat64i32( + _In_z_ const wchar_t *_Name, + _Out_ struct _stat64i32 *_Stat); + + _CRTIMP + int + __cdecl + _wstat64( + _In_z_ const wchar_t *_Name, + _Out_ struct _stat64 *_Stat); + +#endif /* _INTEGRAL_MAX_BITS >= 64 */ + +#endif /* _WSTAT_DEFINED */ /** Compatibility definitons *************************************************/
11 years, 9 months
1
0
0
0
[jgardou] 58577: [WIN32K] * Do not alter the display palette in RealizePalette. CORE-6940 #comment r58577 should hack this away
by jgardou@svn.reactos.org
Author: jgardou Date: Fri Mar 22 16:08:08 2013 New Revision: 58577 URL:
http://svn.reactos.org/svn/reactos?rev=58577&view=rev
Log: [WIN32K] * Do not alter the display palette in RealizePalette. CORE-6940 #comment r58577 should hack this away Modified: trunk/reactos/win32ss/gdi/ntgdi/palette.c Modified: trunk/reactos/win32ss/gdi/ntgdi/palette.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/palette.…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/palette.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/palette.c [iso-8859-1] Fri Mar 22 16:08:08 2013 @@ -771,6 +771,12 @@ { goto cleanup; } + + if(pdc->dctype == DCTYPE_DIRECT) + { + UNIMPLEMENTED; + goto cleanup; + } ppalSurf = pdc->dclevel.pSurface->ppal; ppalDC = pdc->dclevel.ppal;
11 years, 9 months
1
0
0
0
[akhaldi] 58576: [DDK] * Fix some annotations in usbbusif.h.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 15:37:19 2013 New Revision: 58576 URL:
http://svn.reactos.org/svn/reactos?rev=58576&view=rev
Log: [DDK] * Fix some annotations in usbbusif.h. Modified: trunk/reactos/include/ddk/usbbusif.h Modified: trunk/reactos/include/ddk/usbbusif.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/usbbusif.h?rev…
============================================================================== --- trunk/reactos/include/ddk/usbbusif.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/usbbusif.h [iso-8859-1] Fri Mar 22 15:37:19 2013 @@ -12,8 +12,9 @@ typedef PVOID PUSB_DEVICE_HANDLE; #endif -_Must_inspect_result_ -typedef NTSTATUS +typedef +_Must_inspect_result_ +NTSTATUS (USB_BUSIFFN *PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB) ( _In_ PVOID, _In_ PURB); @@ -26,8 +27,9 @@ _Out_opt_ PUSBD_VERSION_INFORMATION, _Out_opt_ PULONG); -_Must_inspect_result_ -typedef NTSTATUS +typedef +_Must_inspect_result_ +NTSTATUS (USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_TIME) ( _In_ PVOID, _Out_opt_ PULONG); @@ -52,8 +54,9 @@ WCHAR ControllerNameUnicodeString[1]; } USB_BUS_INFORMATION_LEVEL_1, *PUSB_BUS_INFORMATION_LEVEL_1; -_Must_inspect_result_ -typedef NTSTATUS +typedef +_Must_inspect_result_ +NTSTATUS (USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_INFORMATION) ( _In_ PVOID, _In_ ULONG, @@ -61,8 +64,9 @@ _Out_ PULONG, _Out_opt_ PULONG); -_Must_inspect_result_ -typedef BOOLEAN +typedef +_Must_inspect_result_ +BOOLEAN (USB_BUSIFFN *PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED) ( _In_opt_ PVOID); @@ -117,14 +121,16 @@ #if (NTDDI_VERSION >= NTDDI_VISTA) -_Must_inspect_result_ -typedef NTSTATUS +typedef +_Must_inspect_result_ +NTSTATUS (USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_TIME_EX) ( _In_opt_ PVOID, _Out_opt_ PULONG); -_Must_inspect_result_ -typedef NTSTATUS +typedef +_Must_inspect_result_ +NTSTATUS (USB_BUSIFFN *PUSB_BUSIFFN_QUERY_CONTROLLER_TYPE) ( _In_opt_ PVOID, _Out_opt_ PULONG, @@ -167,8 +173,9 @@ PVOID Reserved; } USBC_FUNCTION_DESCRIPTOR, *PUSBC_FUNCTION_DESCRIPTOR; -_Must_inspect_result_ -typedef NTSTATUS +typedef +_Must_inspect_result_ +NTSTATUS (USB_BUSIFFN *USBC_START_DEVICE_CALLBACK)( _In_ PUSB_DEVICE_DESCRIPTOR DeviceDescriptor, _In_ PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, @@ -178,8 +185,9 @@ _In_ PDEVICE_OBJECT FdoDeviceObject, _In_ PDEVICE_OBJECT PdoDeviceObject); -_Must_inspect_result_ -typedef BOOLEAN +typedef +_Must_inspect_result_ +BOOLEAN (USB_BUSIFFN *USBC_PDO_ENABLE_CALLBACK)( _In_ PVOID Context, _In_ USHORT FirstInterfaceNumber,
11 years, 9 months
1
0
0
0
[akhaldi] 58575: [URLMON] * We no longer need these files.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 15:35:46 2013 New Revision: 58575 URL:
http://svn.reactos.org/svn/reactos?rev=58575&view=rev
Log: [URLMON] * We no longer need these files. Removed: trunk/reactos/dll/win32/urlmon/protproxy.c trunk/reactos/dll/win32/urlmon/rsrc.rc trunk/reactos/dll/win32/urlmon/version.rc Removed: trunk/reactos/dll/win32/urlmon/protproxy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/protproxy…
============================================================================== --- trunk/reactos/dll/win32/urlmon/protproxy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/protproxy.c (removed) @@ -1,292 +1,0 @@ -/* - * Copyright 2009 Jacek Caban for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "urlmon_main.h" -#include <wine/debug.h> - -WINE_DEFAULT_DEBUG_CHANNEL(urlmon); - -static inline ProtocolProxy *impl_from_IInternetProtocol(IInternetProtocol *iface) -{ - return CONTAINING_RECORD(iface, ProtocolProxy, IInternetProtocol_iface); -} - -static HRESULT WINAPI ProtocolProxy_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - - *ppv = NULL; - if(IsEqualGUID(&IID_IUnknown, riid)) { - TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = &This->IInternetProtocol_iface; - }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) { - TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv); - *ppv = &This->IInternetProtocol_iface; - }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) { - TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv); - *ppv = &This->IInternetProtocol_iface; - }else if(IsEqualGUID(&IID_IInternetProtocolSink, riid)) { - TRACE("(%p)->(IID_IInternetProtocolSink %p)\n", This, ppv); - *ppv = &This->IInternetProtocolSink_iface; - } - - if(*ppv) { - IInternetProtocol_AddRef(iface); - return S_OK; - } - - WARN("not supported interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI ProtocolProxy_AddRef(IInternetProtocol *iface) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - LONG ref = InterlockedIncrement(&This->ref); - TRACE("(%p) ref=%d\n", This, ref); - return ref; -} - -static ULONG WINAPI ProtocolProxy_Release(IInternetProtocol *iface) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - LONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p) ref=%d\n", This, ref); - - if(!ref) { - if(This->protocol_sink) - IInternetProtocolSink_Release(This->protocol_sink); - if(This->protocol) - IInternetProtocol_Release(This->protocol); - - heap_free(This); - - URLMON_UnlockModule(); - } - - return ref; -} - -static HRESULT WINAPI ProtocolProxy_Start(IInternetProtocol *iface, LPCWSTR szUrl, - IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, - DWORD grfPI, HANDLE_PTR dwReserved) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - - TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink, - pOIBindInfo, grfPI, dwReserved); - - return IInternetProtocol_Start(This->protocol, szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved); -} - -static HRESULT WINAPI ProtocolProxy_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - - TRACE("(%p)->(%p)\n", This, pProtocolData); - - return IInternetProtocol_Continue(This->protocol, pProtocolData); -} - -static HRESULT WINAPI ProtocolProxy_Abort(IInternetProtocol *iface, HRESULT hrReason, - DWORD dwOptions) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions); - return E_NOTIMPL; -} - -static HRESULT WINAPI ProtocolProxy_Terminate(IInternetProtocol *iface, DWORD dwOptions) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - - TRACE("(%p)->(%08x)\n", This, dwOptions); - - return IInternetProtocol_Terminate(This->protocol, dwOptions); -} - -static HRESULT WINAPI ProtocolProxy_Suspend(IInternetProtocol *iface) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI ProtocolProxy_Resume(IInternetProtocol *iface) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI ProtocolProxy_Read(IInternetProtocol *iface, void *pv, - ULONG cb, ULONG *pcbRead) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - - TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead); - - return IInternetProtocol_Read(This->protocol, pv, cb, pcbRead); -} - -static HRESULT WINAPI ProtocolProxy_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, - DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); - return E_NOTIMPL; -} - -static HRESULT WINAPI ProtocolProxy_LockRequest(IInternetProtocol *iface, DWORD dwOptions) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - - TRACE("(%p)->(%08x)\n", This, dwOptions); - - return IInternetProtocol_LockRequest(This->protocol, dwOptions); -} - -static HRESULT WINAPI ProtocolProxy_UnlockRequest(IInternetProtocol *iface) -{ - ProtocolProxy *This = impl_from_IInternetProtocol(iface); - - TRACE("(%p)\n", This); - - return IInternetProtocol_UnlockRequest(This->protocol); -} - -static const IInternetProtocolVtbl ProtocolProxyVtbl = { - ProtocolProxy_QueryInterface, - ProtocolProxy_AddRef, - ProtocolProxy_Release, - ProtocolProxy_Start, - ProtocolProxy_Continue, - ProtocolProxy_Abort, - ProtocolProxy_Terminate, - ProtocolProxy_Suspend, - ProtocolProxy_Resume, - ProtocolProxy_Read, - ProtocolProxy_Seek, - ProtocolProxy_LockRequest, - ProtocolProxy_UnlockRequest -}; - -static inline ProtocolProxy *impl_from_IInternetProtocolSink(IInternetProtocolSink *iface) -{ - return CONTAINING_RECORD(iface, ProtocolProxy, IInternetProtocolSink_iface); -} - -static HRESULT WINAPI ProtocolProxySink_QueryInterface(IInternetProtocolSink *iface, - REFIID riid, void **ppv) -{ - ProtocolProxy *This = impl_from_IInternetProtocolSink(iface); - return IInternetProtocol_QueryInterface(&This->IInternetProtocol_iface, riid, ppv); -} - -static ULONG WINAPI ProtocolProxySink_AddRef(IInternetProtocolSink *iface) -{ - ProtocolProxy *This = impl_from_IInternetProtocolSink(iface); - return IInternetProtocol_AddRef(&This->IInternetProtocol_iface); -} - -static ULONG WINAPI ProtocolProxySink_Release(IInternetProtocolSink *iface) -{ - ProtocolProxy *This = impl_from_IInternetProtocolSink(iface); - return IInternetProtocol_Release(&This->IInternetProtocol_iface); -} - -static HRESULT WINAPI ProtocolProxySink_Switch(IInternetProtocolSink *iface, - PROTOCOLDATA *pProtocolData) -{ - ProtocolProxy *This = impl_from_IInternetProtocolSink(iface); - - TRACE("(%p)->(%p)\n", This, pProtocolData); - - return IInternetProtocolSink_Switch(This->protocol_sink, pProtocolData); -} - -static HRESULT WINAPI ProtocolProxySink_ReportProgress(IInternetProtocolSink *iface, - ULONG ulStatusCode, LPCWSTR szStatusText) -{ - ProtocolProxy *This = impl_from_IInternetProtocolSink(iface); - - TRACE("(%p)->(%u %s)\n", This, ulStatusCode, debugstr_w(szStatusText)); - - switch(ulStatusCode) { - case BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE: - IInternetProtocolSink_ReportProgress(This->protocol_sink, BINDSTATUS_MIMETYPEAVAILABLE, szStatusText); - break; - default: - IInternetProtocolSink_ReportProgress(This->protocol_sink, ulStatusCode, szStatusText); - } - - return S_OK; -} - -static HRESULT WINAPI ProtocolProxySink_ReportData(IInternetProtocolSink *iface, - DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax) -{ - ProtocolProxy *This = impl_from_IInternetProtocolSink(iface); - - TRACE("(%p)->(%d %u %u)\n", This, grfBSCF, ulProgress, ulProgressMax); - - return IInternetProtocolSink_ReportData(This->protocol_sink, grfBSCF, ulProgress, ulProgressMax); -} - -static HRESULT WINAPI ProtocolProxySink_ReportResult(IInternetProtocolSink *iface, - HRESULT hrResult, DWORD dwError, LPCWSTR szResult) -{ - ProtocolProxy *This = impl_from_IInternetProtocolSink(iface); - - TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult)); - - return IInternetProtocolSink_ReportResult(This->protocol_sink, hrResult, dwError, szResult); -} - -static const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl = { - ProtocolProxySink_QueryInterface, - ProtocolProxySink_AddRef, - ProtocolProxySink_Release, - ProtocolProxySink_Switch, - ProtocolProxySink_ReportProgress, - ProtocolProxySink_ReportData, - ProtocolProxySink_ReportResult -}; - -HRESULT create_protocol_proxy(IInternetProtocol *protocol, IInternetProtocolSink *protocol_sink, ProtocolProxy **ret) -{ - ProtocolProxy *sink; - - sink = heap_alloc(sizeof(ProtocolProxy)); - if(!sink) - return E_OUTOFMEMORY; - - sink->IInternetProtocol_iface.lpVtbl = &ProtocolProxyVtbl; - sink->IInternetProtocolSink_iface.lpVtbl = &InternetProtocolSinkVtbl; - sink->ref = 1; - - IInternetProtocol_AddRef(protocol); - sink->protocol = protocol; - - IInternetProtocolSink_AddRef(protocol_sink); - sink->protocol_sink = protocol_sink; - - *ret = sink; - return S_OK; -} Removed: trunk/reactos/dll/win32/urlmon/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/rsrc.rc?r…
============================================================================== --- trunk/reactos/dll/win32/urlmon/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/rsrc.rc (removed) @@ -1,31 +1,0 @@ -/* - * Copyright 2005 Jacek Caban - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/* @makedep: urlmon.rgs */ -1 WINE_REGISTRY urlmon.rgs - -/* @makedep: urlmon.inf */ -REGINST REGINST urlmon.inf - -#define WINE_FILENAME_STR "urlmon.dll" -#define WINE_FILEVERSION 6,0,2800,1485 -#define WINE_FILEVERSION_STR "6.0.2800.1485" -#define WINE_PRODUCTVERSION 6,0,2800,1485 -#define WINE_PRODUCTVERSION_STR "6.0.2800.1485" - -#include "wine/wine_common_ver.rc" Removed: trunk/reactos/dll/win32/urlmon/version.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/version.r…
============================================================================== --- trunk/reactos/dll/win32/urlmon/version.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/urlmon/version.rc (removed) @@ -1,27 +1,0 @@ -/* - * Copyright 2005 - * - * Stefan Leichter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#define WINE_FILENAME_STR "urlmon.dll" -#define WINE_FILEVERSION 6,0,2800,1485 -#define WINE_FILEVERSION_STR "6.0.2800.1485" -#define WINE_PRODUCTVERSION 6,0,2800,1485 -#define WINE_PRODUCTVERSION_STR "6.0.2800.1485" - -#include "wine/wine_common_ver.rc"
11 years, 9 months
1
0
0
0
[akhaldi] 58574: [OPENGL32] * Don't import from glu32 anymore. * Link to libwine for the debugging facilities. * Fixes build.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 22 15:22:05 2013 New Revision: 58574 URL:
http://svn.reactos.org/svn/reactos?rev=58574&view=rev
Log: [OPENGL32] * Don't import from glu32 anymore. * Link to libwine for the debugging facilities. * Fixes build. Modified: trunk/reactos/dll/opengl/opengl32/CMakeLists.txt Modified: trunk/reactos/dll/opengl/opengl32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/opengl32/CMakeL…
============================================================================== --- trunk/reactos/dll/opengl/opengl32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/opengl/opengl32/CMakeLists.txt [iso-8859-1] Fri Mar 22 15:22:05 2013 @@ -1,4 +1,3 @@ - spec2def(opengl32.dll opengl32.spec ADD_IMPORTLIB) @@ -16,19 +15,8 @@ ${CMAKE_CURRENT_BINARY_DIR}/opengl32.def) add_library(opengl32 SHARED ${SOURCE}) - +target_link_libraries(opengl32 wine) set_module_type(opengl32 win32dll UNICODE) - -add_importlibs(opengl32 - msvcrt - gdi32 - user32 - advapi32 - glu32 - kernel32 - ntdll) - +add_importlibs(opengl32 gdi32 user32 advapi32 msvcrt kernel32 ntdll) add_pch(opengl32 opengl32.h) - add_cd_file(TARGET opengl32 DESTINATION reactos/system32 FOR all) -
11 years, 9 months
1
0
0
0
[spetreolle] 58573: [SHELL32] Fix shdocvw_v1 dependency.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Fri Mar 22 15:19:51 2013 New Revision: 58573 URL:
http://svn.reactos.org/svn/reactos?rev=58573&view=rev
Log: [SHELL32] Fix shdocvw_v1 dependency. Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLis…
============================================================================== --- trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Fri Mar 22 15:19:51 2013 @@ -107,6 +107,6 @@ kernel32 ntdll) -add_dependencies(shdocvw shdocvw_v1) +add_dependencies(shell32 shdocvw_v1) add_pch(shell32 precomp.h) add_cd_file(TARGET shell32 DESTINATION reactos/system32 FOR all)
11 years, 9 months
1
0
0
0
[jgardou] 58572: [OPENGL32] * Forgot this file
by jgardou@svn.reactos.org
Author: jgardou Date: Fri Mar 22 15:16:58 2013 New Revision: 58572 URL:
http://svn.reactos.org/svn/reactos?rev=58572&view=rev
Log: [OPENGL32] * Forgot this file Modified: trunk/reactos/dll/opengl/opengl32/wgl.c Modified: trunk/reactos/dll/opengl/opengl32/wgl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/opengl/opengl32/wgl.c?…
============================================================================== --- trunk/reactos/dll/opengl/opengl32/wgl.c [iso-8859-1] (original) +++ trunk/reactos/dll/opengl/opengl32/wgl.c [iso-8859-1] Fri Mar 22 15:16:58 2013 @@ -1241,41 +1241,6 @@ return ret; } - -BOOL -APIENTRY -rosglUseFontBitmapsA( HDC hdc, DWORD first, DWORD count, DWORD listBase ) -{ - return IntUseFontBitmapsA(hdc, first, count, listBase); -} - - -BOOL -APIENTRY -rosglUseFontBitmapsW( HDC hdc, DWORD first, DWORD count, DWORD listBase ) -{ - return IntUseFontBitmapsW(hdc, first, count, listBase); -} - -BOOL -APIENTRY -rosglUseFontOutlinesA( HDC hdc, DWORD first, DWORD count, DWORD listBase, - FLOAT deviation, FLOAT extrusion, int format, - GLYPHMETRICSFLOAT *pgmf ) -{ - return IntUseFontOutlinesA(hdc, first, count, listBase, deviation, extrusion, format, pgmf); -} - - -BOOL -APIENTRY -rosglUseFontOutlinesW( HDC hdc, DWORD first, DWORD count, DWORD listBase, - FLOAT deviation, FLOAT extrusion, int format, - GLYPHMETRICSFLOAT *pgmf ) -{ - return IntUseFontOutlinesW(hdc, first, count, listBase, deviation, extrusion, format, pgmf); -} - #ifdef __cplusplus }; /* extern "C" */ #endif /* __cplusplus */
11 years, 9 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
25
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
24
25
Results per page:
10
25
50
100
200