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
March 2014
----- 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
530 discussions
Start a n
N
ew thread
Michael Stefaniuc : avifil32: Support COM aggregation in WAVFile.
by Alexandre Julliard
04 Mar '14
04 Mar '14
Module: wine Branch: master Commit: 8e9cacf0997744f3877f2a2209a996cd7fe106ec URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8e9cacf0997744f3877f2a220…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 3 22:04:32 2014 +0100 avifil32: Support COM aggregation in WAVFile. --- dlls/avifil32/avifile_private.h | 2 +- dlls/avifil32/factory.c | 4 +- dlls/avifil32/wavfile.c | 157 +++++++++++++++++++++++---------------- 3 files changed, 98 insertions(+), 65 deletions(-) diff --git a/dlls/avifil32/avifile_private.h b/dlls/avifil32/avifile_private.h index 01f0ae6..0fd74c4 100644 --- a/dlls/avifil32/avifile_private.h +++ b/dlls/avifil32/avifile_private.h @@ -59,7 +59,7 @@ DEFINE_AVIGUID(CLSID_ACMStream, 0x0002000F, 0, 0); extern HMODULE AVIFILE_hModule DECLSPEC_HIDDEN; extern HRESULT AVIFILE_CreateAVIFile(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN; -extern HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN; +extern HRESULT AVIFILE_CreateWAVFile(IUnknown *outer_unk, REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; extern HRESULT AVIFILE_CreateACMStream(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN; extern HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppobj) DECLSPEC_HIDDEN; extern PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream) DECLSPEC_HIDDEN; diff --git a/dlls/avifil32/factory.c b/dlls/avifil32/factory.c index 5943774..c74a716 100644 --- a/dlls/avifil32/factory.c +++ b/dlls/avifil32/factory.c @@ -149,14 +149,14 @@ static HRESULT WINAPI IClassFactory_fnCreateInstance(LPCLASSFACTORY iface, if (IsEqualGUID(&CLSID_AVIFile, &This->clsid)) return AVIFILE_CreateAVIFile(pOuter, riid, ppobj); + if (IsEqualGUID(&CLSID_WAVFile, &This->clsid)) + return AVIFILE_CreateWAVFile(pOuter, riid, ppobj); if (pOuter) return CLASS_E_NOAGGREGATION; if (IsEqualGUID(&CLSID_ICMStream, &This->clsid)) return AVIFILE_CreateICMStream(riid,ppobj); - if (IsEqualGUID(&CLSID_WAVFile, &This->clsid)) - return AVIFILE_CreateWAVFile(riid,ppobj); if (IsEqualGUID(&CLSID_ACMStream, &This->clsid)) return AVIFILE_CreateACMStream(riid,ppobj); diff --git a/dlls/avifil32/wavfile.c b/dlls/avifil32/wavfile.c index 4277dd7..8ea63c9 100644 --- a/dlls/avifil32/wavfile.c +++ b/dlls/avifil32/wavfile.c @@ -185,7 +185,9 @@ typedef struct _IAVIStreamImpl { struct _IAVIFileImpl { IAVIFile IAVIFile_iface; - LONG ref; + IUnknown IUnknown_inner; + IUnknown *outer_unk; + LONG ref; /* IAVIFile, IAVIStream stuff... */ IPersistFileImpl iPersistFile; @@ -214,29 +216,109 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This); static HRESULT AVIFILE_LoadSunFile(IAVIFileImpl *This); static HRESULT AVIFILE_SaveFile(const IAVIFileImpl *This); -HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppv) +static inline IAVIFileImpl *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, IAVIFileImpl, IUnknown_inner); +} + +static HRESULT WINAPI IUnknown_fnQueryInterface(IUnknown *iface, REFIID riid, void **ret_iface) +{ + IAVIFileImpl *This = impl_from_IUnknown(iface); + + TRACE("(%p,%s,%p)\n", This, debugstr_guid(riid), ret_iface); + + if (IsEqualGUID(&IID_IUnknown, riid)) + *ret_iface = &This->IUnknown_inner; + else if (IsEqualGUID(&IID_IAVIFile, riid)) + *ret_iface = &This->IAVIFile_iface; + else if (IsEqualGUID(&IID_IAVIStream, riid)) + *ret_iface = &This->iAVIStream; + else if (IsEqualGUID(&IID_IPersistFile, riid)) + *ret_iface = &This->iPersistFile; + else { + WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ret_iface); + *ret_iface = NULL; + return E_NOINTERFACE; + } + + /* Violation of the COM aggregation ref counting rule */ + IUnknown_AddRef(&This->IUnknown_inner); + return S_OK; +} + +static ULONG WINAPI IUnknown_fnAddRef(IUnknown *iface) +{ + IAVIFileImpl *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI IUnknown_fnRelease(IUnknown *iface) +{ + IAVIFileImpl *This = impl_from_IUnknown(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if (!ref) { + /* need to write headers to file */ + if (This->fDirty) + AVIFILE_SaveFile(This); + + HeapFree(GetProcessHeap(), 0, This->lpFormat); + This->lpFormat = NULL; + This->cbFormat = 0; + HeapFree(GetProcessHeap(), 0, This->extra.lp); + This->extra.lp = NULL; + This->extra.cb = 0; + HeapFree(GetProcessHeap(), 0, This->szFileName); + This->szFileName = NULL; + if (This->hmmio) { + mmioClose(This->hmmio, 0); + This->hmmio = NULL; + } + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static const IUnknownVtbl unk_vtbl = +{ + IUnknown_fnQueryInterface, + IUnknown_fnAddRef, + IUnknown_fnRelease +}; + +HRESULT AVIFILE_CreateWAVFile(IUnknown *outer_unk, REFIID riid, void **ret_iface) { IAVIFileImpl *pfile; HRESULT hr; - assert(riid != NULL && ppv != NULL); - - *ppv = NULL; + *ret_iface = NULL; pfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIFileImpl)); if (pfile == NULL) return AVIERR_MEMORY; + pfile->IUnknown_inner.lpVtbl = &unk_vtbl; pfile->IAVIFile_iface.lpVtbl = &iwavft; pfile->iPersistFile.lpVtbl = &iwavpft; pfile->iAVIStream.lpVtbl = &iwavst; - pfile->ref = 0; + pfile->ref = 1; + if (outer_unk) + pfile->outer_unk = outer_unk; + else + pfile->outer_unk = &pfile->IUnknown_inner; + pfile->iPersistFile.paf = pfile; pfile->iAVIStream.paf = pfile; - hr = IAVIFile_QueryInterface((IAVIFile*)pfile, riid, ppv); - if (FAILED(hr)) - HeapFree(GetProcessHeap(), 0, pfile); + hr = IUnknown_QueryInterface(&pfile->IUnknown_inner, riid, ret_iface); + IUnknown_Release(&pfile->IUnknown_inner); return hr; } @@ -246,74 +328,25 @@ static inline IAVIFileImpl *impl_from_IAVIFile(IAVIFile *iface) return CONTAINING_RECORD(iface, IAVIFileImpl, IAVIFile_iface); } -static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile *iface, REFIID refiid, - LPVOID *obj) +static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile *iface, REFIID riid, void **ret_iface) { IAVIFileImpl *This = impl_from_IAVIFile(iface); - TRACE("(%p,%s,%p)\n", This, debugstr_guid(refiid), obj); - - if (IsEqualGUID(&IID_IUnknown, refiid) || - IsEqualGUID(&IID_IAVIFile, refiid)) { - *obj = iface; - IAVIFile_AddRef(iface); - return S_OK; - } else if (IsEqualGUID(&IID_IAVIStream, refiid)) { - *obj = &This->iAVIStream; - IAVIFile_AddRef(iface); - return S_OK; - } else if (IsEqualGUID(&IID_IPersistFile, refiid)) { - *obj = &This->iPersistFile; - IAVIFile_AddRef(iface); - return S_OK; - } - - return OLE_E_ENUM_NOMORE; + return IUnknown_QueryInterface(This->outer_unk, riid, ret_iface); } static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile *iface) { IAVIFileImpl *This = impl_from_IAVIFile(iface); - TRACE("(%p)\n",iface); - - return InterlockedIncrement(&This->ref); + return IUnknown_AddRef(This->outer_unk); } static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface) { IAVIFileImpl *This = impl_from_IAVIFile(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p)\n",iface); - - if (!ref) { - if (This->fDirty) { - /* need to write headers to file */ - AVIFILE_SaveFile(This); - } - if (This->lpFormat != NULL) { - HeapFree(GetProcessHeap(), 0, This->lpFormat); - This->lpFormat = NULL; - This->cbFormat = 0; - } - if (This->extra.lp != NULL) { - HeapFree(GetProcessHeap(), 0, This->extra.lp); - This->extra.lp = NULL; - This->extra.cb = 0; - } - HeapFree(GetProcessHeap(), 0, This->szFileName); - This->szFileName = NULL; - if (This->hmmio != NULL) { - mmioClose(This->hmmio, 0); - This->hmmio = NULL; - } - - HeapFree(GetProcessHeap(), 0, This); - return 0; - } - return ref; + return IUnknown_Release(This->outer_unk); } static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile *iface, AVIFILEINFOW *afi, LONG size)
1
0
0
0
Michael Stefaniuc : avifil32: Unconditionally support IAVIStream in WAVFile.
by Alexandre Julliard
04 Mar '14
04 Mar '14
Module: wine Branch: master Commit: 3815c1e9b6bb4853904af57dc62e2939cf93599f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3815c1e9b6bb4853904af57dc…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 3 21:59:55 2014 +0100 avifil32: Unconditionally support IAVIStream in WAVFile. --- dlls/avifil32/wavfile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/avifil32/wavfile.c b/dlls/avifil32/wavfile.c index 26487ec..4277dd7 100644 --- a/dlls/avifil32/wavfile.c +++ b/dlls/avifil32/wavfile.c @@ -258,8 +258,7 @@ static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile *iface, REFIID refiid, *obj = iface; IAVIFile_AddRef(iface); return S_OK; - } else if (This->fInfo.dwStreams == 1 && - IsEqualGUID(&IID_IAVIStream, refiid)) { + } else if (IsEqualGUID(&IID_IAVIStream, refiid)) { *obj = &This->iAVIStream; IAVIFile_AddRef(iface); return S_OK;
1
0
0
0
Michael Stefaniuc : avifil32: Basic COM cleanup for IAVIFile from WAVFile.
by Alexandre Julliard
04 Mar '14
04 Mar '14
Module: wine Branch: master Commit: d1bbb471e877ff7df2a7372d1d36a9ab7702bae5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d1bbb471e877ff7df2a7372d1…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 3 21:56:00 2014 +0100 avifil32: Basic COM cleanup for IAVIFile from WAVFile. --- dlls/avifil32/wavfile.c | 49 ++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/dlls/avifil32/wavfile.c b/dlls/avifil32/wavfile.c index 07f9b5e..26487ec 100644 --- a/dlls/avifil32/wavfile.c +++ b/dlls/avifil32/wavfile.c @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS #include <assert.h> #include <stdarg.h> @@ -183,8 +184,7 @@ typedef struct _IAVIStreamImpl { } IAVIStreamImpl; struct _IAVIFileImpl { - /* IUnknown stuff */ - const IAVIFileVtbl *lpVtbl; + IAVIFile IAVIFile_iface; LONG ref; /* IAVIFile, IAVIStream stuff... */ @@ -227,7 +227,7 @@ HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppv) if (pfile == NULL) return AVIERR_MEMORY; - pfile->lpVtbl = &iwavft; + pfile->IAVIFile_iface.lpVtbl = &iwavft; pfile->iPersistFile.lpVtbl = &iwavpft; pfile->iAVIStream.lpVtbl = &iwavst; pfile->ref = 0; @@ -241,10 +241,15 @@ HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppv) return hr; } +static inline IAVIFileImpl *impl_from_IAVIFile(IAVIFile *iface) +{ + return CONTAINING_RECORD(iface, IAVIFileImpl, IAVIFile_iface); +} + static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile *iface, REFIID refiid, LPVOID *obj) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); TRACE("(%p,%s,%p)\n", This, debugstr_guid(refiid), obj); @@ -269,7 +274,7 @@ static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile *iface, REFIID refiid, static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile *iface) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); TRACE("(%p)\n",iface); @@ -278,7 +283,7 @@ static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile *iface) static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p)\n",iface); @@ -312,10 +317,9 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface) return ref; } -static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile *iface, LPAVIFILEINFOW afi, - LONG size) +static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile *iface, AVIFILEINFOW *afi, LONG size) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); TRACE("(%p,%p,%d)\n",iface,afi,size); @@ -346,10 +350,10 @@ static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile *iface, LPAVIFILEINFOW afi, return AVIERR_OK; } -static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, PAVISTREAM *avis, - DWORD fccType, LONG lParam) +static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, IAVIStream **avis, DWORD fccType, + LONG lParam) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); TRACE("(%p,%p,0x%08X,%d)\n", iface, avis, fccType, lParam); @@ -371,10 +375,10 @@ static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile *iface, PAVISTREAM *avis, return AVIERR_OK; } -static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile *iface,PAVISTREAM *avis, - LPAVISTREAMINFOW asi) +static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile *iface, IAVIStream **avis, + AVISTREAMINFOW *asi) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); TRACE("(%p,%p,%p)\n", iface, avis, asi); @@ -422,10 +426,9 @@ static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile *iface,PAVISTREAM *avis, return AVIERR_OK; } -static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile *iface, DWORD ckid, - LPVOID lpData, LONG size) +static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile *iface, DWORD ckid, void *lpData, LONG size) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); TRACE("(%p,0x%08X,%p,%d)\n", iface, ckid, lpData, size); @@ -444,10 +447,9 @@ static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile *iface, DWORD ckid, return WriteExtraChunk(&This->extra, ckid, lpData, size); } -static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile *iface, DWORD ckid, - LPVOID lpData, LONG *size) +static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile *iface, DWORD ckid, void *lpData, LONG *size) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); TRACE("(%p,0x%08X,%p,%p)\n", iface, ckid, lpData, size); @@ -464,10 +466,9 @@ static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile *iface) return AVIERR_OK; } -static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile *iface, DWORD fccType, - LONG lParam) +static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile *iface, DWORD fccType, LONG lParam) { - IAVIFileImpl *This = (IAVIFileImpl *)iface; + IAVIFileImpl *This = impl_from_IAVIFile(iface); TRACE("(%p,0x%08X,%d)\n", iface, fccType, lParam);
1
0
0
0
Christoph von Wittich : comctl32/tests: CCS_VERT should be set when TBSTYLE_EX_VERTICAL is set.
by Alexandre Julliard
04 Mar '14
04 Mar '14
Module: wine Branch: master Commit: 7d5deb2e7f52537dce8f62f768155970f47bcc46 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d5deb2e7f52537dce8f62f76…
Author: Christoph von Wittich <Christoph(a)ApiViewer.de> Date: Sat Feb 22 21:08:29 2014 +0100 comctl32/tests: CCS_VERT should be set when TBSTYLE_EX_VERTICAL is set. --- dlls/comctl32/tests/toolbar.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index 29c80fb..c492763 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -1910,6 +1910,16 @@ static void test_TB_GET_SET_EXTENDEDSTYLE(void) ok(style == ptr->style_set, "%d: got style 0x%08x, expected 0x%08x\n", i, style, ptr->style_set); } + /* Windows sets CCS_VERT when TB_GETEXTENDEDSTYLE is set */ + oldstyle2 = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0); + oldstyle = SendMessageA(hwnd, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_VERTICAL); + ok(oldstyle == oldstyle2, "got old style 0x%08x, expected 0x%08x\n", oldstyle, oldstyle2); + style = SendMessageA(hwnd, TB_GETEXTENDEDSTYLE, 0, 0); + ok(style == TBSTYLE_EX_VERTICAL, "got style 0x%08x, expected 0x%08x\n", style, TBSTYLE_EX_VERTICAL); + style = SendMessageA(hwnd, TB_GETSTYLE, 0, 0); + todo_wine + ok(style == CCS_VERT, "got style 0x%08x, expected 0x%08x\n", style, CCS_VERT); + DestroyWindow(hwnd); }
1
0
0
0
Francois Gouget : oleaut32/tests: Fix compilation on systems that don' t support nameless structs.
by Alexandre Julliard
03 Mar '14
03 Mar '14
Module: wine Branch: master Commit: 376953e00a97cc6ff5e18e8a8e0cd7fb70b15629 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=376953e00a97cc6ff5e18e8a8…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Mar 3 18:43:17 2014 +0100 oleaut32/tests: Fix compilation on systems that don't support nameless structs. --- dlls/oleaut32/tests/olefont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c index 53afc8d..ded1838 100644 --- a/dlls/oleaut32/tests/olefont.c +++ b/dlls/oleaut32/tests/olefont.c @@ -433,8 +433,8 @@ static void test_font_events_disp(void) } case DISPID_FONT_SIZE: V_VT(&vararg) = VT_CY; - V_CY(&vararg).Lo = 25; - V_CY(&vararg).Hi = 0; + S(V_CY(&vararg)).Lo = 25; + S(V_CY(&vararg)).Hi = 0; break; case DISPID_FONT_BOLD: V_VT(&vararg) = VT_BOOL;
1
0
0
0
Matteo Bruni : d3dx9/tests: Replace a test giving inconsistent results on Windows.
by Alexandre Julliard
03 Mar '14
03 Mar '14
Module: wine Branch: master Commit: e32672f2d7d7969cf4f4f4239b0daea265b5c9f4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e32672f2d7d7969cf4f4f4239…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Mar 3 17:48:15 2014 +0100 d3dx9/tests: Replace a test giving inconsistent results on Windows. --- dlls/d3dx9_36/tests/mesh.c | 54 +++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c index 3fd5d9d..24bcb82 100644 --- a/dlls/d3dx9_36/tests/mesh.c +++ b/dlls/d3dx9_36/tests/mesh.c @@ -6449,11 +6449,6 @@ static void test_weld_vertices(void) D3DXVECTOR3 position; SHORT normal[4]; }; - struct vertex_color_float4 - { - D3DXVECTOR3 position; - D3DXVECTOR4 color; - }; struct vertex_texcoord_float16_2 { D3DXVECTOR3 position; @@ -6481,7 +6476,6 @@ static void test_weld_vertices(void) UINT vertex_size_color_ubyte4 = sizeof(struct vertex_color_ubyte4); UINT vertex_size_texcoord_short2 = sizeof(struct vertex_texcoord_short2); UINT vertex_size_normal_short4 = sizeof(struct vertex_normal_short4); - UINT vertex_size_color_float4 = sizeof(struct vertex_color_float4); UINT vertex_size_texcoord_float16_2 = sizeof(struct vertex_texcoord_float16_2); UINT vertex_size_texcoord_float16_4 = sizeof(struct vertex_texcoord_float16_4); UINT vertex_size_normal_udec3 = sizeof(struct vertex_normal_udec3); @@ -6576,10 +6570,10 @@ static void test_weld_vertices(void) {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 2}, D3DDECL_END() }; - D3DVERTEXELEMENT9 declaration_color2_float4[] = + D3DVERTEXELEMENT9 declaration_color1[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, - {0, 12, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 2}, + {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1}, D3DDECL_END() }; D3DVERTEXELEMENT9 declaration_texcoord_float16_2[] = @@ -7443,34 +7437,38 @@ static void test_weld_vertices(void) const DWORD exp_face_remap26[] = {0, 1}; const DWORD exp_vertex_remap26[] = {0, 1, 2, 3, 4, 5}; const DWORD exp_new_num_vertices26 = ARRAY_SIZE(exp_vertices26); - /* Test 27. Weld color with usage index larger than 1. Check that the - * default epsilon of 1e-6f is used. */ - D3DXVECTOR4 zero_float4 = {0.0f, 0.0f, 0.0f, 0.0f}; - D3DXVECTOR4 almost_zero_float4 = {0.0f + FLT_EPSILON, 0.0f + FLT_EPSILON, 0.0f + FLT_EPSILON, 0.0f + FLT_EPSILON}; - const struct vertex_color_float4 vertices27[] = + /* Test 27. Weld color with usage index 1 (specular). */ + /* Previously this test used float color values and index > 1 but that case + * appears to be effectively unhandled in native so the test gave + * inconsistent results. */ + const struct vertex_color vertices27[] = { - {{ 0.0f, 3.0f, 0.f}, zero_float4}, - {{ 2.0f, 3.0f, 0.f}, zero_float4}, - {{ 0.0f, 0.0f, 0.f}, zero_float4}, + {{ 0.0f, 3.0f, 0.0f}, 0x00000000}, + {{ 2.0f, 3.0f, 0.0f}, 0x10203040}, + {{ 0.0f, 0.0f, 0.0f}, 0x50607080}, - {{ 3.0f, 3.0f, 0.f}, almost_zero_float4}, - {{ 3.0f, 0.0f, 0.f}, zero_float4}, - {{ 1.0f, 0.0f, 0.f}, almost_zero_float4}, + {{ 3.0f, 3.0f, 0.0f}, 0x11213141}, + {{ 3.0f, 0.0f, 0.0f}, 0xffffffff}, + {{ 1.0f, 0.0f, 0.0f}, 0x51617181}, }; const DWORD indices27[] = {0, 1, 2, 3, 4, 5}; const DWORD attributes27[] = {0, 0}; const UINT num_vertices27 = ARRAY_SIZE(vertices27); const UINT num_faces27 = ARRAY_SIZE(indices27) / VERTS_PER_FACE; DWORD flags27 = D3DXWELDEPSILONS_WELDPARTIALMATCHES; - const D3DXWELDEPSILONS epsilons27 = {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f}; + const D3DXWELDEPSILONS epsilons27 = + { + 1.1f, 0.0f, 0.0f, 0.0f, 2.0f / 255.0f, 0.0f, + {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, 0.0f + }; const DWORD adjacency27[] = {-1, 1, -1, -1, -1, 0}; - const struct vertex_color_float4 exp_vertices27[] = + const struct vertex_color exp_vertices27[] = { - {{ 0.0f, 3.0f, 0.f}, zero_float4}, - {{ 2.0f, 3.0f, 0.f}, zero_float4}, - {{ 0.0f, 0.0f, 0.f}, zero_float4}, + {{ 0.0f, 3.0f, 0.0f}, 0x00000000}, + {{ 2.0f, 3.0f, 0.0f}, 0x10203040}, + {{ 0.0f, 0.0f, 0.0f}, 0x50607080}, - {{ 3.0f, 0.0f, 0.f}, zero_float4}, + {{ 3.0f, 0.0f, 0.0f}, 0xffffffff}, }; const DWORD exp_indices27[] = {0, 1, 2, 1, 3, 2}; const DWORD exp_face_remap27[] = {0, 1}; @@ -8064,8 +8062,8 @@ static void test_weld_vertices(void) num_vertices27, num_faces27, options, - declaration_color2_float4, - vertex_size_color_float4, + declaration_color1, + vertex_size_color, flags27, &epsilons27, adjacency27, @@ -8144,7 +8142,7 @@ static void test_weld_vertices(void) goto cleanup; } face_remap = HeapAlloc(GetProcessHeap(), 0, tc[i].num_faces * sizeof(*face_remap)); - if (!adjacency_out) + if (!face_remap) { skip("Couldn't allocate face_remap array.\n"); goto cleanup;
1
0
0
0
Matteo Bruni : d3dx9: Allow loading DDS volume textures into 2D textures.
by Alexandre Julliard
03 Mar '14
03 Mar '14
Module: wine Branch: master Commit: df3c573f63211f9bcafaed2d591f4c64dd9b59e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=df3c573f63211f9bcafaed2d5…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Mar 3 17:48:14 2014 +0100 d3dx9: Allow loading DDS volume textures into 2D textures. --- dlls/d3dx9_36/d3dx9_36_private.h | 3 ++- dlls/d3dx9_36/surface.c | 17 ++++++++++++--- dlls/d3dx9_36/tests/texture.c | 43 +++++++++++++++++++++++++++++++++++--- dlls/d3dx9_36/texture.c | 11 ++++++++-- 4 files changed, 65 insertions(+), 9 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index 0aef8cd..492b665 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -88,7 +88,8 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic const struct pixel_format_desc *dst_format, D3DCOLOR color_key, const PALETTEENTRY *palette) DECLSPEC_HIDDEN; HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const PALETTEENTRY *palette, - DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN; + DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info, + unsigned int *loaded_miplevels) DECLSPEC_HIDDEN; HRESULT load_cube_texture_from_dds(IDirect3DCubeTexture9 *cube_texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN; HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *dst_palette, diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 5e87d94..97c71bf 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -539,7 +539,8 @@ HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *d } HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const PALETTEENTRY *palette, - DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) + DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info, + unsigned int *loaded_miplevels) { HRESULT hr; @@ -553,13 +554,21 @@ HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const struct dds_header *header = src_data; const BYTE *pixels = (BYTE *)(header + 1); - /* Loading a cube texture as a simple texture is also supported (only first face texture is taken) */ - if ((src_info->ResourceType != D3DRTYPE_TEXTURE) && (src_info->ResourceType != D3DRTYPE_CUBETEXTURE)) + /* Loading a cube texture as a simple texture is also supported + * (only first face texture is taken). Same with volume textures. */ + if ((src_info->ResourceType != D3DRTYPE_TEXTURE) + && (src_info->ResourceType != D3DRTYPE_CUBETEXTURE) + && (src_info->ResourceType != D3DRTYPE_VOLUMETEXTURE)) + { + WARN("Trying to load a %u resource as a 2D texture, returning failure.\n", src_info->ResourceType); return D3DXERR_INVALIDDATA; + } width = src_info->Width; height = src_info->Height; mip_levels = min(src_info->MipLevels, IDirect3DTexture9_GetLevelCount(texture)); + if (src_info->ResourceType == D3DRTYPE_VOLUMETEXTURE) + mip_levels = 1; for (mip_level = 0; mip_level < mip_levels; mip_level++) { hr = calculate_dds_surface_size(src_info->Format, width, height, &src_pitch, &mip_level_size); @@ -578,6 +587,8 @@ HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, height = max(1, height / 2); } + *loaded_miplevels = mip_levels; + return D3D_OK; } diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 4a93ac6..a2fc551 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -25,7 +25,7 @@ #include "d3dx9tex.h" #include "resources.h" -static int has_2d_dxt5, has_cube_dxt5; +static int has_2d_dxt3, has_2d_dxt5, has_cube_dxt5; /* 2x2 16-bit dds, no mipmaps */ static const unsigned char dds_16bit[] = { @@ -1433,6 +1433,7 @@ static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device) D3DSURFACE_DESC desc; D3DLOCKED_RECT lock_rect; int i; + DWORD level_count; hr = D3DXCreateTextureFromFileInMemory(device, dds_16bit, sizeof(dds_16bit), &texture); ok(hr == D3D_OK, "D3DXCreateTextureFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); @@ -1464,12 +1465,46 @@ static void test_D3DXCreateTextureFromFileInMemory(IDirect3DDevice9 *device) if (SUCCEEDED(hr)) { for (i = 0; i < 16; i++) - ok(((BYTE*)lock_rect.pBits)[i] == dds_cube_map[128+i], "Byte at index %u is 0x%02x, expected 0x%02x\n", i, ((BYTE*)lock_rect.pBits)[i], dds_cube_map[144+i]); + ok(((BYTE *)lock_rect.pBits)[i] == dds_cube_map[128 + i], + "Byte at index %u is 0x%02x, expected 0x%02x.\n", + i, ((BYTE *)lock_rect.pBits)[i], dds_cube_map[128 + i]); IDirect3DTexture9_UnlockRect(texture, 0); } IDirect3DTexture9_Release(texture); } + + /* Volume textures work too. */ + hr = D3DXCreateTextureFromFileInMemory(device, dds_volume_map, sizeof(dds_volume_map), &texture); + if (has_2d_dxt3) + ok(hr == D3D_OK, "D3DXCreateTextureFromFileInMemory returned %#x, expected %#x.\n", hr, D3D_OK); + else + todo_wine ok(hr == D3D_OK, "D3DXCreateTextureFromFileInMemory returned %#x, expected %#x.\n", hr, D3D_OK); + if (SUCCEEDED(hr)) + { + type = IDirect3DTexture9_GetType(texture); + ok(type == D3DRTYPE_TEXTURE, "IDirect3DTexture9_GetType returned %u, expected %u.\n", type, D3DRTYPE_TEXTURE); + level_count = IDirect3DBaseTexture9_GetLevelCount((IDirect3DBaseTexture9 *)texture); + todo_wine ok(level_count == 3, "Texture has %u mip levels, 3 expected.\n", level_count); + hr = IDirect3DTexture9_GetLevelDesc(texture, 0, &desc); + ok(hr == D3D_OK, "IDirect3DTexture9_GetLevelDesc returned %#x, expected %#x.\n", hr, D3D_OK); + ok(desc.Width == 4, "Width is %u, expected 4.\n", desc.Width); + ok(desc.Height == 4, "Height is %u, expected 4.\n", desc.Height); + + hr = IDirect3DTexture9_LockRect(texture, 0, &lock_rect, NULL, D3DLOCK_READONLY); + ok(hr == D3D_OK, "IDirect3DTexture9_LockRect returned %#x, expected %#x.\n", hr, D3D_OK); + if (SUCCEEDED(hr)) + { + for (i = 0; i < 16; ++i) + ok(((BYTE *)lock_rect.pBits)[i] == dds_volume_map[128 + i], + "Byte at index %u is 0x%02x, expected 0x%02x.\n", + i, ((BYTE *)lock_rect.pBits)[i], dds_volume_map[128 + i]); + IDirect3DTexture9_UnlockRect(texture, 0); + } + /* The lower texture levels are apparently generated by filtering the level 0 surface + * I.e. following levels from the file are ignored. */ + IDirect3DTexture9_Release(texture); + } } static void test_D3DXCreateTextureFromFileInMemoryEx(IDirect3DDevice9 *device) @@ -1821,7 +1856,9 @@ START_TEST(texture) return; } - /* Check whether DXT5 textures are supported */ + /* Check whether DXTn textures are supported. */ + has_2d_dxt3 = SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT3)); hr = IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT5); has_2d_dxt5 = SUCCEEDED(hr); diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index be86347..f5f754d 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -602,6 +602,12 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi FIXME("Generation of mipmaps for compressed pixel formats is not implemented yet\n"); miplevels = imginfo.MipLevels; } + if (imginfo.ResourceType == D3DRTYPE_VOLUMETEXTURE + && D3DFMT_DXT1 <= imginfo.Format && imginfo.Format <= D3DFMT_DXT5 && miplevels > 1) + { + FIXME("Generation of mipmaps for compressed pixel formats is not implemented yet.\n"); + miplevels = 1; + } if (((file_width) && (width != imginfo.Width)) || ((file_height) && (height != imginfo.Height)) || @@ -640,10 +646,12 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi IDirect3DTexture9_GetSurfaceLevel(*texptr, 0, &surface); hr = D3DXLoadSurfaceFromFileInMemory(surface, palette, NULL, srcdata, srcdatasize, NULL, filter, colorkey, NULL); IDirect3DSurface9_Release(surface); + loaded_miplevels = min(IDirect3DTexture9_GetLevelCount(*texptr), imginfo.MipLevels); } else { - hr = load_texture_from_dds(*texptr, srcdata, palette, filter, colorkey, &imginfo); + hr = load_texture_from_dds(*texptr, srcdata, palette, filter, colorkey, &imginfo, + &loaded_miplevels); } if (FAILED(hr)) @@ -654,7 +662,6 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi return hr; } - loaded_miplevels = min(IDirect3DTexture9_GetLevelCount(*texptr), imginfo.MipLevels); hr = D3DXFilterTexture((IDirect3DBaseTexture9*) *texptr, palette, loaded_miplevels - 1, mipfilter); if (FAILED(hr)) {
1
0
0
0
Matteo Bruni : d3dx9: Improve a number of WARN messages.
by Alexandre Julliard
03 Mar '14
03 Mar '14
Module: wine Branch: master Commit: 9008971bde5265bd88098b53a57cda66e15738a8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9008971bde5265bd88098b53a…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Mar 3 17:48:13 2014 +0100 d3dx9: Improve a number of WARN messages. --- dlls/d3dx9_36/effect.c | 86 ++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 43 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9008971bde5265bd88098…
1
0
0
0
Matteo Bruni : d3dx9: Always use type-> Rows as D3DXPC_MATRIX_ROWS parameters size.
by Alexandre Julliard
03 Mar '14
03 Mar '14
Module: wine Branch: master Commit: 8b5cd9edbcc94267d5ed6ae0ba6b8d34b19ee341 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8b5cd9edbcc94267d5ed6ae0b…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Mar 3 17:48:12 2014 +0100 d3dx9: Always use type->Rows as D3DXPC_MATRIX_ROWS parameters size. --- dlls/d3dx9_36/shader.c | 8 ++++---- dlls/d3dx9_36/tests/shader.c | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 955c2ad..68e7474 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -1775,7 +1775,7 @@ static const struct ID3DXConstantTableVtbl ID3DXConstantTable_Vtbl = }; static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, struct ctab_constant *constant, - BOOL is_element, WORD index, WORD max, DWORD *offset, DWORD nameoffset, UINT regset) + BOOL is_element, WORD index, WORD max_index, DWORD *offset, DWORD nameoffset, UINT regset) { const D3DXSHADER_TYPEINFO *type = (LPD3DXSHADER_TYPEINFO)(ctab + typeoffset); const D3DXSHADER_STRUCTMEMBERINFO *memberinfo = NULL; @@ -1824,7 +1824,7 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru for (i = 0; i < count; ++i) { hr = parse_ctab_constant_type(ctab, memberinfo ? memberinfo[i].TypeInfo : typeoffset, - &constant->constants[i], memberinfo == NULL, index + size, max, offset, + &constant->constants[i], memberinfo == NULL, index + size, max_index, offset, memberinfo ? memberinfo[i].Name : nameoffset, regset); if (hr != D3D_OK) goto error; @@ -1859,7 +1859,7 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru case D3DXPC_MATRIX_ROWS: offsetdiff = type->Rows * 4; - size = is_element ? type->Rows : max(type->Rows, type->Columns); + size = type->Rows; break; case D3DXPC_MATRIX_COLUMNS: @@ -1893,7 +1893,7 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru if (offset) *offset += offsetdiff * 4; } - constant->desc.RegisterCount = max(0, min(max - index, size)); + constant->desc.RegisterCount = max(0, min(max_index - index, size)); constant->desc.Bytes = 4 * constant->desc.Elements * type->Rows * type->Columns; return D3D_OK; diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index 74ada6e..80c0f64 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -120,7 +120,7 @@ static const DWORD ctab_matrices[] = { 0x000000ac, 0x00000058, 0x00070002, 0x00000001, 0x00000064, 0x00000000, /* Constant 1 desc (fmatrix3x1) */ 0x00000074, 0x00000002, 0x00000004, 0x00000080, 0x00000000, /* Constant 2 desc (fmatrix4x4) */ - 0x00000090, 0x00040002, 0x00000003, 0x0000009c, 0x00000000, /* Constant 3 desc (imatrix2x3) */ + 0x00000090, 0x00040002, 0x00000002, 0x0000009c, 0x00000000, /* Constant 3 desc (imatrix2x3) */ 0x74616D66, 0x33786972, 0xab003178, /* Constant 1 name */ 0x00030003, 0x00010003, 0x00000001, 0x00000000, /* Constant 1 type desc */ 0x74616D66, 0x34786972, 0xab003478, /* Constant 2 name */ @@ -133,8 +133,9 @@ static const DWORD ctab_matrices[] = { static const D3DXCONSTANT_DESC ctab_matrices_expected[] = { {"fmatrix4x4", D3DXRS_FLOAT4, 0, 4, D3DXPC_MATRIX_COLUMNS, D3DXPT_FLOAT, 4, 4, 1, 0, 64, NULL}, - {"imatrix2x3", D3DXRS_FLOAT4, 4, 3, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 1, 0, 24, NULL}, - {"fmatrix3x1", D3DXRS_FLOAT4, 7, 1, D3DXPC_MATRIX_COLUMNS, D3DXPT_FLOAT, 3, 1, 1, 0, 12, NULL}}; + {"imatrix2x3", D3DXRS_FLOAT4, 4, 2, D3DXPC_MATRIX_ROWS, D3DXPT_INT, 2, 3, 1, 0, 24, NULL}, + {"fmatrix3x1", D3DXRS_FLOAT4, 7, 1, D3DXPC_MATRIX_COLUMNS, D3DXPT_FLOAT, 3, 1, 1, 0, 12, NULL}, +}; static const DWORD ctab_matrices2[] = { 0xfffe0200, /* vs_2_0 */
1
0
0
0
Matteo Bruni : d3dx9: Turn D3DXCreateEffectEx FIXME into a TRACE, improve it a bit.
by Alexandre Julliard
03 Mar '14
03 Mar '14
Module: wine Branch: master Commit: c6fefc20a64fec183466bd5bec6d1d5161951a4f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c6fefc20a64fec183466bd5be…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Mar 3 17:48:11 2014 +0100 d3dx9: Turn D3DXCreateEffectEx FIXME into a TRACE, improve it a bit. --- dlls/d3dx9_36/effect.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index a4325af..03118b5 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -5294,8 +5294,10 @@ HRESULT WINAPI D3DXCreateEffectEx(struct IDirect3DDevice9 *device, const void *s struct ID3DXEffectImpl *object; HRESULT hr; - FIXME("(%p, %p, %u, %p, %p, %p, %#x, %p, %p, %p): semi-stub\n", device, srcdata, srcdatalen, defines, include, - skip_constants, flags, pool, effect, compilation_errors); + TRACE("device %p, srcdata %p, srcdatalen %u, defines %p, include %p," + " skip_constants %p, flags %#x, pool %p, effect %p, compilation_errors %p.\n", + device, srcdata, srcdatalen, defines, include, + skip_constants, flags, pool, effect, compilation_errors); if (compilation_errors) *compilation_errors = NULL; @@ -5310,6 +5312,9 @@ HRESULT WINAPI D3DXCreateEffectEx(struct IDirect3DDevice9 *device, const void *s if (!effect) return D3D_OK; + if (skip_constants) + FIXME("skip_constants is not NULL, not supported yet.\n"); + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) return E_OUTOFMEMORY;
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
53
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
Results per page:
10
25
50
100
200