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 2011
----- 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
879 discussions
Start a n
N
ew thread
Michael Stefaniuc : avifil32: Avoid forward declarations of iface methods.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 81c91c4344d0d970bcfa33181c8cad069091bb67 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=81c91c4344d0d970bcfa33181…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Jan 24 00:06:38 2011 +0100 avifil32: Avoid forward declarations of iface methods. --- dlls/avifil32/editstream.c | 131 +++++++++++++++----------------------------- 1 files changed, 45 insertions(+), 86 deletions(-) diff --git a/dlls/avifil32/editstream.c b/dlls/avifil32/editstream.c index edabb09..6d38725 100644 --- a/dlls/avifil32/editstream.c +++ b/dlls/avifil32/editstream.c @@ -50,75 +50,6 @@ typedef struct _EditStreamTable { #define EditStreamEnd(This,streamNr) ((This)->pStreams[streamNr].dwStart + \ (This)->pStreams[streamNr].dwLength) -/***********************************************************************/ - -static HRESULT WINAPI IAVIEditStream_fnQueryInterface(IAVIEditStream*iface,REFIID refiid,LPVOID *obj); -static ULONG WINAPI IAVIEditStream_fnAddRef(IAVIEditStream*iface); -static ULONG WINAPI IAVIEditStream_fnRelease(IAVIEditStream*iface); -static HRESULT WINAPI IAVIEditStream_fnCut(IAVIEditStream*iface,LONG*plStart, - LONG*plLength,PAVISTREAM*ppResult); -static HRESULT WINAPI IAVIEditStream_fnCopy(IAVIEditStream*iface,LONG*plStart, - LONG*plLength,PAVISTREAM*ppResult); -static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart, - LONG*plLength,PAVISTREAM pSource, - LONG lStart,LONG lEnd); -static HRESULT WINAPI IAVIEditStream_fnClone(IAVIEditStream*iface, - PAVISTREAM*ppResult); -static HRESULT WINAPI IAVIEditStream_fnSetInfo(IAVIEditStream*iface, - LPAVISTREAMINFOW asi,LONG size); - -static const struct IAVIEditStreamVtbl ieditstream = { - IAVIEditStream_fnQueryInterface, - IAVIEditStream_fnAddRef, - IAVIEditStream_fnRelease, - IAVIEditStream_fnCut, - IAVIEditStream_fnCopy, - IAVIEditStream_fnPaste, - IAVIEditStream_fnClone, - IAVIEditStream_fnSetInfo -}; - -static HRESULT WINAPI IEditAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID*obj); -static ULONG WINAPI IEditAVIStream_fnAddRef(IAVIStream*iface); -static ULONG WINAPI IEditAVIStream_fnRelease(IAVIStream*iface); -static HRESULT WINAPI IEditAVIStream_fnCreate(IAVIStream*iface,LPARAM lParam1,LPARAM lParam2); -static HRESULT WINAPI IEditAVIStream_fnInfo(IAVIStream*iface,AVISTREAMINFOW *psi,LONG size); -static LONG WINAPI IEditAVIStream_fnFindSample(IAVIStream*iface,LONG pos, - LONG flags); -static HRESULT WINAPI IEditAVIStream_fnReadFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG*formatsize); -static HRESULT WINAPI IEditAVIStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG formatsize); -static HRESULT WINAPI IEditAVIStream_fnRead(IAVIStream*iface,LONG start, - LONG samples,LPVOID buffer, - LONG buffersize,LONG*bytesread, - LONG*samplesread); -static HRESULT WINAPI IEditAVIStream_fnWrite(IAVIStream*iface,LONG start, - LONG samples,LPVOID buffer, - LONG buffersize,DWORD flags, - LONG*sampwritten,LONG*byteswritten); -static HRESULT WINAPI IEditAVIStream_fnDelete(IAVIStream*iface,LONG start,LONG samples); -static HRESULT WINAPI IEditAVIStream_fnReadData(IAVIStream*iface,DWORD fcc, - LPVOID lp,LONG *lpread); -static HRESULT WINAPI IEditAVIStream_fnWriteData(IAVIStream*iface,DWORD fcc, - LPVOID lp,LONG size); -static HRESULT WINAPI IEditAVIStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,LONG infolen); - -static const struct IAVIStreamVtbl ieditstast = { - IEditAVIStream_fnQueryInterface, - IEditAVIStream_fnAddRef, - IEditAVIStream_fnRelease, - IEditAVIStream_fnCreate, - IEditAVIStream_fnInfo, - IEditAVIStream_fnFindSample, - IEditAVIStream_fnReadFormat, - IEditAVIStream_fnSetFormat, - IEditAVIStream_fnRead, - IEditAVIStream_fnWrite, - IEditAVIStream_fnDelete, - IEditAVIStream_fnReadData, - IEditAVIStream_fnWriteData, - IEditAVIStream_fnSetInfo -}; - typedef struct _IAVIEditStreamImpl IAVIEditStreamImpl; struct _IAVIEditStreamImpl { @@ -151,23 +82,6 @@ static inline IAVIEditStreamImpl *impl_from_IAVIStream(IAVIStream *iface) /***********************************************************************/ -PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream) -{ - IAVIEditStreamImpl *pedit = NULL; - - pedit = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIEditStreamImpl)); - if (pedit == NULL) - return NULL; - - pedit->IAVIEditStream_iface.lpVtbl = &ieditstream; - pedit->IAVIStream_iface.lpVtbl = &ieditstast; - pedit->ref = 1; - - IAVIStream_Create(&pedit->IAVIStream_iface, (LPARAM)pstream, 0); - - return (PAVIEDITSTREAM)pedit; -} - static HRESULT AVIFILE_FindStreamInTable(IAVIEditStreamImpl* const This, DWORD pos,PAVISTREAM *ppStream, DWORD* streamPos, @@ -749,6 +663,17 @@ static HRESULT WINAPI IAVIEditStream_fnSetInfo(IAVIEditStream*iface, return AVIERR_OK; } +static const struct IAVIEditStreamVtbl ieditstream = { + IAVIEditStream_fnQueryInterface, + IAVIEditStream_fnAddRef, + IAVIEditStream_fnRelease, + IAVIEditStream_fnCut, + IAVIEditStream_fnCopy, + IAVIEditStream_fnPaste, + IAVIEditStream_fnClone, + IAVIEditStream_fnSetInfo +}; + static HRESULT WINAPI IEditAVIStream_fnQueryInterface(IAVIStream*iface, REFIID refiid,LPVOID*obj) { @@ -1063,3 +988,37 @@ static HRESULT WINAPI IEditAVIStream_fnSetInfo(IAVIStream*iface, return IAVIEditStream_SetInfo(&This->IAVIEditStream_iface,info,len); } + +static const struct IAVIStreamVtbl ieditstast = { + IEditAVIStream_fnQueryInterface, + IEditAVIStream_fnAddRef, + IEditAVIStream_fnRelease, + IEditAVIStream_fnCreate, + IEditAVIStream_fnInfo, + IEditAVIStream_fnFindSample, + IEditAVIStream_fnReadFormat, + IEditAVIStream_fnSetFormat, + IEditAVIStream_fnRead, + IEditAVIStream_fnWrite, + IEditAVIStream_fnDelete, + IEditAVIStream_fnReadData, + IEditAVIStream_fnWriteData, + IEditAVIStream_fnSetInfo +}; + +PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream) +{ + IAVIEditStreamImpl *pedit = NULL; + + pedit = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIEditStreamImpl)); + if (pedit == NULL) + return NULL; + + pedit->IAVIEditStream_iface.lpVtbl = &ieditstream; + pedit->IAVIStream_iface.lpVtbl = &ieditstast; + pedit->ref = 1; + + IAVIStream_Create(&pedit->IAVIStream_iface, (LPARAM)pstream, 0); + + return (PAVIEDITSTREAM)pedit; +}
1
0
0
0
Michael Stefaniuc : avifil32: Use ifaces instead of vtbl pointers in IAVIEditStreamImpl.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 2a14c4e84602ee87490d9c3ced996143bd082a50 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2a14c4e84602ee87490d9c3ce…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Jan 24 00:04:36 2011 +0100 avifil32: Use ifaces instead of vtbl pointers in IAVIEditStreamImpl. --- dlls/avifil32/editstream.c | 66 +++++++++++++++++++++---------------------- 1 files changed, 32 insertions(+), 34 deletions(-) diff --git a/dlls/avifil32/editstream.c b/dlls/avifil32/editstream.c index a175b38..edabb09 100644 --- a/dlls/avifil32/editstream.c +++ b/dlls/avifil32/editstream.c @@ -122,11 +122,10 @@ static const struct IAVIStreamVtbl ieditstast = { typedef struct _IAVIEditStreamImpl IAVIEditStreamImpl; struct _IAVIEditStreamImpl { - /* IUnknown stuff */ - const IAVIEditStreamVtbl *lpVtbl; - const IAVIStreamVtbl *lpVtblAVIStream; + IAVIEditStream IAVIEditStream_iface; + IAVIStream IAVIStream_iface; - LONG ref; + LONG ref; AVISTREAMINFOW sInfo; @@ -140,14 +139,14 @@ struct _IAVIEditStreamImpl { LPBITMAPINFOHEADER lpFrame; /* frame of pCurStream */ }; -static inline IAVIEditStreamImpl *impl_from_IAVIStream( IAVIStream *iface ) +static inline IAVIEditStreamImpl *impl_from_IAVIEditStream(IAVIEditStream *iface) { - return (IAVIEditStreamImpl *)((char*)iface - FIELD_OFFSET(IAVIEditStreamImpl, lpVtblAVIStream)); + return CONTAINING_RECORD(iface, IAVIEditStreamImpl, IAVIEditStream_iface); } -static inline IAVIStream *IAVIStream_from_impl( IAVIEditStreamImpl *impl ) +static inline IAVIEditStreamImpl *impl_from_IAVIStream(IAVIStream *iface) { - return (IAVIStream *)&impl->lpVtblAVIStream; + return CONTAINING_RECORD(iface, IAVIEditStreamImpl, IAVIStream_iface); } /***********************************************************************/ @@ -160,11 +159,11 @@ PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream) if (pedit == NULL) return NULL; - pedit->lpVtbl = &ieditstream; - pedit->lpVtblAVIStream = &ieditstast; + pedit->IAVIEditStream_iface.lpVtbl = &ieditstream; + pedit->IAVIStream_iface.lpVtbl = &ieditstast; pedit->ref = 1; - IAVIStream_Create( IAVIStream_from_impl( pedit ),(LPARAM)pstream,0); + IAVIStream_Create(&pedit->IAVIStream_iface, (LPARAM)pstream, 0); return (PAVIEDITSTREAM)pedit; } @@ -316,7 +315,7 @@ static BOOL AVIFILE_FormatsEqual(PAVISTREAM avi1, PAVISTREAM avi2) static HRESULT WINAPI IAVIEditStream_fnQueryInterface(IAVIEditStream*iface,REFIID refiid,LPVOID *obj) { - IAVIEditStreamImpl *This = (IAVIEditStreamImpl *)iface; + IAVIEditStreamImpl *This = impl_from_IAVIEditStream(iface); TRACE("(%p,%s,%p)\n", This, debugstr_guid(refiid), obj); @@ -328,7 +327,7 @@ static HRESULT WINAPI IAVIEditStream_fnQueryInterface(IAVIEditStream*iface,REFII return S_OK; } else if (IsEqualGUID(&IID_IAVIStream, refiid)) { - *obj = IAVIStream_from_impl( This ); + *obj = &This->IAVIStream_iface; IAVIEditStream_AddRef(iface); return S_OK; @@ -339,7 +338,7 @@ static HRESULT WINAPI IAVIEditStream_fnQueryInterface(IAVIEditStream*iface,REFII static ULONG WINAPI IAVIEditStream_fnAddRef(IAVIEditStream*iface) { - IAVIEditStreamImpl *This = (IAVIEditStreamImpl *)iface; + IAVIEditStreamImpl *This = impl_from_IAVIEditStream(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) -> %d\n", iface, ref); @@ -349,7 +348,7 @@ static ULONG WINAPI IAVIEditStream_fnAddRef(IAVIEditStream*iface) static ULONG WINAPI IAVIEditStream_fnRelease(IAVIEditStream*iface) { - IAVIEditStreamImpl *This = (IAVIEditStreamImpl *)iface; + IAVIEditStreamImpl *This = impl_from_IAVIEditStream(iface); DWORD i; ULONG ref = InterlockedDecrement(&This->ref); @@ -376,7 +375,7 @@ static ULONG WINAPI IAVIEditStream_fnRelease(IAVIEditStream*iface) static HRESULT WINAPI IAVIEditStream_fnCut(IAVIEditStream*iface,LONG*plStart, LONG*plLength,PAVISTREAM*ppResult) { - IAVIEditStreamImpl *This = (IAVIEditStreamImpl *)iface; + IAVIEditStreamImpl *This = impl_from_IAVIEditStream(iface); PAVISTREAM stream; DWORD start, len, streamPos, streamNr; HRESULT hr; @@ -460,7 +459,7 @@ static HRESULT WINAPI IAVIEditStream_fnCut(IAVIEditStream*iface,LONG*plStart, static HRESULT WINAPI IAVIEditStream_fnCopy(IAVIEditStream*iface,LONG*plStart, LONG*plLength,PAVISTREAM*ppResult) { - IAVIEditStreamImpl *This = (IAVIEditStreamImpl *)iface; + IAVIEditStreamImpl *This = impl_from_IAVIEditStream(iface); IAVIEditStreamImpl* pEdit; HRESULT hr; LONG start = 0; @@ -490,14 +489,13 @@ static HRESULT WINAPI IAVIEditStream_fnCopy(IAVIEditStream*iface,LONG*plStart, if (pEdit == NULL) return AVIERR_MEMORY; - hr = IAVIEditStream_Paste((PAVIEDITSTREAM)pEdit,&start,plLength, - IAVIStream_from_impl( This ),*plStart, - *plStart + *plLength); + hr = IAVIEditStream_Paste((PAVIEDITSTREAM)pEdit, &start, plLength, &This->IAVIStream_iface, + *plStart, *plStart + *plLength); *plStart = start; if (FAILED(hr)) IAVIEditStream_Release((PAVIEDITSTREAM)pEdit); else - *ppResult = IAVIStream_from_impl( This ); + *ppResult = &This->IAVIStream_iface; return hr; } @@ -506,7 +504,7 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart, LONG*plLength,PAVISTREAM pSource, LONG lStart,LONG lLength) { - IAVIEditStreamImpl *This = (IAVIEditStreamImpl *)iface; + IAVIEditStreamImpl *This = impl_from_IAVIEditStream(iface); AVISTREAMINFOW srcInfo; IAVIEditStreamImpl *pEdit = NULL; PAVISTREAM pStream; @@ -552,7 +550,7 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart, if (size != This->sInfo.rcFrame.bottom - This->sInfo.rcFrame.top) return AVIERR_UNSUPPORTED; /* FIXME: Can't GetFrame convert it? */ } else if (srcInfo.fccType == streamtypeAUDIO) { - if (! AVIFILE_FormatsEqual(IAVIStream_from_impl( This ), pSource)) + if (!AVIFILE_FormatsEqual(&This->IAVIStream_iface, pSource)) return AVIERR_UNSUPPORTED; } else { /* FIXME: streamtypeMIDI and streamtypeTEXT */ @@ -561,7 +559,7 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart, /* try to get an IEditStreamInternal interface */ if (SUCCEEDED(IAVIStream_QueryInterface(pSource, &IID_IEditStreamInternal, (LPVOID*)&pEdit))) - IAVIEditStream_Release( (IAVIEditStream *)pEdit ); /* pSource holds a reference */ + IAVIEditStream_Release(&pEdit->IAVIEditStream_iface); /* pSource holds a reference */ /* for video must check for change of format */ if (This->sInfo.fccType == streamtypeVIDEO) { @@ -574,8 +572,8 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart, */ if ((pEdit != NULL && pEdit->bDecompress) || AVIStreamNearestKeyFrame(pSource, lStart) != lStart || - AVIStreamNearestKeyFrame(IAVIStream_from_impl( This ), *plStart) != *plStart || - (This->nStreams > 0 && !AVIFILE_FormatsEqual(IAVIStream_from_impl( This ), pSource))) { + AVIStreamNearestKeyFrame(&This->IAVIStream_iface, *plStart) != *plStart || + (This->nStreams > 0 && !AVIFILE_FormatsEqual(&This->IAVIStream_iface, pSource))) { /* Use first stream part to get format to convert everything to */ AVIFILE_ReadFrame(This, This->pStreams[0].pStream, This->pStreams[0].dwStart); @@ -693,7 +691,7 @@ static HRESULT WINAPI IAVIEditStream_fnPaste(IAVIEditStream*iface,LONG*plStart, static HRESULT WINAPI IAVIEditStream_fnClone(IAVIEditStream*iface, PAVISTREAM*ppResult) { - IAVIEditStreamImpl *This = (IAVIEditStreamImpl *)iface; + IAVIEditStreamImpl *This = impl_from_IAVIEditStream(iface); IAVIEditStreamImpl* pEdit; DWORD i; @@ -722,7 +720,7 @@ static HRESULT WINAPI IAVIEditStream_fnClone(IAVIEditStream*iface, IAVIStream_AddRef(pEdit->pStreams[i].pStream); } - *ppResult = IAVIStream_from_impl( This ); + *ppResult = &This->IAVIStream_iface; return AVIERR_OK; } @@ -730,7 +728,7 @@ static HRESULT WINAPI IAVIEditStream_fnClone(IAVIEditStream*iface, static HRESULT WINAPI IAVIEditStream_fnSetInfo(IAVIEditStream*iface, LPAVISTREAMINFOW asi,LONG size) { - IAVIEditStreamImpl *This = (IAVIEditStreamImpl *)iface; + IAVIEditStreamImpl *This = impl_from_IAVIEditStream(iface); TRACE("(%p,%p,%d)\n",iface,asi,size); @@ -755,19 +753,19 @@ static HRESULT WINAPI IEditAVIStream_fnQueryInterface(IAVIStream*iface, REFIID refiid,LPVOID*obj) { IAVIEditStreamImpl *This = impl_from_IAVIStream( iface ); - return IAVIEditStream_QueryInterface((IAVIEditStream *)This,refiid,obj); + return IAVIEditStream_QueryInterface(&This->IAVIEditStream_iface,refiid,obj); } static ULONG WINAPI IEditAVIStream_fnAddRef(IAVIStream*iface) { IAVIEditStreamImpl *This = impl_from_IAVIStream( iface ); - return IAVIEditStream_AddRef((IAVIEditStream*)This); + return IAVIEditStream_AddRef(&This->IAVIEditStream_iface); } static ULONG WINAPI IEditAVIStream_fnRelease(IAVIStream*iface) { IAVIEditStreamImpl *This = impl_from_IAVIStream( iface ); - return IAVIEditStream_Release((IAVIEditStream*)This); + return IAVIEditStream_Release(&This->IAVIEditStream_iface); } static HRESULT WINAPI IEditAVIStream_fnCreate(IAVIStream*iface, @@ -1021,7 +1019,7 @@ static HRESULT WINAPI IEditAVIStream_fnDelete(IAVIStream*iface,LONG start, TRACE("(%p,%d,%d)\n",iface,start,samples); - return IAVIEditStream_Cut((IAVIEditStream*)This,&start,&samples,NULL); + return IAVIEditStream_Cut(&This->IAVIEditStream_iface,&start,&samples,NULL); } static HRESULT WINAPI IEditAVIStream_fnReadData(IAVIStream*iface,DWORD fcc, @@ -1063,5 +1061,5 @@ static HRESULT WINAPI IEditAVIStream_fnSetInfo(IAVIStream*iface, TRACE("(%p,%p,%d)\n",iface,info,len); - return IAVIEditStream_SetInfo((IAVIEditStream*)This,info,len); + return IAVIEditStream_SetInfo(&This->IAVIEditStream_iface,info,len); }
1
0
0
0
Michael Stefaniuc : d3d8: COM cleanup for the IDirect3D8 iface.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 6ad10335a00bbf2b7518ebc2101085f91a318bd9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ad10335a00bbf2b7518ebc21…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Jan 23 21:49:42 2011 +0100 d3d8: COM cleanup for the IDirect3D8 iface. --- dlls/d3d8/d3d8_main.c | 6 +- dlls/d3d8/d3d8_private.h | 7 +-- dlls/d3d8/directx.c | 100 +++++++++++++++++++++++++++------------------ 3 files changed, 66 insertions(+), 47 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6ad10335a00bbf2b7518e…
1
0
0
0
Michael Stefaniuc : ddrawex: COM cleanup for the IDirectDraw4 iface.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 3a95fe8476fc7e00de36aeef4cbcb09a1e104cf3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a95fe8476fc7e00de36aeef4…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Jan 23 21:48:10 2011 +0100 ddrawex: COM cleanup for the IDirectDraw4 iface. --- dlls/ddrawex/ddraw.c | 139 +++++++++++++++++++++------------------- dlls/ddrawex/ddrawex_private.h | 2 +- 2 files changed, 73 insertions(+), 68 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3a95fe8476fc7e00de36a…
1
0
0
0
Michael Stefaniuc : ddrawex: Rename impl_from_dd4() to impl_from_IDirectDraw4().
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: eb850bf5227e59c344e4dac2016c5e8a160d1297 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eb850bf5227e59c344e4dac20…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Jan 23 21:44:35 2011 +0100 ddrawex: Rename impl_from_dd4() to impl_from_IDirectDraw4(). --- dlls/ddrawex/ddraw.c | 210 ++++++++++++++++++-------------------------------- 1 files changed, 75 insertions(+), 135 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=eb850bf5227e59c344e4d…
1
0
0
0
Michael Stefaniuc : ddrawex: COM cleanup for the IDirectDraw3 iface.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 3f7a060c376057667f8f7c466cca68cc00f6f73b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f7a060c376057667f8f7c466…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Jan 23 21:13:49 2011 +0100 ddrawex: COM cleanup for the IDirectDraw3 iface. --- dlls/ddrawex/ddraw.c | 224 +++++++++++++++------------------------- dlls/ddrawex/ddrawex_private.h | 2 +- 2 files changed, 83 insertions(+), 143 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3f7a060c376057667f8f7…
1
0
0
0
Michael Stefaniuc : ddrawex: COM cleanup for the IDirectDraw2 iface.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 9b77bdff545ab82cf8122eedf7ae98ff7dc38792 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9b77bdff545ab82cf8122eedf…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Jan 23 21:05:51 2011 +0100 ddrawex: COM cleanup for the IDirectDraw2 iface. --- dlls/ddrawex/ddraw.c | 192 ++++++++++++++-------------------------- dlls/ddrawex/ddrawex_private.h | 2 +- 2 files changed, 68 insertions(+), 126 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9b77bdff545ab82cf8122…
1
0
0
0
Michael Stefaniuc : ddrawex: COM cleanup for the IDirectDraw iface.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 8003b4842143673266ffda18add64f40edb1a823 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8003b4842143673266ffda18a…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Jan 23 21:04:56 2011 +0100 ddrawex: COM cleanup for the IDirectDraw iface. --- dlls/ddrawex/ddraw.c | 184 ++++++++++++++-------------------------- dlls/ddrawex/ddrawex_private.h | 2 +- 2 files changed, 66 insertions(+), 120 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=8003b4842143673266ffd…
1
0
0
0
Michael Stefaniuc : ddrawex: COM cleanup for the IDirectDrawFactory iface.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 0b9cfcfcc956d21320889ac0369498c22c09c7db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0b9cfcfcc956d21320889ac03…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Jan 23 21:02:50 2011 +0100 ddrawex: COM cleanup for the IDirectDrawFactory iface. --- dlls/ddrawex/ddrawex_private.h | 9 --------- dlls/ddrawex/main.c | 37 ++++++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/dlls/ddrawex/ddrawex_private.h b/dlls/ddrawex/ddrawex_private.h index 079b26c..34608c6 100644 --- a/dlls/ddrawex/ddrawex_private.h +++ b/dlls/ddrawex/ddrawex_private.h @@ -44,15 +44,6 @@ DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown) #endif -/****************************************************************************** - * DirectDrawFactory implementation - ******************************************************************************/ -typedef struct -{ - const IDirectDrawFactoryVtbl *lpVtbl; - LONG ref; -} IDirectDrawFactoryImpl; - HRESULT WINAPI IDirectDrawFactoryImpl_CreateDirectDraw(IDirectDrawFactory* iface, GUID * pGUID, HWND hWnd, DWORD dwCoopLevelFlags, DWORD dwReserved, IUnknown *pUnkOuter, IDirectDraw **ppDirectDraw); diff --git a/dlls/ddrawex/main.c b/dlls/ddrawex/main.c index b5923e2..7b32323 100644 --- a/dlls/ddrawex/main.c +++ b/dlls/ddrawex/main.c @@ -150,16 +150,28 @@ static const IClassFactoryVtbl IClassFactory_Vtbl = }; +/****************************************************************************** + * DirectDrawFactory implementation + ******************************************************************************/ +typedef struct +{ + IDirectDrawFactory IDirectDrawFactory_iface; + LONG ref; +} IDirectDrawFactoryImpl; + +static inline IDirectDrawFactoryImpl *impl_from_IDirectDrawFactory(IDirectDrawFactory *iface) +{ + return CONTAINING_RECORD(iface, IDirectDrawFactoryImpl, IDirectDrawFactory_iface); +} + /******************************************************************************* * IDirectDrawFactory::QueryInterface * *******************************************************************************/ -static HRESULT WINAPI -IDirectDrawFactoryImpl_QueryInterface(IDirectDrawFactory *iface, - REFIID riid, - void **obj) +static HRESULT WINAPI IDirectDrawFactoryImpl_QueryInterface(IDirectDrawFactory *iface, REFIID riid, + void **obj) { - IDirectDrawFactoryImpl *This = (IDirectDrawFactoryImpl*) iface; + IDirectDrawFactoryImpl *This = impl_from_IDirectDrawFactory(iface); TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), obj); @@ -179,10 +191,9 @@ IDirectDrawFactoryImpl_QueryInterface(IDirectDrawFactory *iface, * IDirectDrawFactory::AddRef * *******************************************************************************/ -static ULONG WINAPI -IDirectDrawFactoryImpl_AddRef(IDirectDrawFactory *iface) +static ULONG WINAPI IDirectDrawFactoryImpl_AddRef(IDirectDrawFactory *iface) { - IDirectDrawFactoryImpl *This = (IDirectDrawFactoryImpl*) iface; + IDirectDrawFactoryImpl *This = impl_from_IDirectDrawFactory(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p)->() incrementing from %d.\n", This, ref - 1); @@ -194,11 +205,11 @@ IDirectDrawFactoryImpl_AddRef(IDirectDrawFactory *iface) * IDirectDrawFactory::Release * *******************************************************************************/ -static ULONG WINAPI -IDirectDrawFactoryImpl_Release(IDirectDrawFactory *iface) +static ULONG WINAPI IDirectDrawFactoryImpl_Release(IDirectDrawFactory *iface) { - IDirectDrawFactoryImpl *This = (IDirectDrawFactoryImpl*) iface; + IDirectDrawFactoryImpl *This = impl_from_IDirectDrawFactory(iface); ULONG ref = InterlockedDecrement(&This->ref); + TRACE("(%p)->() decrementing from %d.\n", This, ref+1); if (ref == 0) @@ -255,9 +266,9 @@ CreateDirectDrawFactory(IUnknown* UnkOuter, REFIID iid, void **obj) return E_OUTOFMEMORY; } - This->lpVtbl = &IDirectDrawFactory_Vtbl; + This->IDirectDrawFactory_iface.lpVtbl = &IDirectDrawFactory_Vtbl; - hr = IDirectDrawFactory_QueryInterface((IDirectDrawFactory *)This, iid, obj); + hr = IDirectDrawFactory_QueryInterface(&This->IDirectDrawFactory_iface, iid, obj); if (FAILED(hr)) HeapFree(GetProcessHeap(), 0, This);
1
0
0
0
Michael Stefaniuc : ddrawex: COM cleanup for the IClassFactory iface.
by Alexandre Julliard
24 Jan '11
24 Jan '11
Module: wine Branch: master Commit: 3799ad3482754e56b625dcc923de4a94e54ab859 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3799ad3482754e56b625dcc92…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Sun Jan 23 21:01:44 2011 +0100 ddrawex: COM cleanup for the IClassFactory iface. --- dlls/ddrawex/ddrawex_private.h | 10 ------- dlls/ddrawex/main.c | 52 +++++++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/dlls/ddrawex/ddrawex_private.h b/dlls/ddrawex/ddrawex_private.h index 3e7a0e2..079b26c 100644 --- a/dlls/ddrawex/ddrawex_private.h +++ b/dlls/ddrawex/ddrawex_private.h @@ -43,16 +43,6 @@ DECLARE_INTERFACE_(IDirectDrawFactory, IUnknown) #define IDirectDrawFactory_DirectDrawEnumerate(p,a,b) (p)->lpVtbl->_DirectDrawEnumerate(p,a,b) #endif -/****************************************************************************** - * DirectDraw ClassFactory implementation - incomplete - ******************************************************************************/ -typedef struct -{ - const IClassFactoryVtbl *lpVtbl; - LONG ref; - HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, REFIID iid, LPVOID *ppObj); -} IClassFactoryImpl; - /****************************************************************************** * DirectDrawFactory implementation diff --git a/dlls/ddrawex/main.c b/dlls/ddrawex/main.c index c93d8eb..b5923e2 100644 --- a/dlls/ddrawex/main.c +++ b/dlls/ddrawex/main.c @@ -39,16 +39,29 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddrawex); static HINSTANCE instance; +/****************************************************************************** + * DirectDraw ClassFactory implementation + ******************************************************************************/ +typedef struct +{ + IClassFactory IClassFactory_iface; + LONG ref; + HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, REFIID iid, LPVOID *ppObj); +} IClassFactoryImpl; + +static inline IClassFactoryImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); +} + /******************************************************************************* * IDirectDrawClassFactory::QueryInterface * *******************************************************************************/ -static HRESULT WINAPI -IDirectDrawClassFactoryImpl_QueryInterface(IClassFactory *iface, - REFIID riid, - void **obj) +static HRESULT WINAPI IDirectDrawClassFactoryImpl_QueryInterface(IClassFactory *iface, REFIID riid, + void **obj) { - IClassFactoryImpl *This = (IClassFactoryImpl*) iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), obj); @@ -68,10 +81,9 @@ IDirectDrawClassFactoryImpl_QueryInterface(IClassFactory *iface, * IDirectDrawClassFactory::AddRef * *******************************************************************************/ -static ULONG WINAPI -IDirectDrawClassFactoryImpl_AddRef(IClassFactory *iface) +static ULONG WINAPI IDirectDrawClassFactoryImpl_AddRef(IClassFactory *iface) { - IClassFactoryImpl *This = (IClassFactoryImpl*) iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p)->() incrementing from %d.\n", This, ref - 1); @@ -83,11 +95,11 @@ IDirectDrawClassFactoryImpl_AddRef(IClassFactory *iface) * IDirectDrawClassFactory::Release * *******************************************************************************/ -static ULONG WINAPI -IDirectDrawClassFactoryImpl_Release(IClassFactory *iface) +static ULONG WINAPI IDirectDrawClassFactoryImpl_Release(IClassFactory *iface) { - IClassFactoryImpl *This = (IClassFactoryImpl*) iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); ULONG ref = InterlockedDecrement(&This->ref); + TRACE("(%p)->() decrementing from %d.\n", This, ref+1); if (ref == 0) @@ -101,13 +113,10 @@ IDirectDrawClassFactoryImpl_Release(IClassFactory *iface) * IDirectDrawClassFactory::CreateInstance * *******************************************************************************/ -static HRESULT WINAPI -IDirectDrawClassFactoryImpl_CreateInstance(IClassFactory *iface, - IUnknown *UnkOuter, - REFIID riid, - void **obj) +static HRESULT WINAPI IDirectDrawClassFactoryImpl_CreateInstance(IClassFactory *iface, + IUnknown *UnkOuter, REFIID riid, void **obj) { - IClassFactoryImpl *This = (IClassFactoryImpl*) iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); TRACE("(%p)->(%p,%s,%p)\n",This,UnkOuter,debugstr_guid(riid),obj); @@ -118,11 +127,12 @@ IDirectDrawClassFactoryImpl_CreateInstance(IClassFactory *iface, * IDirectDrawClassFactory::LockServer * *******************************************************************************/ -static HRESULT WINAPI -IDirectDrawClassFactoryImpl_LockServer(IClassFactory *iface,BOOL dolock) +static HRESULT WINAPI IDirectDrawClassFactoryImpl_LockServer(IClassFactory *iface,BOOL dolock) { - IClassFactoryImpl *This = (IClassFactoryImpl*) iface; + IClassFactoryImpl *This = impl_from_IClassFactory(iface); + FIXME("(%p)->(%d),stub!\n",This,dolock); + return S_OK; } @@ -287,7 +297,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) factory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*factory)); if (factory == NULL) return E_OUTOFMEMORY; - factory->lpVtbl = &IClassFactory_Vtbl; + factory->IClassFactory_iface.lpVtbl = &IClassFactory_Vtbl; factory->ref = 1; factory->pfnCreateInstance = CreateDirectDrawFactory;
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
88
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
Results per page:
10
25
50
100
200