winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
972 discussions
Start a n
N
ew thread
Michael Stefaniuc : shell32: COM cleanup for IExtractIconA.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: f4f9be6eb0f66279706deeea03b4714e333f3257 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4f9be6eb0f66279706deeea0…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Jan 27 14:34:47 2012 +0100 shell32: COM cleanup for IExtractIconA. --- dlls/shell32/folders.c | 67 +++++++++++++++++++++++------------------------ 1 files changed, 33 insertions(+), 34 deletions(-) diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c index c829c3a..01fc1a4 100644 --- a/dlls/shell32/folders.c +++ b/dlls/shell32/folders.c @@ -49,9 +49,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); typedef struct { IExtractIconW IExtractIconW_iface; + IExtractIconA IExtractIconA_iface; LONG ref; const IPersistFileVtbl *lpvtblPersistFile; - const IExtractIconAVtbl *lpvtblExtractIconA; LPITEMIDLIST pidl; } IExtractIconWImpl; @@ -60,6 +60,11 @@ static inline IExtractIconWImpl *impl_from_IExtractIconW(IExtractIconW *iface) return CONTAINING_RECORD(iface, IExtractIconWImpl, IExtractIconW_iface); } +static inline IExtractIconWImpl *impl_from_IExtractIconA(IExtractIconA *iface) +{ + return CONTAINING_RECORD(iface, IExtractIconWImpl, IExtractIconA_iface); +} + static const IExtractIconAVtbl eiavt; static const IExtractIconWVtbl eivt; static const IPersistFileVtbl pfvt; @@ -69,11 +74,6 @@ static inline IExtractIconW *impl_from_IPersistFile( IPersistFile *iface ) return (IExtractIconW *)((char*)iface - FIELD_OFFSET(IExtractIconWImpl, lpvtblPersistFile)); } -static inline IExtractIconW *impl_from_IExtractIconA( IExtractIconA *iface ) -{ - return (IExtractIconW *)((char*)iface - FIELD_OFFSET(IExtractIconWImpl, lpvtblExtractIconA)); -} - /************************************************************************** * IExtractIconW_Constructor @@ -88,7 +88,7 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl) ei->ref=1; ei->IExtractIconW_iface.lpVtbl = &eivt; ei->lpvtblPersistFile = &pfvt; - ei->lpvtblExtractIconA = &eiavt; + ei->IExtractIconA_iface.lpVtbl = &eiavt; ei->pidl=ILClone(pidl); pdump(pidl); @@ -112,7 +112,7 @@ static HRESULT WINAPI IExtractIconW_fnQueryInterface(IExtractIconW *iface, REFII else if (IsEqualIID(riid, &IID_IPersistFile)) *ppv = &This->lpvtblPersistFile; else if (IsEqualIID(riid, &IID_IExtractIconA)) - *ppv = &This->lpvtblExtractIconA; + *ppv = &This->IExtractIconA_iface; if(*ppv) { @@ -409,59 +409,56 @@ static const IExtractIconWVtbl eivt = IExtractIconA* IExtractIconA_Constructor(LPCITEMIDLIST pidl) { IExtractIconWImpl *This = (IExtractIconWImpl *)IExtractIconW_Constructor(pidl); - IExtractIconA *eia = (IExtractIconA *)&This->lpvtblExtractIconA; + IExtractIconA *eia = &This->IExtractIconA_iface; TRACE("(%p)->(%p)\n", This, eia); return eia; } /************************************************************************** - * IExtractIconA_QueryInterface + * IExtractIconA::QueryInterface */ -static HRESULT WINAPI IExtractIconA_fnQueryInterface(IExtractIconA * iface, REFIID riid, LPVOID *ppvObj) +static HRESULT WINAPI IExtractIconA_fnQueryInterface(IExtractIconA * iface, REFIID riid, + void **ppv) { - IExtractIconW *This = impl_from_IExtractIconA(iface); + IExtractIconWImpl *This = impl_from_IExtractIconA(iface); - return IExtractIconW_QueryInterface(This, riid, ppvObj); + return IExtractIconW_QueryInterface(&This->IExtractIconW_iface, riid, ppv); } /************************************************************************** -* IExtractIconA_AddRef +* IExtractIconA::AddRef */ static ULONG WINAPI IExtractIconA_fnAddRef(IExtractIconA * iface) { - IExtractIconW *This = impl_from_IExtractIconA(iface); + IExtractIconWImpl *This = impl_from_IExtractIconA(iface); - return IExtractIconW_AddRef(This); + return IExtractIconW_AddRef(&This->IExtractIconW_iface); } /************************************************************************** -* IExtractIconA_Release +* IExtractIconA::Release */ static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface) { - IExtractIconW *This = impl_from_IExtractIconA(iface); + IExtractIconWImpl *This = impl_from_IExtractIconA(iface); - return IExtractIconW_Release(This); + return IExtractIconW_Release(&This->IExtractIconW_iface); } /************************************************************************** -* IExtractIconA_GetIconLocation +* IExtractIconA::GetIconLocation * * mapping filetype to icon */ -static HRESULT WINAPI IExtractIconA_fnGetIconLocation( - IExtractIconA * iface, - UINT uFlags, - LPSTR szIconFile, - UINT cchMax, - int * piIndex, - UINT * pwFlags) +static HRESULT WINAPI IExtractIconA_fnGetIconLocation(IExtractIconA * iface, UINT uFlags, + LPSTR szIconFile, UINT cchMax, int * piIndex, UINT * pwFlags) { + IExtractIconWImpl *This = impl_from_IExtractIconA(iface); HRESULT ret; LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, cchMax * sizeof(WCHAR)); - IExtractIconW *This = impl_from_IExtractIconA(iface); - + TRACE("(%p) (flags=%u %p %u %p %p)\n", This, uFlags, szIconFile, cchMax, piIndex, pwFlags); - ret = IExtractIconW_GetIconLocation(This, uFlags, lpwstrFile, cchMax, piIndex, pwFlags); + ret = IExtractIconW_GetIconLocation(&This->IExtractIconW_iface, uFlags, lpwstrFile, cchMax, + piIndex, pwFlags); WideCharToMultiByte(CP_ACP, 0, lpwstrFile, -1, szIconFile, cchMax, NULL, NULL); HeapFree(GetProcessHeap(), 0, lpwstrFile); @@ -469,19 +466,21 @@ static HRESULT WINAPI IExtractIconA_fnGetIconLocation( return ret; } /************************************************************************** -* IExtractIconA_Extract +* IExtractIconA::Extract */ -static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) +static HRESULT WINAPI IExtractIconA_fnExtract(IExtractIconA * iface, LPCSTR pszFile, + UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) { + IExtractIconWImpl *This = impl_from_IExtractIconA(iface); HRESULT ret; INT len = MultiByteToWideChar(CP_ACP, 0, pszFile, -1, NULL, 0); LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - IExtractIconW *This = impl_from_IExtractIconA(iface); TRACE("(%p) (file=%p index=%u %p %p size=%u)\n", This, pszFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); MultiByteToWideChar(CP_ACP, 0, pszFile, -1, lpwstrFile, len); - ret = IExtractIconW_Extract(This, lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIconSize); + ret = IExtractIconW_Extract(&This->IExtractIconW_iface, lpwstrFile, nIconIndex, phiconLarge, + phiconSmall, nIconSize); HeapFree(GetProcessHeap(), 0, lpwstrFile); return ret; }
1
0
0
0
Michael Stefaniuc : shell32: Forward IExtractIconA:: Release to IExtractIconW:Release.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: 725db4d19d168749cc39c294a7e5fa84db6518a0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=725db4d19d168749cc39c294a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Jan 27 14:30:58 2012 +0100 shell32: Forward IExtractIconA::Release to IExtractIconW:Release. --- dlls/shell32/folders.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c index bf4c255..c829c3a 100644 --- a/dlls/shell32/folders.c +++ b/dlls/shell32/folders.c @@ -440,7 +440,7 @@ static ULONG WINAPI IExtractIconA_fnRelease(IExtractIconA * iface) { IExtractIconW *This = impl_from_IExtractIconA(iface); - return IExtractIconW_AddRef(This); + return IExtractIconW_Release(This); } /************************************************************************** * IExtractIconA_GetIconLocation
1
0
0
0
Michael Stefaniuc : shell32: COM cleanup for IExtractIconW.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: 5718c0bc2291d7f60154477c64370b5e6e78214e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5718c0bc2291d7f60154477c6…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Jan 27 14:21:17 2012 +0100 shell32: COM cleanup for IExtractIconW. --- dlls/shell32/folders.c | 90 +++++++++++++++++++++-------------------------- 1 files changed, 40 insertions(+), 50 deletions(-) diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c index 0143315..bf4c255 100644 --- a/dlls/shell32/folders.c +++ b/dlls/shell32/folders.c @@ -48,13 +48,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); */ typedef struct { - const IExtractIconWVtbl *lpVtbl; + IExtractIconW IExtractIconW_iface; LONG ref; const IPersistFileVtbl *lpvtblPersistFile; const IExtractIconAVtbl *lpvtblExtractIconA; LPITEMIDLIST pidl; } IExtractIconWImpl; +static inline IExtractIconWImpl *impl_from_IExtractIconW(IExtractIconW *iface) +{ + return CONTAINING_RECORD(iface, IExtractIconWImpl, IExtractIconW_iface); +} + static const IExtractIconAVtbl eiavt; static const IExtractIconWVtbl eivt; static const IPersistFileVtbl pfvt; @@ -81,7 +86,7 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl) ei = HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl)); ei->ref=1; - ei->lpVtbl = &eivt; + ei->IExtractIconW_iface.lpVtbl = &eivt; ei->lpvtblPersistFile = &pfvt; ei->lpvtblExtractIconA = &eiavt; ei->pidl=ILClone(pidl); @@ -89,52 +94,42 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl) pdump(pidl); TRACE("(%p)\n", ei); - return (IExtractIconW *)ei; + return &ei->IExtractIconW_iface; } /************************************************************************** - * IExtractIconW_QueryInterface + * IExtractIconW::QueryInterface */ -static HRESULT WINAPI IExtractIconW_fnQueryInterface(IExtractIconW *iface, REFIID riid, LPVOID *ppvObj) +static HRESULT WINAPI IExtractIconW_fnQueryInterface(IExtractIconW *iface, REFIID riid, + void **ppv) { - IExtractIconWImpl *This = (IExtractIconWImpl *)iface; + IExtractIconWImpl *This = impl_from_IExtractIconW(iface); - TRACE("(%p)->(\n\tIID:\t%s,%p)\n", This, debugstr_guid(riid), ppvObj); + TRACE("(%p)->(\n\tIID:\t%s,%p)\n", This, debugstr_guid(riid), ppv); - *ppvObj = NULL; + *ppv = NULL; + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IExtractIconW)) + *ppv = iface; + else if (IsEqualIID(riid, &IID_IPersistFile)) + *ppv = &This->lpvtblPersistFile; + else if (IsEqualIID(riid, &IID_IExtractIconA)) + *ppv = &This->lpvtblExtractIconA; - if (IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ - { - *ppvObj = This; - } - else if (IsEqualIID(riid, &IID_IPersistFile)) /*IExtractIcon*/ - { - *ppvObj = &This->lpvtblPersistFile; - } - else if (IsEqualIID(riid, &IID_IExtractIconA)) /*IExtractIcon*/ - { - *ppvObj = &This->lpvtblExtractIconA; - } - else if (IsEqualIID(riid, &IID_IExtractIconW)) /*IExtractIcon*/ - { - *ppvObj = This; - } - - if(*ppvObj) - { - IExtractIconW_AddRef((IExtractIconW*) *ppvObj); - TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj); - return S_OK; - } - TRACE("-- Interface: E_NOINTERFACE\n"); - return E_NOINTERFACE; + if(*ppv) + { + IUnknown_AddRef((IUnknown*)*ppv); + TRACE("-- Interface: (%p)->(%p)\n", ppv, *ppv); + return S_OK; + } + TRACE("-- Interface: E_NOINTERFACE\n"); + return E_NOINTERFACE; } /************************************************************************** -* IExtractIconW_AddRef +* IExtractIconW::AddRef */ static ULONG WINAPI IExtractIconW_fnAddRef(IExtractIconW * iface) { - IExtractIconWImpl *This = (IExtractIconWImpl *)iface; + IExtractIconWImpl *This = impl_from_IExtractIconW(iface); ULONG refCount = InterlockedIncrement(&This->ref); TRACE("(%p)->(count=%u)\n", This, refCount - 1); @@ -142,11 +137,11 @@ static ULONG WINAPI IExtractIconW_fnAddRef(IExtractIconW * iface) return refCount; } /************************************************************************** -* IExtractIconW_Release +* IExtractIconW::Release */ static ULONG WINAPI IExtractIconW_fnRelease(IExtractIconW * iface) { - IExtractIconWImpl *This = (IExtractIconWImpl *)iface; + IExtractIconWImpl *This = impl_from_IExtractIconW(iface); ULONG refCount = InterlockedDecrement(&This->ref); TRACE("(%p)->(count=%u)\n", This, refCount + 1); @@ -215,20 +210,14 @@ static HRESULT getIconLocationForFolder(IExtractIconWImpl *This, UINT uFlags, LP WCHAR swShell32Name[MAX_PATH]; /************************************************************************** -* IExtractIconW_GetIconLocation +* IExtractIconW::GetIconLocation * * mapping filetype to icon */ -static HRESULT WINAPI IExtractIconW_fnGetIconLocation( - IExtractIconW * iface, - UINT uFlags, /* GIL_ flags */ - LPWSTR szIconFile, - UINT cchMax, - int * piIndex, - UINT * pwFlags) /* returned GIL_ flags */ +static HRESULT WINAPI IExtractIconW_fnGetIconLocation(IExtractIconW * iface, UINT uFlags, + LPWSTR szIconFile, UINT cchMax, int * piIndex, UINT * pwFlags) { - IExtractIconWImpl *This = (IExtractIconWImpl *)iface; - + IExtractIconWImpl *This = impl_from_IExtractIconW(iface); char sTemp[MAX_PATH]; int icon_idx; GUID const * riid; @@ -383,11 +372,12 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation( } /************************************************************************** -* IExtractIconW_Extract +* IExtractIconW::Extract */ -static HRESULT WINAPI IExtractIconW_fnExtract(IExtractIconW * iface, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) +static HRESULT WINAPI IExtractIconW_fnExtract(IExtractIconW * iface, LPCWSTR pszFile, + UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize) { - IExtractIconWImpl *This = (IExtractIconWImpl *)iface; + IExtractIconWImpl *This = impl_from_IExtractIconW(iface); int index; FIXME("(%p) (file=%p index=%d %p %p size=%08x) semi-stub\n", This, debugstr_w(pszFile), (signed)nIconIndex,
1
0
0
0
Michael Stefaniuc : shell32: Pass the object instead of the iface to an internal helper.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: a14b7df8478eda8f7f46eadfcd49c435128589eb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a14b7df8478eda8f7f46eadfc…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Jan 27 14:17:46 2012 +0100 shell32: Pass the object instead of the iface to an internal helper. --- dlls/shell32/folders.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c index 6f49a3d..0143315 100644 --- a/dlls/shell32/folders.c +++ b/dlls/shell32/folders.c @@ -161,10 +161,9 @@ static ULONG WINAPI IExtractIconW_fnRelease(IExtractIconW * iface) return refCount; } -static HRESULT getIconLocationForFolder(IExtractIconW *iface, UINT uFlags, - LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags) +static HRESULT getIconLocationForFolder(IExtractIconWImpl *This, UINT uFlags, LPWSTR szIconFile, + UINT cchMax, int *piIndex, UINT *pwFlags) { - IExtractIconWImpl *This = (IExtractIconWImpl *)iface; int icon_idx; WCHAR wszPath[MAX_PATH]; WCHAR wszCLSIDValue[CHARS_IN_GUID]; @@ -318,8 +317,7 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation( } else if (_ILIsFolder (pSimplePidl)) { - getIconLocationForFolder(iface, uFlags, szIconFile, cchMax, piIndex, - pwFlags); + getIconLocationForFolder(This, uFlags, szIconFile, cchMax, piIndex, pwFlags); } else {
1
0
0
0
Jörg Höhle : winealsa: Fix -errno typo.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: 594002d0116087a8454f11f09c34e744dbcdc4eb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=594002d0116087a8454f11f09…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Fri Jan 27 10:03:01 2012 +0100 winealsa: Fix -errno typo. --- dlls/winealsa.drv/mmdevdrv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index fdb069a..ba29fde 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -582,7 +582,7 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(const char *key, IMMDevice *dev, HeapFree(GetProcessHeap(), 0, This); WARN("Unable to open PCM \"%s\": %d (%s)\n", key, err, snd_strerror(err)); switch(err){ - case EBUSY: + case -EBUSY: return AUDCLNT_E_DEVICE_IN_USE; default: return AUDCLNT_E_ENDPOINT_CREATE_FAILED;
1
0
0
0
Andrew Eikum : winealsa: Avoid underrun by adding a lead-in when starting with few samples.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: 7c52a257fb74c21e59318becf70dacffa5f9d720 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c52a257fb74c21e59318becf…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Mon Jan 23 11:00:14 2012 -0600 winealsa: Avoid underrun by adding a lead-in when starting with few samples. --- dlls/winealsa.drv/mmdevdrv.c | 63 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 51 insertions(+), 12 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index fedd040..fdb069a 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -52,6 +52,7 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag); static const REFERENCE_TIME DefaultPeriod = 100000; static const REFERENCE_TIME MinimumPeriod = 50000; +#define EXTRA_SAFE_RT 40000 struct ACImpl; typedef struct ACImpl ACImpl; @@ -112,6 +113,7 @@ struct ACImpl { UINT64 written_frames, last_pos_frames; UINT32 bufsize_frames, held_frames, tmp_buffer_frames, mmdev_period_frames; UINT32 lcl_offs_frames; /* offs into local_buffer where valid data starts */ + UINT32 hidden_frames; /* ALSA reserve to ensure continuous rendering */ HANDLE timer; BYTE *local_buffer, *tmp_buffer; @@ -961,8 +963,6 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, This->mmdev_period_frames = MulDiv(fmt->nSamplesPerSec, This->mmdev_period_rt, 10000000); - This->bufsize_frames = MulDiv(duration, fmt->nSamplesPerSec, 10000000); - /* Buffer 4 ALSA periods if large enough, else 4 mmdevapi periods */ This->alsa_bufsize_frames = This->mmdev_period_frames * 4; if(err < 0 || alsa_period_us < period / 10) @@ -1034,6 +1034,15 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, goto exit; } + /* Bear in mind weird situations where + * ALSA period (50ms) > mmdevapi buffer (3x10ms) + * or surprising rounding as seen with 22050x8x1 with Pulse: + * ALSA period 220 vs. 221 frames in mmdevapi and + * buffer 883 vs. 2205 frames in mmdevapi! */ + This->bufsize_frames = MulDiv(duration, fmt->nSamplesPerSec, 10000000); + This->hidden_frames = This->alsa_period_frames + This->mmdev_period_frames + + MulDiv(fmt->nSamplesPerSec, EXTRA_SAFE_RT, 10000000); + /* Check if the ALSA buffer is so small that it will run out before * the next MMDevAPI period tick occurs. Allow a little wiggle room * with 120% of the period time. */ @@ -1147,11 +1156,18 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface, return AUDCLNT_E_NOT_INITIALIZED; } - LeaveCriticalSection(&This->lock); + /* Hide some frames in the ALSA buffer. Allows to return GetCurrentPadding=0 + * yet have enough data left to play (as if it were in native's mixer). Add: + * + mmdevapi_period such that at the end of it, ALSA still has data; + * + EXTRA_SAFE (~4ms) to allow for late callback invocation / fluctuation; + * + alsa_period such that ALSA always has at least one period to play. */ + if(This->dataflow == eRender) + *latency = MulDiv(This->hidden_frames, 10000000, This->fmt->nSamplesPerSec); + else + *latency = MulDiv(This->alsa_period_frames, 10000000, This->fmt->nSamplesPerSec) + + This->mmdev_period_rt; - /* one mmdevapi period plus one period we hide in the ALSA buffer */ - *latency = MulDiv(This->alsa_period_frames, 10000000, This->fmt->nSamplesPerSec) - + This->mmdev_period_rt; + LeaveCriticalSection(&This->lock); return S_OK; } @@ -1473,11 +1489,11 @@ static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface, } static snd_pcm_sframes_t alsa_write_best_effort(snd_pcm_t *handle, BYTE *buf, - snd_pcm_uframes_t frames, ACImpl *This) + snd_pcm_uframes_t frames, ACImpl *This, BOOL mute) { snd_pcm_sframes_t written; - if(This->session->mute){ + if(mute){ int err; if((err = snd_pcm_format_set_silence(This->alsa_format, buf, frames * This->fmt->nChannels)) < 0) @@ -1510,8 +1526,8 @@ static snd_pcm_sframes_t alsa_write_best_effort(snd_pcm_t *handle, BYTE *buf, static void alsa_write_data(ACImpl *This) { - snd_pcm_sframes_t written; - snd_pcm_uframes_t to_write, avail, write_limit, max_period, in_alsa; + snd_pcm_sframes_t written, in_alsa; + snd_pcm_uframes_t to_write, avail, write_limit, max_period; int err; BYTE *buf = This->local_buffer + (This->lcl_offs_frames * This->fmt->nBlockAlign); @@ -1557,7 +1573,29 @@ static void alsa_write_data(ACImpl *This) to_write = min(to_write, write_limit); - written = alsa_write_best_effort(This->pcm_handle, buf, to_write, This); + /* Add a lead-in when starting with too few frames to ensure + * continuous rendering. Additional benefit: Force ALSA to start. + * GetPosition continues to reflect the speaker position because + * snd_pcm_delay includes buffered frames in its total delay + * and last_pos_frames prevents moving backwards. */ + if(!in_alsa && This->held_frames < This->hidden_frames){ + UINT32 s_frames = This->hidden_frames - This->held_frames; + BYTE *silence = HeapAlloc(GetProcessHeap(), 0, + s_frames * This->fmt->nBlockAlign); + + if(silence){ + in_alsa = alsa_write_best_effort(This->pcm_handle, + silence, s_frames, This, TRUE); + TRACE("lead-in %ld\n", in_alsa); + HeapFree(GetProcessHeap(), 0, silence); + if(in_alsa <= 0) + return; + }else + WARN("Couldn't allocate lead-in, expect underrun\n"); + } + + written = alsa_write_best_effort(This->pcm_handle, buf, to_write, This, + This->session->mute); if(written < 0){ WARN("Couldn't write: %ld (%s)\n", written, snd_strerror(written)); return; @@ -1575,7 +1613,8 @@ static void alsa_write_data(ACImpl *This) if(This->held_frames && (written < write_limit)){ /* wrapped and have some data back at the start to write */ written = alsa_write_best_effort(This->pcm_handle, This->local_buffer, - min(This->held_frames, write_limit - written), This); + min(This->held_frames, write_limit - written), This, + This->session->mute); if(written < 0){ WARN("Couldn't write: %ld (%s)\n", written, snd_strerror(written)); return;
1
0
0
0
Francois Gouget : wrc: Add a trailing '\n' to the error() calls.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: 1a512846e250af51048d9c38609f19dbf39cc7f1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a512846e250af51048d9c386…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Jan 27 14:08:22 2012 +0100 wrc: Add a trailing '\n' to the error() calls. --- tools/wrc/genres.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/wrc/genres.c b/tools/wrc/genres.c index d6e641f..edf4823 100644 --- a/tools/wrc/genres.c +++ b/tools/wrc/genres.c @@ -287,13 +287,13 @@ static int parse_accel_string( const string_t *key, int flags ) (key->str.cstr[0] >= '0' && key->str.cstr[0] <= '9'))) { print_location( &key->loc ); - error("VIRTKEY code is not equal to ascii value"); + error("VIRTKEY code is not equal to ascii value\n"); } if(key->str.cstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0) { print_location( &key->loc ); - error("Cannot use both '^' and CONTROL modifier"); + error("Cannot use both '^' and CONTROL modifier\n"); } else if(key->str.cstr[0] == '^') { @@ -301,7 +301,7 @@ static int parse_accel_string( const string_t *key, int flags ) if(keycode >= ' ') { print_location( &key->loc ); - error("Control-code out of range"); + error("Control-code out of range\n"); } } else @@ -314,12 +314,12 @@ static int parse_accel_string( const string_t *key, int flags ) (key->str.wstr[0] >= '0' && key->str.wstr[0] <= '9'))) { print_location( &key->loc ); - error("VIRTKEY code is not equal to ascii value"); + error("VIRTKEY code is not equal to ascii value\n"); } if(key->str.wstr[0] == '^' && (flags & WRC_AF_CONTROL) != 0) { print_location( &key->loc ); - error("Cannot use both '^' and CONTROL modifier"); + error("Cannot use both '^' and CONTROL modifier\n"); } else if(key->str.wstr[0] == '^') { @@ -327,7 +327,7 @@ static int parse_accel_string( const string_t *key, int flags ) if(keycode >= ' ') { print_location( &key->loc ); - error("Control-code out of range"); + error("Control-code out of range\n"); } } else
1
0
0
0
Nikolay Sivov : msxml3: Add a helper to output quoted strings.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: 2f18cfd85e6e766d762afdba16229153c7291769 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f18cfd85e6e766d762afdba1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 27 16:23:56 2012 +0300 msxml3: Add a helper to output quoted strings. --- dlls/msxml3/mxwriter.c | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index c94faaa..cb1a67f 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -250,6 +250,15 @@ static HRESULT write_output_buffer(output_buffer *buffer, const WCHAR *data, int return write_output_buffer_mode(buffer, OutputBuffer_Both, data, len); } +static HRESULT write_output_buffer_quoted(output_buffer *buffer, const WCHAR *data, int len) +{ + write_output_buffer(buffer, quotW, 1); + write_output_buffer(buffer, data, len); + write_output_buffer(buffer, quotW, 1); + + return S_OK; +} + /* frees buffer data, reallocates with a default lengths */ static void close_output_buffer(mxwriter *This) { @@ -327,7 +336,7 @@ static WCHAR *get_escaped_string(const WCHAR *str, int *len) static void write_prolog_buffer(const mxwriter *This) { - static const WCHAR versionW[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','=','\"'}; + static const WCHAR versionW[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','='}; static const WCHAR encodingW[] = {' ','e','n','c','o','d','i','n','g','=','\"'}; static const WCHAR standaloneW[] = {' ','s','t','a','n','d','a','l','o','n','e','=','\"'}; static const WCHAR yesW[] = {'y','e','s','\"','?','>'}; @@ -336,8 +345,7 @@ static void write_prolog_buffer(const mxwriter *This) /* version */ write_output_buffer(This->buffer, versionW, sizeof(versionW)/sizeof(WCHAR)); - write_output_buffer(This->buffer, This->version, -1); - write_output_buffer(This->buffer, quotW, 1); + write_output_buffer_quoted(This->buffer, This->version, -1); /* encoding */ write_output_buffer(This->buffer, encodingW, sizeof(encodingW)/sizeof(WCHAR)); @@ -952,7 +960,7 @@ static HRESULT WINAPI SAXContentHandler_startElement( for (i = 0; i < length; i++) { - static const WCHAR eqqW[] = {'=','\"'}; + static const WCHAR eqW[] = {'='}; const WCHAR *str; WCHAR *escaped; INT len = 0; @@ -964,17 +972,15 @@ static HRESULT WINAPI SAXContentHandler_startElement( write_output_buffer(This->buffer, spaceW, 1); write_output_buffer(This->buffer, str, len); - write_output_buffer(This->buffer, eqqW, 2); + write_output_buffer(This->buffer, eqW, 1); len = 0; hr = ISAXAttributes_getValue(attr, i, &str, &len); if (FAILED(hr)) return hr; escaped = get_escaped_string(str, &len); - write_output_buffer(This->buffer, escaped, len); + write_output_buffer_quoted(This->buffer, escaped, len); heap_free(escaped); - - write_output_buffer(This->buffer, quotW, 1); } } @@ -1136,18 +1142,14 @@ static HRESULT WINAPI SAXLexicalHandler_startDTD(ISAXLexicalHandler *iface, static const WCHAR publicW[] = {'P','U','B','L','I','C',' '}; write_output_buffer(This->buffer, publicW, sizeof(publicW)/sizeof(WCHAR)); - write_output_buffer(This->buffer, quotW, 1); - write_output_buffer(This->buffer, publicId, publicId_len); - write_output_buffer(This->buffer, quotW, 1); + write_output_buffer_quoted(This->buffer, publicId, publicId_len); if (!systemId) return E_INVALIDARG; if (*publicId) write_output_buffer(This->buffer, spaceW, 1); - write_output_buffer(This->buffer, quotW, 1); - write_output_buffer(This->buffer, systemId, systemId_len); - write_output_buffer(This->buffer, quotW, 1); + write_output_buffer_quoted(This->buffer, systemId, systemId_len); if (*systemId) write_output_buffer(This->buffer, spaceW, 1); @@ -1157,9 +1159,7 @@ static HRESULT WINAPI SAXLexicalHandler_startDTD(ISAXLexicalHandler *iface, static const WCHAR systemW[] = {'S','Y','S','T','E','M',' '}; write_output_buffer(This->buffer, systemW, sizeof(systemW)/sizeof(WCHAR)); - write_output_buffer(This->buffer, quotW, 1); - write_output_buffer(This->buffer, systemId, systemId_len); - write_output_buffer(This->buffer, quotW, 1); + write_output_buffer_quoted(This->buffer, systemId, systemId_len); if (*systemId) write_output_buffer(This->buffer, spaceW, 1); }
1
0
0
0
Nikolay Sivov : msxml3: Support startDTD()/endDTD() in MXWriter.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: 6106afe359f0ab904f9b7e4e9867a0cd5bb0cea4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6106afe359f0ab904f9b7e4e9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 27 16:09:42 2012 +0300 msxml3: Support startDTD()/endDTD() in MXWriter. --- dlls/msxml3/mxwriter.c | 80 ++++++++++++++++++++++++++++++++------ dlls/msxml3/tests/saxreader.c | 86 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+), 13 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index 3e08840..c94faaa 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -41,6 +41,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml); static const WCHAR utf16W[] = {'U','T','F','-','1','6',0}; static const WCHAR emptyW[] = {0}; +static const WCHAR spaceW[] = {' '}; +static const WCHAR quotW[] = {'\"'}; typedef enum { @@ -266,10 +268,10 @@ static void close_output_buffer(mxwriter *This) */ static WCHAR *get_escaped_string(const WCHAR *str, int *len) { - static const WCHAR ltW[] = {'&','l','t',';'}; - static const WCHAR ampW[] = {'&','a','m','p',';'}; - static const WCHAR quotW[] = {'&','q','u','o','t',';'}; - static const WCHAR gtW[] = {'&','g','t',';'}; + static const WCHAR ltW[] = {'&','l','t',';'}; + static const WCHAR ampW[] = {'&','a','m','p',';'}; + static const WCHAR equotW[] = {'&','q','u','o','t',';'}; + static const WCHAR gtW[] = {'&','g','t',';'}; const int default_alloc = 100; const int grow_thresh = 10; @@ -301,8 +303,8 @@ static WCHAR *get_escaped_string(const WCHAR *str, int *len) ptr += sizeof(ampW)/sizeof(WCHAR); break; case '"': - memcpy(ptr, quotW, sizeof(quotW)); - ptr += sizeof(quotW)/sizeof(WCHAR); + memcpy(ptr, equotW, sizeof(equotW)); + ptr += sizeof(equotW)/sizeof(WCHAR); break; case '>': memcpy(ptr, gtW, sizeof(gtW)); @@ -330,7 +332,6 @@ static void write_prolog_buffer(const mxwriter *This) static const WCHAR standaloneW[] = {' ','s','t','a','n','d','a','l','o','n','e','=','\"'}; static const WCHAR yesW[] = {'y','e','s','\"','?','>'}; static const WCHAR noW[] = {'n','o','\"','?','>'}; - static const WCHAR quotW[] = {'\"'}; static const WCHAR crlfW[] = {'\r','\n'}; /* version */ @@ -951,9 +952,7 @@ static HRESULT WINAPI SAXContentHandler_startElement( for (i = 0; i < length; i++) { - static const WCHAR spaceW[] = {' '}; static const WCHAR eqqW[] = {'=','\"'}; - static const WCHAR quotW[] = {'\"'}; const WCHAR *str; WCHAR *escaped; INT len = 0; @@ -1114,17 +1113,72 @@ static HRESULT WINAPI SAXLexicalHandler_startDTD(ISAXLexicalHandler *iface, const WCHAR *name, int name_len, const WCHAR *publicId, int publicId_len, const WCHAR *systemId, int systemId_len) { + static const WCHAR doctypeW[] = {'<','!','D','O','C','T','Y','P','E',' '}; + static const WCHAR openintW[] = {'[','\r','\n'}; + mxwriter *This = impl_from_ISAXLexicalHandler( iface ); - FIXME("(%p)->(%s %s %s): stub\n", This, debugstr_wn(name, name_len), debugstr_wn(publicId, publicId_len), + + TRACE("(%p)->(%s %s %s)\n", This, debugstr_wn(name, name_len), debugstr_wn(publicId, publicId_len), debugstr_wn(systemId, systemId_len)); - return E_NOTIMPL; + + if (!name) return E_INVALIDARG; + + write_output_buffer(This->buffer, doctypeW, sizeof(doctypeW)/sizeof(WCHAR)); + + if (*name) + { + write_output_buffer(This->buffer, name, name_len); + write_output_buffer(This->buffer, spaceW, 1); + } + + if (publicId) + { + static const WCHAR publicW[] = {'P','U','B','L','I','C',' '}; + + write_output_buffer(This->buffer, publicW, sizeof(publicW)/sizeof(WCHAR)); + write_output_buffer(This->buffer, quotW, 1); + write_output_buffer(This->buffer, publicId, publicId_len); + write_output_buffer(This->buffer, quotW, 1); + + if (!systemId) return E_INVALIDARG; + + if (*publicId) + write_output_buffer(This->buffer, spaceW, 1); + + write_output_buffer(This->buffer, quotW, 1); + write_output_buffer(This->buffer, systemId, systemId_len); + write_output_buffer(This->buffer, quotW, 1); + + if (*systemId) + write_output_buffer(This->buffer, spaceW, 1); + } + else if (systemId) + { + static const WCHAR systemW[] = {'S','Y','S','T','E','M',' '}; + + write_output_buffer(This->buffer, systemW, sizeof(systemW)/sizeof(WCHAR)); + write_output_buffer(This->buffer, quotW, 1); + write_output_buffer(This->buffer, systemId, systemId_len); + write_output_buffer(This->buffer, quotW, 1); + if (*systemId) + write_output_buffer(This->buffer, spaceW, 1); + } + + write_output_buffer(This->buffer, openintW, sizeof(openintW)/sizeof(WCHAR)); + + return S_OK; } static HRESULT WINAPI SAXLexicalHandler_endDTD(ISAXLexicalHandler *iface) { mxwriter *This = impl_from_ISAXLexicalHandler( iface ); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; + static const WCHAR closedtdW[] = {']','>','\r','\n'}; + + TRACE("(%p)\n", This); + + write_output_buffer(This->buffer, closedtdW, sizeof(closedtdW)/sizeof(WCHAR)); + + return S_OK; } static HRESULT WINAPI SAXLexicalHandler_startEntity(ISAXLexicalHandler *iface, const WCHAR *name, int len) diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 30ac57e..1f47062 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2956,7 +2956,92 @@ static void test_mxwriter_cdata(void) ISAXLexicalHandler_Release(lexical); IMXWriter_Release(writer); free_bstrs(); +} +static void test_mxwriter_dtd(void) +{ + static const WCHAR nameW[] = {'n','a','m','e'}; + static const WCHAR pubW[] = {'p','u','b'}; + static const WCHAR sysW[] = {'s','y','s'}; + ISAXContentHandler *content; + ISAXLexicalHandler *lexical; + IMXWriter *writer; + VARIANT dest; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER, + &IID_IMXWriter, (void**)&writer); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_QueryInterface(writer, &IID_ISAXLexicalHandler, (void**)&lexical); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE); + EXPECT_HR(hr, S_OK); + + hr = ISAXContentHandler_startDocument(content); + EXPECT_HR(hr, S_OK); + + hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, NULL, 0, NULL, 0); + EXPECT_HR(hr, E_INVALIDARG); + + hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, pubW, sizeof(pubW)/sizeof(WCHAR), NULL, 0); + EXPECT_HR(hr, E_INVALIDARG); + + hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, NULL, 0, sysW, sizeof(sysW)/sizeof(WCHAR)); + EXPECT_HR(hr, E_INVALIDARG); + + hr = ISAXLexicalHandler_startDTD(lexical, NULL, 0, pubW, sizeof(pubW)/sizeof(WCHAR), sysW, sizeof(sysW)/sizeof(WCHAR)); + EXPECT_HR(hr, E_INVALIDARG); + + hr = ISAXLexicalHandler_startDTD(lexical, nameW, sizeof(nameW)/sizeof(WCHAR), NULL, 0, NULL, 0); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_("<!DOCTYPE name [\r\n"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + /* system id is required if public is present */ + hr = ISAXLexicalHandler_startDTD(lexical, nameW, sizeof(nameW)/sizeof(WCHAR), pubW, sizeof(pubW)/sizeof(WCHAR), NULL, 0); + EXPECT_HR(hr, E_INVALIDARG); + + hr = ISAXLexicalHandler_startDTD(lexical, nameW, sizeof(nameW)/sizeof(WCHAR), + pubW, sizeof(pubW)/sizeof(WCHAR), sysW, sizeof(sysW)/sizeof(WCHAR)); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_("<!DOCTYPE name [\r\n<!DOCTYPE name PUBLIC \"pub\"" + "<!DOCTYPE name PUBLIC \"pub\" \"sys\" [\r\n"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + hr = ISAXLexicalHandler_endDTD(lexical); + EXPECT_HR(hr, S_OK); + + hr = ISAXLexicalHandler_endDTD(lexical); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_("<!DOCTYPE name [\r\n<!DOCTYPE name PUBLIC \"pub\"" + "<!DOCTYPE name PUBLIC \"pub\" \"sys\" [\r\n]>\r\n]>\r\n"), + V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + ISAXContentHandler_Release(content); + ISAXLexicalHandler_Release(lexical); + IMXWriter_Release(writer); + free_bstrs(); } START_TEST(saxreader) @@ -2996,6 +3081,7 @@ START_TEST(saxreader) test_mxwriter_characters(); test_mxwriter_comment(); test_mxwriter_cdata(); + test_mxwriter_dtd(); test_mxwriter_properties(); test_mxwriter_flush(); test_mxwriter_stream();
1
0
0
0
Nikolay Sivov : msxml3: Support CDATA nodes in MXWriter.
by Alexandre Julliard
27 Jan '12
27 Jan '12
Module: wine Branch: master Commit: 23c3d908667b96e5ee54679dee7c419d262da75f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23c3d908667b96e5ee54679de…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 27 15:30:03 2012 +0300 msxml3: Support CDATA nodes in MXWriter. --- dlls/msxml3/mxwriter.c | 18 ++++++++++--- dlls/msxml3/tests/saxreader.c | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index a94fa51..3e08840 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -1143,16 +1143,26 @@ static HRESULT WINAPI SAXLexicalHandler_endEntity(ISAXLexicalHandler *iface, con static HRESULT WINAPI SAXLexicalHandler_startCDATA(ISAXLexicalHandler *iface) { + static const WCHAR scdataW[] = {'<','!','[','C','D','A','T','A','['}; mxwriter *This = impl_from_ISAXLexicalHandler( iface ); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; + + TRACE("(%p)\n", This); + + write_output_buffer(This->buffer, scdataW, sizeof(scdataW)/sizeof(WCHAR)); + + return S_OK; } static HRESULT WINAPI SAXLexicalHandler_endCDATA(ISAXLexicalHandler *iface) { mxwriter *This = impl_from_ISAXLexicalHandler( iface ); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; + static const WCHAR ecdataW[] = {']',']','>'}; + + TRACE("(%p)\n", This); + + write_output_buffer(This->buffer, ecdataW, sizeof(ecdataW)/sizeof(WCHAR)); + + return S_OK; } static HRESULT WINAPI SAXLexicalHandler_comment(ISAXLexicalHandler *iface, const WCHAR *chars, int nchars) diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index d05596e..30ac57e 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2905,6 +2905,60 @@ static void test_mxwriter_comment(void) free_bstrs(); } +static void test_mxwriter_cdata(void) +{ + ISAXContentHandler *content; + ISAXLexicalHandler *lexical; + IMXWriter *writer; + VARIANT dest; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER, + &IID_IMXWriter, (void**)&writer); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_QueryInterface(writer, &IID_ISAXContentHandler, (void**)&content); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_QueryInterface(writer, &IID_ISAXLexicalHandler, (void**)&lexical); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_omitXMLDeclaration(writer, VARIANT_TRUE); + EXPECT_HR(hr, S_OK); + + hr = ISAXContentHandler_startDocument(content); + EXPECT_HR(hr, S_OK); + + hr = ISAXLexicalHandler_startCDATA(lexical); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_("<![CDATA["), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + hr = ISAXLexicalHandler_startCDATA(lexical); + EXPECT_HR(hr, S_OK); + + hr = ISAXLexicalHandler_endCDATA(lexical); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_("<![CDATA[<![CDATA[]]>"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + + ISAXContentHandler_Release(content); + ISAXLexicalHandler_Release(lexical); + IMXWriter_Release(writer); + free_bstrs(); + +} + START_TEST(saxreader) { ISAXXMLReader *reader; @@ -2941,6 +2995,7 @@ START_TEST(saxreader) test_mxwriter_startendelement(); test_mxwriter_characters(); test_mxwriter_comment(); + test_mxwriter_cdata(); test_mxwriter_properties(); test_mxwriter_flush(); test_mxwriter_stream();
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
98
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Results per page:
10
25
50
100
200