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
December 2010
----- 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
1099 discussions
Start a n
N
ew thread
Michael Stefaniuc : infosoft: Use an iface instead of a vtbl pointer in wordbreaker_impl.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 38b4a4d7d7843c23a134aa086ea996d34a1df87d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=38b4a4d7d7843c23a134aa086…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:32 2010 +0100 infosoft: Use an iface instead of a vtbl pointer in wordbreaker_impl. --- dlls/infosoft/wordbreaker.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/infosoft/wordbreaker.c b/dlls/infosoft/wordbreaker.c index 514f868..69e2eb8 100644 --- a/dlls/infosoft/wordbreaker.c +++ b/dlls/infosoft/wordbreaker.c @@ -36,14 +36,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(infosoft); typedef struct tag_wordbreaker_impl { - const IWordBreakerVtbl *lpVtbl; + IWordBreaker IWordBreaker_iface; LONG ref; } wordbreaker_impl; +static inline wordbreaker_impl *impl_from_IWordBreaker(IWordBreaker *iface) +{ + return CONTAINING_RECORD(iface, wordbreaker_impl, IWordBreaker_iface); +} + static HRESULT WINAPI wb_QueryInterface( IWordBreaker *iface, REFIID riid, LPVOID *ppvObj) { - wordbreaker_impl *This = (wordbreaker_impl *)iface; + wordbreaker_impl *This = impl_from_IWordBreaker(iface); TRACE("(%p)->(%s)\n",This,debugstr_guid(riid)); @@ -62,13 +67,13 @@ static HRESULT WINAPI wb_QueryInterface( IWordBreaker *iface, static ULONG WINAPI wb_AddRef( IWordBreaker *iface ) { - wordbreaker_impl *This = (wordbreaker_impl *)iface; + wordbreaker_impl *This = impl_from_IWordBreaker(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI wb_Release(IWordBreaker *iface) { - wordbreaker_impl *This = (wordbreaker_impl *)iface; + wordbreaker_impl *This = impl_from_IWordBreaker(iface); LONG refcount; refcount = InterlockedDecrement(&This->ref); @@ -190,9 +195,9 @@ HRESULT WINAPI wb_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOID *ppvObjec return E_OUTOFMEMORY; This->ref = 1; - This->lpVtbl = &wordbreaker_vtbl; + This->IWordBreaker_iface.lpVtbl = &wordbreaker_vtbl; - wb = (IWordBreaker*) This; + wb = &This->IWordBreaker_iface; return IWordBreaker_QueryInterface(wb, riid, ppvObject); }
1
0
0
0
Michael Stefaniuc : itss: Standardize the COM usage in storage.c.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 965aea8d8ea768db1a5268e39af7bec54a6ba1a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=965aea8d8ea768db1a5268e39…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:31 2010 +0100 itss: Standardize the COM usage in storage.c. --- dlls/itss/storage.c | 73 ++++++++++++++++++++++++++++++-------------------- 1 files changed, 44 insertions(+), 29 deletions(-) diff --git a/dlls/itss/storage.c b/dlls/itss/storage.c index 79c863a..4f687c6 100644 --- a/dlls/itss/storage.c +++ b/dlls/itss/storage.c @@ -45,7 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(itss); typedef struct _ITSS_IStorageImpl { - const IStorageVtbl *vtbl_IStorage; + IStorage IStorage_iface; LONG ref; struct chmFile *chmfile; WCHAR dir[1]; @@ -59,20 +59,35 @@ struct enum_info typedef struct _IEnumSTATSTG_Impl { - const IEnumSTATSTGVtbl *vtbl_IEnumSTATSTG; + IEnumSTATSTG IEnumSTATSTG_iface; LONG ref; struct enum_info *first, *last, *current; } IEnumSTATSTG_Impl; typedef struct _IStream_Impl { - const IStreamVtbl *vtbl_IStream; + IStream IStream_iface; LONG ref; ITSS_IStorageImpl *stg; ULONGLONG addr; struct chmUnitInfo ui; } IStream_Impl; +static inline ITSS_IStorageImpl *impl_from_IStorage(IStorage *iface) +{ + return CONTAINING_RECORD(iface, ITSS_IStorageImpl, IStorage_iface); +} + +static inline IEnumSTATSTG_Impl *impl_from_IEnumSTATSTG(IEnumSTATSTG *iface) +{ + return CONTAINING_RECORD(iface, IEnumSTATSTG_Impl, IEnumSTATSTG_iface); +} + +static inline IStream_Impl *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, IStream_Impl, IStream_iface); +} + static HRESULT ITSS_create_chm_storage( struct chmFile *chmfile, const WCHAR *dir, IStorage** ppstgOpen ); static IStream_Impl* ITSS_create_stream( @@ -85,7 +100,7 @@ static HRESULT WINAPI ITSS_IEnumSTATSTG_QueryInterface( REFIID riid, void** ppvObject) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumSTATSTG)) @@ -102,14 +117,14 @@ static HRESULT WINAPI ITSS_IEnumSTATSTG_QueryInterface( static ULONG WINAPI ITSS_IEnumSTATSTG_AddRef( IEnumSTATSTG* iface) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ITSS_IEnumSTATSTG_Release( IEnumSTATSTG* iface) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); ULONG ref = InterlockedDecrement(&This->ref); @@ -134,7 +149,7 @@ static HRESULT WINAPI ITSS_IEnumSTATSTG_Next( STATSTG* rgelt, ULONG* pceltFetched) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); DWORD len, n; struct enum_info *cur; @@ -186,7 +201,7 @@ static HRESULT WINAPI ITSS_IEnumSTATSTG_Skip( IEnumSTATSTG* iface, ULONG celt) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); DWORD n; struct enum_info *cur; @@ -210,7 +225,7 @@ static HRESULT WINAPI ITSS_IEnumSTATSTG_Skip( static HRESULT WINAPI ITSS_IEnumSTATSTG_Reset( IEnumSTATSTG* iface) { - IEnumSTATSTG_Impl *This = (IEnumSTATSTG_Impl *)iface; + IEnumSTATSTG_Impl *This = impl_from_IEnumSTATSTG(iface); TRACE("%p\n", This ); @@ -243,7 +258,7 @@ static IEnumSTATSTG_Impl *ITSS_create_enum( void ) IEnumSTATSTG_Impl *stgenum; stgenum = HeapAlloc( GetProcessHeap(), 0, sizeof (IEnumSTATSTG_Impl) ); - stgenum->vtbl_IEnumSTATSTG = &IEnumSTATSTG_vtbl; + stgenum->IEnumSTATSTG_iface.lpVtbl = &IEnumSTATSTG_vtbl; stgenum->ref = 1; stgenum->first = NULL; stgenum->last = NULL; @@ -262,7 +277,7 @@ static HRESULT WINAPI ITSS_IStorageImpl_QueryInterface( REFIID riid, void** ppvObject) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IStorage)) @@ -279,14 +294,14 @@ static HRESULT WINAPI ITSS_IStorageImpl_QueryInterface( static ULONG WINAPI ITSS_IStorageImpl_AddRef( IStorage* iface) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ITSS_IStorageImpl_Release( IStorage* iface) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); ULONG ref = InterlockedDecrement(&This->ref); @@ -320,7 +335,7 @@ static HRESULT WINAPI ITSS_IStorageImpl_OpenStream( DWORD reserved2, IStream** ppstm) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); IStream_Impl *stm; DWORD len; struct chmUnitInfo ui; @@ -364,7 +379,7 @@ static HRESULT WINAPI ITSS_IStorageImpl_OpenStream( if( !stm ) return E_FAIL; - *ppstm = (IStream*) stm; + *ppstm = &stm->IStream_iface; return S_OK; } @@ -390,7 +405,7 @@ static HRESULT WINAPI ITSS_IStorageImpl_OpenStorage( DWORD reserved, IStorage** ppstg) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); static const WCHAR szRoot[] = { '/', 0 }; struct chmFile *chmfile; WCHAR *path, *p; @@ -498,7 +513,7 @@ static HRESULT WINAPI ITSS_IStorageImpl_EnumElements( DWORD reserved3, IEnumSTATSTG** ppenum) { - ITSS_IStorageImpl *This = (ITSS_IStorageImpl *)iface; + ITSS_IStorageImpl *This = impl_from_IStorage(iface); IEnumSTATSTG_Impl* stgenum; TRACE("%p %d %p %d %p\n", This, reserved1, reserved2, reserved3, ppenum ); @@ -515,7 +530,7 @@ static HRESULT WINAPI ITSS_IStorageImpl_EnumElements( stgenum->current = stgenum->first; - *ppenum = (IEnumSTATSTG*) stgenum; + *ppenum = &stgenum->IEnumSTATSTG_iface; return S_OK; } @@ -607,12 +622,12 @@ static HRESULT ITSS_create_chm_storage( len = strlenW( dir ) + 1; stg = HeapAlloc( GetProcessHeap(), 0, sizeof (ITSS_IStorageImpl) + len*sizeof(WCHAR) ); - stg->vtbl_IStorage = &ITSS_IStorageImpl_Vtbl; + stg->IStorage_iface.lpVtbl = &ITSS_IStorageImpl_Vtbl; stg->ref = 1; stg->chmfile = chmfile; strcpyW( stg->dir, dir ); - *ppstgOpen = (IStorage*) stg; + *ppstgOpen = &stg->IStorage_iface; ITSS_LockModule(); return S_OK; @@ -645,7 +660,7 @@ static HRESULT WINAPI ITSS_IStream_QueryInterface( REFIID riid, void** ppvObject) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ISequentialStream) @@ -663,20 +678,20 @@ static HRESULT WINAPI ITSS_IStream_QueryInterface( static ULONG WINAPI ITSS_IStream_AddRef( IStream* iface) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ITSS_IStream_Release( IStream* iface) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) { - IStorage_Release( (IStorage*) This->stg ); + IStorage_Release( &This->stg->IStorage_iface ); HeapFree(GetProcessHeap(), 0, This); ITSS_UnlockModule(); } @@ -690,7 +705,7 @@ static HRESULT WINAPI ITSS_IStream_Read( ULONG cb, ULONG* pcbRead) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); ULONG count; TRACE("%p %p %u %p\n", This, pv, cb, pcbRead); @@ -720,7 +735,7 @@ static HRESULT WINAPI ITSS_IStream_Seek( DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); LONGLONG newpos; TRACE("%p %s %u %p\n", This, @@ -809,7 +824,7 @@ static HRESULT WINAPI ITSS_IStream_Stat( STATSTG* pstatstg, DWORD grfStatFlag) { - IStream_Impl *This = (IStream_Impl *)iface; + IStream_Impl *This = impl_from_IStream(iface); TRACE("%p %p %d\n", This, pstatstg, grfStatFlag); @@ -858,12 +873,12 @@ static IStream_Impl *ITSS_create_stream( IStream_Impl *stm; stm = HeapAlloc( GetProcessHeap(), 0, sizeof (IStream_Impl) ); - stm->vtbl_IStream = &ITSS_IStream_vtbl; + stm->IStream_iface.lpVtbl = &ITSS_IStream_vtbl; stm->ref = 1; stm->addr = 0; stm->ui = *ui; stm->stg = stg; - IStorage_AddRef( (IStorage*) stg ); + IStorage_AddRef( &stg->IStorage_iface ); ITSS_LockModule();
1
0
0
0
Michael Stefaniuc : msctf: Use an iface instead of a vtbl pointer in Range.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 5e5e69f0fc603ce38c5e31f3833eb7072ecf6a92 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e5e69f0fc603ce38c5e31f38…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:40 2010 +0100 msctf: Use an iface instead of a vtbl pointer in Range. --- dlls/msctf/range.c | 61 ++++++++++++++++++++++++++++----------------------- 1 files changed, 33 insertions(+), 28 deletions(-) diff --git a/dlls/msctf/range.c b/dlls/msctf/range.c index dc9eae1..3412954 100644 --- a/dlls/msctf/range.c +++ b/dlls/msctf/range.c @@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagRange { - const ITfRangeVtbl *RangeVtbl; + ITfRange ITfRange_iface; /* const ITfRangeACPVtb *RangeACPVtbl; */ LONG refCount; @@ -54,6 +54,11 @@ typedef struct tagRange { } Range; +static inline Range *impl_from_ITfRange(ITfRange *iface) +{ + return CONTAINING_RECORD(iface, Range, ITfRange_iface); +} + static void Range_Destructor(Range *This) { TRACE("destroying %p\n", This); @@ -62,7 +67,7 @@ static void Range_Destructor(Range *This) static HRESULT WINAPI Range_QueryInterface(ITfRange *iface, REFIID iid, LPVOID *ppvOut) { - Range *This = (Range*)iface; + Range *This = impl_from_ITfRange(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfRange)) @@ -82,13 +87,13 @@ static HRESULT WINAPI Range_QueryInterface(ITfRange *iface, REFIID iid, LPVOID * static ULONG WINAPI Range_AddRef(ITfRange *iface) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI Range_Release(ITfRange *iface) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -104,7 +109,7 @@ static ULONG WINAPI Range_Release(ITfRange *iface) static HRESULT WINAPI Range_GetText(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, WCHAR *pchText, ULONG cchMax, ULONG *pcch) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -112,7 +117,7 @@ static HRESULT WINAPI Range_GetText(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_SetText(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, const WCHAR *pchText, LONG cch) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -120,7 +125,7 @@ static HRESULT WINAPI Range_SetText(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_GetFormattedText(ITfRange *iface, TfEditCookie ec, IDataObject **ppDataObject) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -128,7 +133,7 @@ static HRESULT WINAPI Range_GetFormattedText(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_GetEmbedded(ITfRange *iface, TfEditCookie ec, REFGUID rguidService, REFIID riid, IUnknown **ppunk) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -136,7 +141,7 @@ static HRESULT WINAPI Range_GetEmbedded(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_InsertEmbedded(ITfRange *iface, TfEditCookie ec, DWORD dwFlags, IDataObject *pDataObject) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -144,7 +149,7 @@ static HRESULT WINAPI Range_InsertEmbedded(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_ShiftStart(ITfRange *iface, TfEditCookie ec, LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -152,7 +157,7 @@ static HRESULT WINAPI Range_ShiftStart(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_ShiftEnd(ITfRange *iface, TfEditCookie ec, LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -160,7 +165,7 @@ static HRESULT WINAPI Range_ShiftEnd(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_ShiftStartToRange(ITfRange *iface, TfEditCookie ec, ITfRange *pRange, TfAnchor aPos) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -168,7 +173,7 @@ static HRESULT WINAPI Range_ShiftStartToRange(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_ShiftEndToRange(ITfRange *iface, TfEditCookie ec, ITfRange *pRange, TfAnchor aPos) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -176,7 +181,7 @@ static HRESULT WINAPI Range_ShiftEndToRange(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_ShiftStartRegion(ITfRange *iface, TfEditCookie ec, TfShiftDir dir, BOOL *pfNoRegion) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -184,7 +189,7 @@ static HRESULT WINAPI Range_ShiftStartRegion(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_ShiftEndRegion(ITfRange *iface, TfEditCookie ec, TfShiftDir dir, BOOL *pfNoRegion) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -192,7 +197,7 @@ static HRESULT WINAPI Range_ShiftEndRegion(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_IsEmpty(ITfRange *iface, TfEditCookie ec, BOOL *pfEmpty) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -200,7 +205,7 @@ static HRESULT WINAPI Range_IsEmpty(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_Collapse(ITfRange *iface, TfEditCookie ec, TfAnchor aPos) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); TRACE("(%p) %i %i\n",This,ec,aPos); switch (aPos) @@ -221,7 +226,7 @@ static HRESULT WINAPI Range_Collapse(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_IsEqualStart(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -229,7 +234,7 @@ static HRESULT WINAPI Range_IsEqualStart(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_IsEqualEnd(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -237,7 +242,7 @@ static HRESULT WINAPI Range_IsEqualEnd(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_CompareStart(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, LONG *plResult) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -245,7 +250,7 @@ static HRESULT WINAPI Range_CompareStart(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_CompareEnd(ITfRange *iface, TfEditCookie ec, ITfRange *pWith, TfAnchor aPos, LONG *plResult) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -253,7 +258,7 @@ static HRESULT WINAPI Range_CompareEnd(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_AdjustForInsert(ITfRange *iface, TfEditCookie ec, ULONG cchInsert, BOOL *pfInsertOk) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -261,7 +266,7 @@ static HRESULT WINAPI Range_AdjustForInsert(ITfRange *iface, TfEditCookie ec, static HRESULT WINAPI Range_GetGravity(ITfRange *iface, TfGravity *pgStart, TfGravity *pgEnd) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -269,21 +274,21 @@ static HRESULT WINAPI Range_GetGravity(ITfRange *iface, static HRESULT WINAPI Range_SetGravity(ITfRange *iface, TfEditCookie ec, TfGravity gStart, TfGravity gEnd) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI Range_Clone(ITfRange *iface, ITfRange **ppClone) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI Range_GetContext(ITfRange *iface, ITfContext **ppContext) { - Range *This = (Range *)iface; + Range *This = impl_from_ITfRange(iface); TRACE("(%p)\n",This); if (!ppContext) return E_INVALIDARG; @@ -331,7 +336,7 @@ HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD l TRACE("(%p) %p %p\n",This, context, textstore); - This->RangeVtbl= &Range_RangeVtbl; + This->ITfRange_iface.lpVtbl = &Range_RangeVtbl; This->refCount = 1; This->pITfContext = context; This->pITextStoreACP = textstore; @@ -339,7 +344,7 @@ HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD l This->anchorStart = anchorStart; This->anchorEnd = anchorEnd; - *ppOut = (ITfRange*)This; + *ppOut = &This->ITfRange_iface; TRACE("returning %p\n", This); return S_OK;
1
0
0
0
Michael Stefaniuc : msctf: Use an iface instead of a vtbl pointer in LangBarMgr.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 3feb3e48154ca182ef7762dd99a9087b77799221 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3feb3e48154ca182ef7762dd9…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:39 2010 +0100 msctf: Use an iface instead of a vtbl pointer in LangBarMgr. --- dlls/msctf/langbarmgr.c | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/dlls/msctf/langbarmgr.c b/dlls/msctf/langbarmgr.c index 272a816..5e814a7 100644 --- a/dlls/msctf/langbarmgr.c +++ b/dlls/msctf/langbarmgr.c @@ -31,12 +31,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagLangBarMgr { - const ITfLangBarMgrVtbl *LangBarMgrVtbl; + ITfLangBarMgr ITfLangBarMgr_iface; LONG refCount; } LangBarMgr; +static inline LangBarMgr *impl_from_ITfLangBarMgr(ITfLangBarMgr *iface) +{ + return CONTAINING_RECORD(iface, LangBarMgr, ITfLangBarMgr_iface); +} + static void LangBarMgr_Destructor(LangBarMgr *This) { TRACE("destroying %p\n", This); @@ -46,7 +51,7 @@ static void LangBarMgr_Destructor(LangBarMgr *This) static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid, LPVOID *ppvOut) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfLangBarMgr)) @@ -66,13 +71,13 @@ static HRESULT WINAPI LangBarMgr_QueryInterface(ITfLangBarMgr *iface, REFIID iid static ULONG WINAPI LangBarMgr_AddRef(ITfLangBarMgr *iface) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -87,7 +92,7 @@ static ULONG WINAPI LangBarMgr_Release(ITfLangBarMgr *iface) static HRESULT WINAPI LangBarMgr_AdviseEventSink( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, HWND hwnd, DWORD dwflags, DWORD *pdwCookie) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -95,7 +100,7 @@ static HRESULT WINAPI LangBarMgr_AdviseEventSink( ITfLangBarMgr* iface, ITfLangB static HRESULT WINAPI LangBarMgr_UnAdviseEventSink( ITfLangBarMgr* iface, DWORD dwCookie) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -103,7 +108,7 @@ static HRESULT WINAPI LangBarMgr_UnAdviseEventSink( ITfLangBarMgr* iface, DWORD static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface( ITfLangBarMgr* iface, DWORD dwThreadId, DWORD dwType, REFIID riid, IUnknown **ppunk) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -111,7 +116,7 @@ static HRESULT WINAPI LangBarMgr_GetThreadMarshalInterface( ITfLangBarMgr* iface static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr( ITfLangBarMgr* iface, DWORD dwThreadId, ITfLangBarItemMgr **pplbi, DWORD *pdwThreadid) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -119,7 +124,7 @@ static HRESULT WINAPI LangBarMgr_GetThreadLangBarItemMgr( ITfLangBarMgr* iface, static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface, DWORD dwThreadId, ITfInputProcessorProfiles **ppaip, DWORD *pdwThreadid) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -127,7 +132,7 @@ static HRESULT WINAPI LangBarMgr_GetInputProcessorProfiles( ITfLangBarMgr* iface static HRESULT WINAPI LangBarMgr_RestoreLastFocus( ITfLangBarMgr* iface, DWORD *dwThreadId, BOOL fPrev) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -135,7 +140,7 @@ static HRESULT WINAPI LangBarMgr_RestoreLastFocus( ITfLangBarMgr* iface, DWORD * static HRESULT WINAPI LangBarMgr_SetModalInput( ITfLangBarMgr* iface, ITfLangBarEventSink *pSink, DWORD dwThreadId, DWORD dwFlags) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -143,7 +148,7 @@ static HRESULT WINAPI LangBarMgr_SetModalInput( ITfLangBarMgr* iface, ITfLangBar static HRESULT WINAPI LangBarMgr_ShowFloating( ITfLangBarMgr* iface, DWORD dwFlags) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -151,7 +156,7 @@ static HRESULT WINAPI LangBarMgr_ShowFloating( ITfLangBarMgr* iface, DWORD dwFla static HRESULT WINAPI LangBarMgr_GetShowFloatingStatus( ITfLangBarMgr* iface, DWORD *pdwFlags) { - LangBarMgr *This = (LangBarMgr *)iface; + LangBarMgr *This = impl_from_ITfLangBarMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -184,7 +189,7 @@ HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) if (This == NULL) return E_OUTOFMEMORY; - This->LangBarMgrVtbl= &LangBarMgr_LangBarMgrVtbl; + This->ITfLangBarMgr_iface.lpVtbl = &LangBarMgr_LangBarMgrVtbl; This->refCount = 1; TRACE("returning %p\n", This);
1
0
0
0
Michael Stefaniuc : msctf: Use an iface instead of a vtbl pointer in CategoryMgr.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 774ef1d3cbdfa3cd321466218088a328f85b77dd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=774ef1d3cbdfa3cd321466218…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:38 2010 +0100 msctf: Use an iface instead of a vtbl pointer in CategoryMgr. --- dlls/msctf/categorymgr.c | 43 ++++++++++++++++++++++++------------------- 1 files changed, 24 insertions(+), 19 deletions(-) diff --git a/dlls/msctf/categorymgr.c b/dlls/msctf/categorymgr.c index b76bebb..7c19c12 100644 --- a/dlls/msctf/categorymgr.c +++ b/dlls/msctf/categorymgr.c @@ -41,10 +41,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagCategoryMgr { - const ITfCategoryMgrVtbl *CategoryMgrVtbl; + ITfCategoryMgr ITfCategoryMgr_iface; LONG refCount; } CategoryMgr; +static inline CategoryMgr *impl_from_ITfCategoryMgr(ITfCategoryMgr *iface) +{ + return CONTAINING_RECORD(iface, CategoryMgr, ITfCategoryMgr_iface); +} + static void CategoryMgr_Destructor(CategoryMgr *This) { TRACE("destroying %p\n", This); @@ -53,7 +58,7 @@ static void CategoryMgr_Destructor(CategoryMgr *This) static HRESULT WINAPI CategoryMgr_QueryInterface(ITfCategoryMgr *iface, REFIID iid, LPVOID *ppvOut) { - CategoryMgr *This = (CategoryMgr *)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfCategoryMgr)) @@ -73,13 +78,13 @@ static HRESULT WINAPI CategoryMgr_QueryInterface(ITfCategoryMgr *iface, REFIID i static ULONG WINAPI CategoryMgr_AddRef(ITfCategoryMgr *iface) { - CategoryMgr *This = (CategoryMgr *)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI CategoryMgr_Release(ITfCategoryMgr *iface) { - CategoryMgr *This = (CategoryMgr *)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -100,7 +105,7 @@ static HRESULT WINAPI CategoryMgr_RegisterCategory ( ITfCategoryMgr *iface, WCHAR buf2[39]; ULONG res; HKEY tipkey,catkey,itmkey; - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); static const WCHAR ctg[] = {'C','a','t','e','g','o','r','y',0}; static const WCHAR itm[] = {'I','t','e','m',0}; @@ -148,7 +153,7 @@ static HRESULT WINAPI CategoryMgr_UnregisterCategory ( ITfCategoryMgr *iface, WCHAR buf[39]; WCHAR buf2[39]; HKEY tipkey; - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); static const WCHAR ctg[] = {'C','a','t','e','g','o','r','y',0}; static const WCHAR itm[] = {'I','t','e','m',0}; @@ -180,7 +185,7 @@ static HRESULT WINAPI CategoryMgr_UnregisterCategory ( ITfCategoryMgr *iface, static HRESULT WINAPI CategoryMgr_EnumCategoriesInItem ( ITfCategoryMgr *iface, REFGUID rguid, IEnumGUID **ppEnum) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -188,7 +193,7 @@ static HRESULT WINAPI CategoryMgr_EnumCategoriesInItem ( ITfCategoryMgr *iface, static HRESULT WINAPI CategoryMgr_EnumItemsInCategory ( ITfCategoryMgr *iface, REFGUID rcatid, IEnumGUID **ppEnum) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -203,7 +208,7 @@ static HRESULT WINAPI CategoryMgr_FindClosestCategory ( ITfCategoryMgr *iface, HKEY key; HRESULT hr = S_FALSE; INT index = 0; - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); TRACE("(%p)\n",This); @@ -263,7 +268,7 @@ static HRESULT WINAPI CategoryMgr_RegisterGUIDDescription ( ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid, const WCHAR *pchDesc, ULONG cch) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -271,7 +276,7 @@ static HRESULT WINAPI CategoryMgr_RegisterGUIDDescription ( static HRESULT WINAPI CategoryMgr_UnregisterGUIDDescription ( ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -279,7 +284,7 @@ static HRESULT WINAPI CategoryMgr_UnregisterGUIDDescription ( static HRESULT WINAPI CategoryMgr_GetGUIDDescription ( ITfCategoryMgr *iface, REFGUID rguid, BSTR *pbstrDesc) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -287,7 +292,7 @@ static HRESULT WINAPI CategoryMgr_GetGUIDDescription ( ITfCategoryMgr *iface, static HRESULT WINAPI CategoryMgr_RegisterGUIDDWORD ( ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid, DWORD dw) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -295,7 +300,7 @@ static HRESULT WINAPI CategoryMgr_RegisterGUIDDWORD ( ITfCategoryMgr *iface, static HRESULT WINAPI CategoryMgr_UnregisterGUIDDWORD ( ITfCategoryMgr *iface, REFCLSID rclsid, REFGUID rguid) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -303,7 +308,7 @@ static HRESULT WINAPI CategoryMgr_UnregisterGUIDDWORD ( ITfCategoryMgr *iface, static HRESULT WINAPI CategoryMgr_GetGUIDDWORD ( ITfCategoryMgr *iface, REFGUID rguid, DWORD *pdw) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -315,7 +320,7 @@ static HRESULT WINAPI CategoryMgr_RegisterGUID ( ITfCategoryMgr *iface, DWORD index; GUID *checkguid; DWORD id; - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); TRACE("(%p) %s %p\n",This,debugstr_guid(rguid),pguidatom); @@ -350,7 +355,7 @@ static HRESULT WINAPI CategoryMgr_RegisterGUID ( ITfCategoryMgr *iface, static HRESULT WINAPI CategoryMgr_GetGUID ( ITfCategoryMgr *iface, TfGuidAtom guidatom, GUID *pguid) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); TRACE("(%p) %i\n",This,guidatom); @@ -368,7 +373,7 @@ static HRESULT WINAPI CategoryMgr_GetGUID ( ITfCategoryMgr *iface, static HRESULT WINAPI CategoryMgr_IsEqualTfGuidAtom ( ITfCategoryMgr *iface, TfGuidAtom guidatom, REFGUID rguid, BOOL *pfEqual) { - CategoryMgr *This = (CategoryMgr*)iface; + CategoryMgr *This = impl_from_ITfCategoryMgr(iface); TRACE("(%p) %i %s %p\n",This,guidatom,debugstr_guid(rguid),pfEqual); @@ -418,7 +423,7 @@ HRESULT CategoryMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) if (This == NULL) return E_OUTOFMEMORY; - This->CategoryMgrVtbl= &CategoryMgr_CategoryMgrVtbl; + This->ITfCategoryMgr_iface.lpVtbl = &CategoryMgr_CategoryMgrVtbl; This->refCount = 1; TRACE("returning %p\n", This);
1
0
0
0
Michael Stefaniuc : msctf: Use an iface instead of a vtbl pointer in ClassFactory.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 3f6751f4dee14c76da0a4bda97299c3e5aa0a409 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f6751f4dee14c76da0a4bda9…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:39 2010 +0100 msctf: Use an iface instead of a vtbl pointer in ClassFactory. --- dlls/msctf/msctf.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/msctf/msctf.c b/dlls/msctf/msctf.c index b6342d0..f69c46e 100644 --- a/dlls/msctf/msctf.c +++ b/dlls/msctf/msctf.c @@ -95,11 +95,16 @@ static const struct { typedef struct tagClassFactory { - const IClassFactoryVtbl *vtbl; + IClassFactory IClassFactory_iface; LONG ref; LPFNCONSTRUCTOR ctor; } ClassFactory; +static inline ClassFactory *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface); +} + static void ClassFactory_Destructor(ClassFactory *This) { TRACE("Destroying class factory %p\n", This); @@ -122,13 +127,13 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); return InterlockedIncrement(&This->ref); } static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); ULONG ret = InterlockedDecrement(&This->ref); if (ret == 0) @@ -138,7 +143,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *punkOuter, REFIID iid, LPVOID *ppvOut) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); HRESULT ret; IUnknown *obj; @@ -153,7 +158,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock) { - ClassFactory *This = (ClassFactory *)iface; + ClassFactory *This = impl_from_IClassFactory(iface); TRACE("(%p)->(%x)\n", This, fLock); @@ -179,7 +184,7 @@ static const IClassFactoryVtbl ClassFactoryVtbl = { static HRESULT ClassFactory_Constructor(LPFNCONSTRUCTOR ctor, LPVOID *ppvOut) { ClassFactory *This = HeapAlloc(GetProcessHeap(),0,sizeof(ClassFactory)); - This->vtbl = &ClassFactoryVtbl; + This->IClassFactory_iface.lpVtbl = &ClassFactoryVtbl; This->ref = 1; This->ctor = ctor; *ppvOut = This;
1
0
0
0
Michael Stefaniuc : msctf: Use an iface instead of a vtbl pointer in DisplayAttributeMgr.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: 242bd9e4b26a69466c7fb2210e815f0f9c29969e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=242bd9e4b26a69466c7fb2210…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:38 2010 +0100 msctf: Use an iface instead of a vtbl pointer in DisplayAttributeMgr. --- dlls/msctf/displayattributemgr.c | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlls/msctf/displayattributemgr.c b/dlls/msctf/displayattributemgr.c index 75248cd..44c61ab 100644 --- a/dlls/msctf/displayattributemgr.c +++ b/dlls/msctf/displayattributemgr.c @@ -31,12 +31,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(msctf); typedef struct tagDisplayAttributeMgr { - const ITfDisplayAttributeMgrVtbl *DisplayAttributeMgrVtbl; + ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface; LONG refCount; } DisplayAttributeMgr; +static inline DisplayAttributeMgr *impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr *iface) +{ + return CONTAINING_RECORD(iface, DisplayAttributeMgr, ITfDisplayAttributeMgr_iface); +} + static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This) { TRACE("destroying %p\n", This); @@ -46,7 +51,7 @@ static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This) static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr)) @@ -66,13 +71,13 @@ static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); return InterlockedIncrement(&This->refCount); } static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -87,7 +92,7 @@ static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface) static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -95,7 +100,7 @@ static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *i static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -103,7 +108,7 @@ static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAtt static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner) { - DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; @@ -130,7 +135,7 @@ HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) if (This == NULL) return E_OUTOFMEMORY; - This->DisplayAttributeMgrVtbl= &DisplayAttributeMgr_DisplayAttributeMgrVtbl; + This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgr_DisplayAttributeMgrVtbl; This->refCount = 1; TRACE("returning %p\n", This);
1
0
0
0
Michael Stefaniuc : strmbase: Use an iface instead of a vtbl pointer in IEnumMediaTypesImpl.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: adfc457234b5c1d852a59816832e3f5e611ff426 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=adfc457234b5c1d852a598168…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:24 2010 +0100 strmbase: Use an iface instead of a vtbl pointer in IEnumMediaTypesImpl. --- dlls/strmbase/mediatype.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/strmbase/mediatype.c b/dlls/strmbase/mediatype.c index b9255c3..0093435 100644 --- a/dlls/strmbase/mediatype.c +++ b/dlls/strmbase/mediatype.c @@ -85,7 +85,7 @@ typedef struct tagENUMEDIADETAILS typedef struct IEnumMediaTypesImpl { - const IEnumMediaTypesVtbl * lpVtbl; + IEnumMediaTypes IEnumMediaTypes_iface; LONG refCount; BasePin *basePin; BasePin_GetMediaType enumMediaFunction; @@ -95,6 +95,11 @@ typedef struct IEnumMediaTypesImpl ULONG uIndex; } IEnumMediaTypesImpl; +static inline IEnumMediaTypesImpl *impl_from_IEnumMediaTypes(IEnumMediaTypes *iface) +{ + return CONTAINING_RECORD(iface, IEnumMediaTypesImpl, IEnumMediaTypes_iface); +} + static const struct IEnumMediaTypesVtbl IEnumMediaTypesImpl_Vtbl; HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum) @@ -108,7 +113,7 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e *ppEnum = NULL; return E_OUTOFMEMORY; } - pEnumMediaTypes->lpVtbl = &IEnumMediaTypesImpl_Vtbl; + pEnumMediaTypes->IEnumMediaTypes_iface.lpVtbl = &IEnumMediaTypesImpl_Vtbl; pEnumMediaTypes->refCount = 1; pEnumMediaTypes->uIndex = 0; pEnumMediaTypes->enumMediaFunction = enumFunc; @@ -132,7 +137,7 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *basePin, BasePin_GetMediaType e return E_OUTOFMEMORY; } } - *ppEnum = (IEnumMediaTypes *)(&pEnumMediaTypes->lpVtbl); + *ppEnum = &pEnumMediaTypes->IEnumMediaTypes_iface; pEnumMediaTypes->currentVersion = versionFunc(basePin); return S_OK; } @@ -161,7 +166,7 @@ static HRESULT WINAPI IEnumMediaTypesImpl_QueryInterface(IEnumMediaTypes * iface static ULONG WINAPI IEnumMediaTypesImpl_AddRef(IEnumMediaTypes * iface) { - IEnumMediaTypesImpl *This = (IEnumMediaTypesImpl *)iface; + IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface); ULONG refCount = InterlockedIncrement(&This->refCount); TRACE("(%p)->() AddRef from %d\n", iface, refCount - 1); @@ -171,7 +176,7 @@ static ULONG WINAPI IEnumMediaTypesImpl_AddRef(IEnumMediaTypes * iface) static ULONG WINAPI IEnumMediaTypesImpl_Release(IEnumMediaTypes * iface) { - IEnumMediaTypesImpl *This = (IEnumMediaTypesImpl *)iface; + IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface); ULONG refCount = InterlockedDecrement(&This->refCount); TRACE("(%p)->() Release from %d\n", iface, refCount + 1); @@ -192,7 +197,7 @@ static ULONG WINAPI IEnumMediaTypesImpl_Release(IEnumMediaTypes * iface) static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes * iface, ULONG cMediaTypes, AM_MEDIA_TYPE ** ppMediaTypes, ULONG * pcFetched) { ULONG cFetched; - IEnumMediaTypesImpl *This = (IEnumMediaTypesImpl *)iface; + IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface); cFetched = min(This->enumMediaDetails.cMediaTypes, This->uIndex + cMediaTypes) - This->uIndex; @@ -227,7 +232,7 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Next(IEnumMediaTypes * iface, ULONG cM static HRESULT WINAPI IEnumMediaTypesImpl_Skip(IEnumMediaTypes * iface, ULONG cMediaTypes) { - IEnumMediaTypesImpl *This = (IEnumMediaTypesImpl *)iface; + IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface); TRACE("(%u)\n", cMediaTypes); if (This->currentVersion != This->mediaVersionFunction(This->basePin)) @@ -245,7 +250,7 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface) { ULONG i; AM_MEDIA_TYPE amt; - IEnumMediaTypesImpl *This = (IEnumMediaTypesImpl *)iface; + IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface); TRACE("()\n"); @@ -280,7 +285,7 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface) static HRESULT WINAPI IEnumMediaTypesImpl_Clone(IEnumMediaTypes * iface, IEnumMediaTypes ** ppEnum) { HRESULT hr; - IEnumMediaTypesImpl *This = (IEnumMediaTypesImpl *)iface; + IEnumMediaTypesImpl *This = impl_from_IEnumMediaTypes(iface); TRACE("(%p)\n", ppEnum);
1
0
0
0
Michael Stefaniuc : rpcrt4: Use an iface instead of a vtbl pointer in RpcStreamImpl.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: c38d6fed39e62f7fc4984e471ae5b55534e6ba42 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c38d6fed39e62f7fc4984e471…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:42 2010 +0100 rpcrt4: Use an iface instead of a vtbl pointer in RpcStreamImpl. --- dlls/rpcrt4/ndr_ole.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/rpcrt4/ndr_ole.c b/dlls/rpcrt4/ndr_ole.c index 090be05..c3ab529 100644 --- a/dlls/rpcrt4/ndr_ole.c +++ b/dlls/rpcrt4/ndr_ole.c @@ -78,7 +78,7 @@ static HMODULE LoadCOM(void) * (which also implements the MInterfacePointer structure) */ typedef struct RpcStreamImpl { - const IStreamVtbl *lpVtbl; + IStream IStream_iface; LONG RefCount; PMIDL_STUB_MESSAGE pMsg; LPDWORD size; @@ -86,11 +86,16 @@ typedef struct RpcStreamImpl DWORD pos; } RpcStreamImpl; +static inline RpcStreamImpl *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, RpcStreamImpl, IStream_iface); +} + static HRESULT WINAPI RpcStream_QueryInterface(LPSTREAM iface, REFIID riid, LPVOID *obj) { - RpcStreamImpl *This = (RpcStreamImpl *)iface; + RpcStreamImpl *This = impl_from_IStream(iface); if (IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ISequentialStream, riid) || IsEqualGUID(&IID_IStream, riid)) { @@ -103,13 +108,13 @@ static HRESULT WINAPI RpcStream_QueryInterface(LPSTREAM iface, static ULONG WINAPI RpcStream_AddRef(LPSTREAM iface) { - RpcStreamImpl *This = (RpcStreamImpl *)iface; + RpcStreamImpl *This = impl_from_IStream(iface); return InterlockedIncrement( &This->RefCount ); } static ULONG WINAPI RpcStream_Release(LPSTREAM iface) { - RpcStreamImpl *This = (RpcStreamImpl *)iface; + RpcStreamImpl *This = impl_from_IStream(iface); ULONG ref = InterlockedDecrement( &This->RefCount ); if (!ref) { TRACE("size=%d\n", *This->size); @@ -125,7 +130,7 @@ static HRESULT WINAPI RpcStream_Read(LPSTREAM iface, ULONG cb, ULONG *pcbRead) { - RpcStreamImpl *This = (RpcStreamImpl *)iface; + RpcStreamImpl *This = impl_from_IStream(iface); HRESULT hr = S_OK; if (This->pos + cb > *This->size) { @@ -145,7 +150,7 @@ static HRESULT WINAPI RpcStream_Write(LPSTREAM iface, ULONG cb, ULONG *pcbWritten) { - RpcStreamImpl *This = (RpcStreamImpl *)iface; + RpcStreamImpl *This = impl_from_IStream(iface); if (This->data + cb > (unsigned char *)This->pMsg->RpcMsg->Buffer + This->pMsg->BufferLength) return STG_E_MEDIUMFULL; memcpy(This->data + This->pos, pv, cb); @@ -160,7 +165,7 @@ static HRESULT WINAPI RpcStream_Seek(LPSTREAM iface, DWORD origin, ULARGE_INTEGER *newPos) { - RpcStreamImpl *This = (RpcStreamImpl *)iface; + RpcStreamImpl *This = impl_from_IStream(iface); switch (origin) { case STREAM_SEEK_SET: This->pos = move.u.LowPart; @@ -184,7 +189,7 @@ static HRESULT WINAPI RpcStream_Seek(LPSTREAM iface, static HRESULT WINAPI RpcStream_SetSize(LPSTREAM iface, ULARGE_INTEGER newSize) { - RpcStreamImpl *This = (RpcStreamImpl *)iface; + RpcStreamImpl *This = impl_from_IStream(iface); *This->size = newSize.u.LowPart; return S_OK; } @@ -212,7 +217,7 @@ static LPSTREAM RpcStream_Create(PMIDL_STUB_MESSAGE pStubMsg, BOOL init) RpcStreamImpl *This; This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(RpcStreamImpl)); if (!This) return NULL; - This->lpVtbl = &RpcStream_Vtbl; + This->IStream_iface.lpVtbl = &RpcStream_Vtbl; This->RefCount = 1; This->pMsg = pStubMsg; This->size = (LPDWORD)pStubMsg->Buffer;
1
0
0
0
Michael Stefaniuc : ole32: Use an iface instead of a vtbl pointer in PointerMonikerImpl.
by Alexandre Julliard
09 Dec '10
09 Dec '10
Module: wine Branch: master Commit: adbcfb7e5c55abbf3a1188437510e6bdb83d2a98 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=adbcfb7e5c55abbf3a1188437…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Dec 8 22:59:47 2010 +0100 ole32: Use an iface instead of a vtbl pointer in PointerMonikerImpl. --- dlls/ole32/pointermoniker.c | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-) diff --git a/dlls/ole32/pointermoniker.c b/dlls/ole32/pointermoniker.c index 299b44e..d79afd2 100644 --- a/dlls/ole32/pointermoniker.c +++ b/dlls/ole32/pointermoniker.c @@ -40,17 +40,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); /* PointerMoniker data structure */ typedef struct PointerMonikerImpl{ - const IMonikerVtbl* lpvtbl; /* VTable relative to the IMoniker interface.*/ + IMoniker IMoniker_iface; LONG ref; /* reference counter for this object */ IUnknown *pObject; /* custom marshaler */ } PointerMonikerImpl; +static inline PointerMonikerImpl *impl_from_IMoniker(IMoniker *iface) +{ +return CONTAINING_RECORD(iface, PointerMonikerImpl, IMoniker_iface); +} + static HRESULT WINAPI PointerMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) { - PointerMonikerImpl *This = (PointerMonikerImpl *)iface; + PointerMonikerImpl *This = impl_from_IMoniker(iface); TRACE("(%p,%p,%p)\n",This,riid,ppvObject); @@ -84,7 +89,7 @@ PointerMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) static ULONG WINAPI PointerMonikerImpl_AddRef(IMoniker* iface) { - PointerMonikerImpl *This = (PointerMonikerImpl *)iface; + PointerMonikerImpl *This = impl_from_IMoniker(iface); TRACE("(%p)\n",This); @@ -97,7 +102,7 @@ PointerMonikerImpl_AddRef(IMoniker* iface) static ULONG WINAPI PointerMonikerImpl_Release(IMoniker* iface) { - PointerMonikerImpl *This = (PointerMonikerImpl *)iface; + PointerMonikerImpl *This = impl_from_IMoniker(iface); ULONG ref; TRACE("(%p)\n",This); @@ -194,7 +199,7 @@ static HRESULT WINAPI PointerMonikerImpl_BindToObject(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult) { - PointerMonikerImpl *This = (PointerMonikerImpl *)iface; + PointerMonikerImpl *This = impl_from_IMoniker(iface); TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); @@ -211,7 +216,7 @@ static HRESULT WINAPI PointerMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, REFIID riid, VOID** ppvResult) { - PointerMonikerImpl *This = (PointerMonikerImpl *)iface; + PointerMonikerImpl *This = impl_from_IMoniker(iface); TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); @@ -336,7 +341,7 @@ PointerMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoni static HRESULT WINAPI PointerMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker) { - PointerMonikerImpl *This = (PointerMonikerImpl *)iface; + PointerMonikerImpl *This = impl_from_IMoniker(iface); DWORD mkSys; TRACE("(%p,%p)\n",iface,pmkOtherMoniker); @@ -348,7 +353,7 @@ PointerMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker) if (mkSys==MKSYS_POINTERMONIKER) { - PointerMonikerImpl *pOtherMoniker = (PointerMonikerImpl *)pmkOtherMoniker; + PointerMonikerImpl *pOtherMoniker = impl_from_IMoniker(pmkOtherMoniker); return This->pObject == pOtherMoniker->pObject ? S_OK : S_FALSE; } else @@ -360,7 +365,7 @@ PointerMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker) ******************************************************************************/ static HRESULT WINAPI PointerMonikerImpl_Hash(IMoniker* iface,DWORD* pdwHash) { - PointerMonikerImpl *This = (PointerMonikerImpl *)iface; + PointerMonikerImpl *This = impl_from_IMoniker(iface); if (pdwHash==NULL) return E_POINTER; @@ -467,7 +472,7 @@ PointerMonikerImpl_ParseDisplayName(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLeft, LPOLESTR pszDisplayName, ULONG* pchEaten, IMoniker** ppmkOut) { - PointerMonikerImpl *This = (PointerMonikerImpl *)iface; + PointerMonikerImpl *This = impl_from_IMoniker(iface); HRESULT hr; IParseDisplayName *pPDN; @@ -543,8 +548,8 @@ static void PointerMonikerImpl_Construct(PointerMonikerImpl* This, IUnknown *pun TRACE("(%p)\n",This); /* Initialize the virtual function table. */ - This->lpvtbl = &VT_PointerMonikerImpl; - This->ref = 1; + This->IMoniker_iface.lpVtbl = &VT_PointerMonikerImpl; + This->ref = 1; if (punk) IUnknown_AddRef(punk); This->pObject = punk; @@ -580,7 +585,7 @@ HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER *ppmk) } PointerMonikerImpl_Construct(This, punk); - *ppmk = (IMoniker *)&This->lpvtbl; + *ppmk = &This->IMoniker_iface; return S_OK; }
1
0
0
0
← Newer
1
...
58
59
60
61
62
63
64
...
110
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
99
100
101
102
103
104
105
106
107
108
109
110
Results per page:
10
25
50
100
200